//保存预制文件 static void CreatePrefabFile(GameObject panel, bool isBuildAssetBundle) { //读取记录 PerfabRecorder.ReadRecord(panel); panel.SetActive(false); //为啥一定要隐藏 string path = string.Format("{0}/{1}.prefab", KAssetManager.PrefabFolder, panel.name); GameObject go = PrefabUtility.CreatePrefab(path, panel, ReplacePrefabOptions.ConnectToPrefab | ReplacePrefabOptions.ReplaceNameBased); AssetDatabase.SaveAssets(); if (isBuildAssetBundle == true) { //call build asset bundle API here //创建Bundle } panel.SetActive(true); Selection.activeGameObject = go; //选中预制 //lss.editor.GenerateUIWrapper.DoGenGUIWrapper(true); //不需要搞这种了 }
public static void Main() { _window = EditorWindow.GetWindow <PerfabRecorder>("综合信息记录"); _window.Show(); }