/// <summary> /// ����һ������ Ĭ����ĩβ�� /// </summary> /// <param name="function"></param> public static void InsertFunction(EditorQueueData functionData, InsertPosType insertPosType = InsertPosType.End) { if (!File.Exists(taskFull)) { var fc = File.Create(taskFull); fc.Close(); fc.Dispose(); } using (FileStream fs = new FileStream(taskFull, FileMode.Open, FileAccess.ReadWrite)) { string allString = ReadFileStream(fs); List <EditorQueueData> tempData = null; if (!string.IsNullOrEmpty(allString)) { tempData = LitJson.JsonMapper.ToObject <List <EditorQueueData> >(allString); } if (tempData == null) { tempData = new List <EditorQueueData>(); } int insertIndex = 0; if (insertPosType == InsertPosType.End) { insertIndex = tempData.Count; } tempData.Insert(insertIndex, functionData); allString = LitJson.JsonMapper.ToJson(tempData); WriteFileStream(fs, allString); fs.Close(); } }
/// <summary> /// 一键打包 /// </summary> private void GenerateAssetBundleandBuildAppAll() { EditorMonoBehaviour.isCanExecute = false; EditorMonoBehaviour.Init(); //slua // SLua.LuaCodeGen.RegidetEditorQueueFunction(); //assgetbundlewin string[] buildApp = new string[] { "BuildAssetBundles", "BuildApp" }; EditorQueueData data = new EditorQueueData() { funcNameList = new List <string>(buildApp), classType = "GameEditor.AssetBuidler.AssetBuilderWin", }; EditorMonoBehaviour.InsertFunction(data); EditorMonoBehaviour.isCanExecute = true; }