public static AssetDBSetting GetInstance()
 {
     if (ms_Instance == null)
     {
         ms_Instance = new AssetDBSetting();
     }
     return(ms_Instance);
 }
Esempio n. 2
0
        private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {
            if (!AssetDBSetting.GetInstance().GetHandleAssetPostprocessor())
            {
                return;
            }

            DB.GetInstance().OnPostprocessAllAssets(importedAssets
                                                    , deletedAssets
                                                    , movedAssets
                                                    , movedFromAssetPaths);
        }
        public override void OnGUI(string searchContext)
        {
            base.OnGUI(searchContext);
            AssetDBSetting setting = AssetDBSetting.GetInstance();

            EditorGUILayout.BeginHorizontal();
            setting.SetHandleAssetPostprocessor(EditorGUILayout.Toggle("自动计算资源引用关系", setting.GetHandleAssetPostprocessor()));
            if (setting.GetHandleAssetPostprocessor() &&
                GUILayout.Button("重新计算所有资源的引用关系"))
            {
                DB.GetInstance().RecaculateDBWithDialog();
            }
            EditorGUILayout.EndHorizontal();
            if (setting.GetHandleAssetPostprocessor())
            {
                EditorGUILayout.HelpBox("开启\"自动计算资源引用关系\"功能后,最好执行一次\"重新计算所有资源的引用关系\"", MessageType.Info);
            }
        }