internal static void InitializeSettings(string assetGuid)
        {
            settingsGuid = assetGuid;
            settingsPath = AssetDatabase.GUIDToAssetPath(assetGuid);
            //try to get proper settings asset from provided guid
            var settings = AssetDatabase.LoadAssetAtPath <ToolboxEditorSettings>(settingsPath);

            if (settings == null)
            {
                ToolboxEditorLog.KitInitializationWarning(settingsType);
                return;
            }

            Settings = settings;
            Settings.AddOnSettingsUpdatedListener(() =>
            {
                //perform separated data models update
                ToolboxDrawerUtility.PerformData();
                ToolboxProjectUtility.PerformData();
                ToolboxHierarchyUtility.PerformData();

                //perform additional repaint to update GUI
                ToolboxEditorProject.RepaintProjectOverlay();
                ToolboxEditorHierarchy.RepaintHierarchyOverlay();
            });

            //initialize core functionalities
            ToolboxDrawerUtility.PerformData(Settings);
            ToolboxProjectUtility.PerformData(Settings);
            ToolboxHierarchyUtility.PerformData(Settings);
        }
Beispiel #2
0
        internal static void InitializeSettings(string assetGuid)
        {
            settingsGuid = assetGuid;
            settingsPath = AssetDatabase.GUIDToAssetPath(assetGuid);
            //try to get proper settings asset from provided guid
            var settings = AssetDatabase.LoadAssetAtPath <ToolboxEditorSettings>(settingsPath);

            if (settings == null)
            {
                ToolboxEditorLog.KitInitializationWarning(settingsType);
                return;
            }

            Settings = settings;

            //initialize core functionalities
            ToolboxDrawerUtility.InitializeDrawers(Settings);
            ToolboxFolderUtility.InitializeProject(Settings);
        }