コード例 #1
0
ファイル: BaseBrushUIGroup.cs プロジェクト: Reflex21/Moba
        public virtual void OnInspectorGUI(Terrain terrain, IOnInspectorGUI editContext)
        {
            m_ShowBrushTextures = TerrainToolGUIHelper.DrawHeaderFoldout(Styles.brushMask, m_ShowBrushTextures);
            if (m_ShowBrushTextures)
            {
                editContext.ShowBrushesGUI(0, BrushGUIEditFlags.SelectAndInspect);
            }

            EditorGUI.BeginChangeCheck();
            brushMaskFilterStackView.OnGUI();

            m_ShowModifierControls = TerrainToolGUIHelper.DrawHeaderFoldout(Styles.stroke, m_ShowModifierControls);
            if (m_ShowModifierControls)
            {
                if (m_BrushStrengthController != null)
                {
                    EditorGUILayout.BeginVertical(Styles.kGroupBox);
                    m_BrushStrengthController.OnInspectorGUI(terrain, editContext);
                    EditorGUILayout.EndVertical();
                }

                if (m_BrushSizeController != null)
                {
                    EditorGUILayout.BeginVertical(Styles.kGroupBox);
                    m_BrushSizeController.OnInspectorGUI(terrain, editContext);
                    EditorGUILayout.EndVertical();
                }

                if (m_BrushRotationController != null)
                {
                    EditorGUILayout.BeginVertical(Styles.kGroupBox);
                    m_BrushRotationController?.OnInspectorGUI(terrain, editContext);
                    EditorGUILayout.EndVertical();
                }

                if ((m_BrushSpacingController != null) || (m_BrushScatterController != null))
                {
                    EditorGUILayout.BeginVertical(Styles.kGroupBox);
                    m_BrushSpacingController?.OnInspectorGUI(terrain, editContext);
                    m_BrushScatterController?.OnInspectorGUI(terrain, editContext);
                    EditorGUILayout.EndVertical();
                }
            }

            if (EditorGUI.EndChangeCheck())
            {
                TerrainToolsAnalytics.OnParameterChange();
            }
        }
コード例 #2
0
        public virtual void OnInspectorGUI(Terrain terrain, IOnInspectorGUI editContext)
        {
            m_ShowBrushTextures = TerrainToolGUIHelper.DrawHeaderFoldout(Styles.brushMask, m_ShowBrushTextures);
            if (m_ShowBrushTextures)
            {
                editContext.ShowBrushesGUI(0, BrushGUIEditFlags.SelectAndInspect);
            }

            // Removing this for now for cleaner UI / UX. If we want to bring this back, we should build a global
            // Brush Settings dialog somewhere.s
            //s_MultipleControlShortcuts = EditorGUILayout.Toggle(Styles.multipleControls, s_MultipleControlShortcuts);

            m_ShowModifierControls = TerrainToolGUIHelper.DrawHeaderFoldout(Styles.stroke, m_ShowModifierControls);
            if (m_ShowModifierControls)
            {
                if (m_BrushStrengthController != null)
                {
                    EditorGUILayout.BeginVertical(Styles.kGroupBox);
                    m_BrushStrengthController.OnInspectorGUI(terrain, editContext);
                    EditorGUILayout.EndVertical();
                }

                if (m_BrushSizeController != null)
                {
                    EditorGUILayout.BeginVertical(Styles.kGroupBox);
                    m_BrushSizeController.OnInspectorGUI(terrain, editContext);
                    EditorGUILayout.EndVertical();
                }

                if (m_BrushRotationController != null)
                {
                    EditorGUILayout.BeginVertical(Styles.kGroupBox);
                    m_BrushRotationController?.OnInspectorGUI(terrain, editContext);
                    EditorGUILayout.EndVertical();
                }

                if ((m_BrushSpacingController != null) || (m_BrushScatterController != null))
                {
                    EditorGUILayout.BeginVertical(Styles.kGroupBox);
                    m_BrushSpacingController?.OnInspectorGUI(terrain, editContext);
                    m_BrushScatterController?.OnInspectorGUI(terrain, editContext);
                    EditorGUILayout.EndVertical();
                }
            }
        }