Exemplo n.º 1
0
        /// <summary>
        /// Check UI is ready & does not need to be reinitialized
        /// </summary>
        static void CheckInitialized()
        {
            PreferencesUI.InitPreferences();
            PreferencesUI.AutoConvertAssets();

            if (!PreferencesUI.folderIconEnabled)
            {
                return;
            }

            // Get all openned project browser
            IList opennedBrowsers = (IList)opennedBrowsersField.GetValue(null);

            // For each openned project browser try to initialize custom GUI
            foreach (object projectView in opennedBrowsers)
            {
                object folderTreeController = folderTreeField.GetValue(projectView);
                object assetTreeController  = assetTreeField.GetValue(projectView);

                // View changed
                if (folderTreeController != lastFolderTreeController || lastAssetTreeController != assetTreeController)
                {
                    InitUI();
                }

                lastFolderTreeController = folderTreeController;
                lastAssetTreeController  = assetTreeController;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Check UI is ready & does not need to be reinitialized
        /// </summary>
        static void CheckInitialized()
        {
            PreferencesUI.InitPreferences();

            if (!EditorPrefs.GetBool("ext_" + ResourceUtil.ExtensionName + "_enabled"))
            {
                return;
            }

            // Get all openned project browser
            IList opennedBrowsers = (IList)opennedBrowsersField.GetValue(null);

            // For each openned project browser try to initialize custom GUI
            foreach (object projectView in opennedBrowsers)
            {
                object folderTreeController = folderTreeField.GetValue(projectView);
                object assetTreeController  = assetTreeField.GetValue(projectView);

                // View changed
                if (folderTreeController != lastFolderTreeController || lastAssetTreeController != assetTreeController)
                {
                    InitUI();
                }

                lastFolderTreeController = folderTreeController;
                lastAssetTreeController  = assetTreeController;
            }
        }