public static void doSaveAsset(GameObject go) { CLPanelBase panel = go.GetComponent <CLPanelBase>(); if (panel == null) { return; } Debug.Log(panel.name); if (panel.isNeedResetAtlase) { CLUIUtl.resetAtlasAndFont(panel.transform, true); PrefabUtility.SavePrefabAsset(go); } string dir = Application.dataPath + "/" + ECLEditorUtl.getPathByObject(go); dir = Path.GetDirectoryName(dir); ECLCreatAssetBundle4Update.createAssets4Upgrade(dir, panel.gameObject, true); // 必须再取一次,好像执行了上面一句方法后,cell就会变成null panel = go.GetComponent <CLPanelBase>(); if (panel != null && panel.isNeedResetAtlase) { CLUIUtl.resetAtlasAndFont(panel.transform, false); PrefabUtility.SavePrefabAsset(go); } }
static public void setTexturesetting() { Object[] gos = Selection.objects; string path = ""; List <string> refreshFiles = new List <string> (); for (int i = 0; i < gos.Length; i++) { path = AssetDatabase.GetAssetPath(gos [i]); if (ECLTextureSetting.setTexture(path)) { // 说明有重新设置 refreshFiles.Add(path); } } for (int i = 0; i < refreshFiles.Count; i++) { ECLCreatAssetBundle4Update.createAssets4Upgrade(refreshFiles [i], true); } EditorUtility.DisplayDialog("success", "Finished", "Okay"); }