public static string GetPackageName() { int index = (int)AppPlatform.PlatformCurrent; return "Package_" + AppPlatform.PlatformNames[index]; }
/// <summary> /// 运行平台 /// </summary> /// <returns></returns> public static string GetModelPackageName() { int index = (int)AppPlatform.PlatformCurrent; return AppPlatform.PlatformNames[index]; }
public static string PlatformCurrentName { get { return PlatformNames[(int)AppPlatform.PlatformCurrent]; } }
public static string GetAssetBundleDirName() { return "AssetBundles"; }
public static string GetAssetBundleDirModelName() { return "ModelBundles"; //Windows }
public static string GetRuntimeChecklist { get { int index = (int)AppPlatform.PlatformCurrent; return AppPlatform.PlatformPathPrefixs[index] + GetStreamingAssetsPath; } }
public static string GetRuntimeAssetBundleUrl() { int index = (int)AppPlatform.PlatformCurrent; return AppPlatform.PlatformPathPrefixs[index] + RuntimeAssetsPath + GetPackageName() + "/" + GetAssetBundleDirName() + "/"; } public static string GetServerAssetBundleUrl() { int index = (int)AppPlatform.PlatformCurrent; return AppPlatform.PlatformNames[index].ToLower() + "/"; }
public static void Initialize() { AppPlatform.PlatformCurrent = RuntimePlatform_To_AppPlaform(Application.platform); }
public static string GetImgAndViedoPath() { if (Application.platform == RuntimePlatform.Android) { return "/sdcard/DCIM/Camera/"; } else if (Application.platform == RuntimePlatform.IPhonePlayer) { return ""; }
return Application.streamingAssetsPath + "/"; }
private static Platform RuntimePlatform_To_AppPlaform(RuntimePlatform runtimePlatform) { switch (runtimePlatform) { case UnityEngine.RuntimePlatform.Android: return Platform.Android; case UnityEngine.RuntimePlatform.IPhonePlayer: return Platform.IPhonePlayer; case UnityEngine.RuntimePlatform.OSXEditor: return Platform.OSXEditor; case UnityEngine.RuntimePlatform.OSXPlayer: return Platform.OSXPlayer; case UnityEngine.RuntimePlatform.WindowsEditor: return Platform.WindowsEditor; case UnityEngine.RuntimePlatform.WindowsPlayer: return Platform.WindowsPlayer; default: return Platform.Unkown; } } }