public void Reset() { CallBackList.Clear(); Crc = 0; Path = string.Empty; ResType = typeof(UnityEngine.Object); Priority = LoadResPriority.Res_Slow; LoadMode = LoadResMode.Resource; }
internal LoadResMode JudgeLoadMode(ResLoadMode mode) { LoadResMode load = LoadResMode.Resource; if (mode == ResLoadMode.Null) { load = loadResMode; } else if (mode == ResLoadMode.Res) { load = LoadResMode.Resource; } else if (mode == ResLoadMode.Ab) { load = LoadResMode.AssetBundle; } return(load); }
public static void Build() { LoadResMode mode = LoadResMode.Resource; ResKitConfig config = Resources.Load <ResKitConfig>(typeof(ResKitConfig).Name); if (config) { if (config.LoadResMode == LoadResMode.AssetBundle) { mode = LoadResMode.AssetBundle; } } if (mode == LoadResMode.AssetBundle) { BuildAssetBundle.BuildAB(); Copy(_ABPath, ResKitConst.AssetBundlePath); } if (!Directory.Exists(_BuildPath)) { Directory.CreateDirectory(_BuildPath); } string savePath = ""; switch (EditorUserBuildSettings.activeBuildTarget) { case BuildTarget.Android: savePath = _BuildPath + _AppName + string.Format("_{0:yyyy-MM-dd-HH-mm}.apk", System.DateTime.Now); break; case BuildTarget.iOS: savePath = _BuildPath + _AppName + string.Format("_{0:yyyy-MM-dd-HH-mm}", System.DateTime.Now); break; case BuildTarget.StandaloneWindows: case BuildTarget.StandaloneWindows64: savePath = _BuildPath + _AppName + string.Format("_{0:yyyy-MM-dd-HH-mm}/{1}.exe", System.DateTime.Now, _AppName); break; default: savePath = _BuildPath + _AppName + "_" + string.Format("{0:yyyy-MM-dd-HH-mm}", System.DateTime.Now); break; } BuildPipeline.BuildPlayer(FindEnableEditorScenes(), savePath, EditorUserBuildSettings.activeBuildTarget, BuildOptions.None); if (mode == LoadResMode.AssetBundle) { DeleteDir(Application.streamingAssetsPath); } Debug.Log("执行打包完成 " + savePath); #if UNITY_EDITOR_WIN string path = _BuildPath.Replace("/", "\\"); System.Diagnostics.Process.Start("explorer.exe", path); #endif }