Example #1
0
        public override void OnInspectorGUI()
        {
            if (redStyle == null || redStyle.normal.background == null || greenStyle == null || greenStyle.normal.background == null)
            {
                redStyle = new GUIStyle();
                redStyle.normal.background = GaiaUtils.GetBGTexture(Color.red, m_tempTextureList);

                greenStyle = new GUIStyle();
                greenStyle.normal.background = GaiaUtils.GetBGTexture(Color.green, m_tempTextureList);
            }


            //Init editor utils
            if (m_editorUtils == null)
            {
                // Get editor utils for this
                m_editorUtils = PWApp.GetEditorUtils(this);
            }
            m_editorUtils.Initialize(); // Do not remove this!
            if (GaiaUtils.HasDynamicLoadedTerrains())
            {
                m_editorUtils.Panel("GeneralSettings", DrawGeneralSettings, true);
                m_editorUtils.Panel("LoaderPanel", DrawLoaders, false);
                m_editorUtils.Panel("PlaceholderPanel", DrawTerrains, false);
            }
            else
            {
                EditorGUILayout.HelpBox(m_editorUtils.GetTextValue("NoTerrainLoadingMessage"), MessageType.Info);
            }
        }
Example #2
0
        public static void SetupOperationHeaderColor(ref GUIStyle style, string normalColor, string proColor, List <Texture2D> tempTextureList)
        {
            if (style == null || style.normal.background == null)
            {
                style = new GUIStyle();
                style.stretchWidth = true;
                style.margin       = new RectOffset(5, 5, 0, 0);
                //m_operationHeaderStyle.overflow = new RectOffset(2, 2, 2, 2);

                // Setup colors for Unity Pro
                if (EditorGUIUtility.isProSkin)
                {
                    style.normal.background = GaiaUtils.GetBGTexture(GaiaUtils.GetColorFromHTML(proColor), tempTextureList);
                }
                // or Unity Personal
                else
                {
                    style.normal.background = GaiaUtils.GetBGTexture(GaiaUtils.GetColorFromHTML(normalColor), tempTextureList);
                }
            }
        }