Example #1
0
        private void ShowGUI()
        {
            materialFoldout = EditorGUILayout.Foldout(materialFoldout, "Material", true, EditorGUIHelper.foldoutStyle);
            if (materialFoldout)
            {
                EditorGUILayout.PropertyField(new SerializedObject(myTarget).FindProperty("grassMaterial"));

                if (myTarget.grassMaterial != null)
                {
                    myTarget.grassMaterial.SetMaterialToGrass();
                }
                myTarget.CorrectGrassMaterialSettings();
            }
            EditorGUILayout.Space();

            physicsFoldout = EditorGUILayout.Foldout(physicsFoldout, "Physics", true, EditorGUIHelper.foldoutStyle);
            if (physicsFoldout)
            {
                myTarget.grassPhysics = EditorGUILayout.ObjectField("Grass Physics Script", myTarget.grassPhysics, typeof(GrassPhysics), true) as GrassPhysics;

                CorrectTabs();
                myTarget.grassMode = (GrassPhysicsMode)GUILayout.Toolbar((int)myTarget.grassMode, tabNames);

                if (myTarget.grassMode == GrassPhysicsMode.Full && AssetsManager.IsLowEndPlatform())
                {
                    EditorGUILayout.HelpBox(fullPhysicsWarningForLowEndPlatform, MessageType.Warning);
                }
            }
        }
Example #2
0
        public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
        {
            float standardHeight = EditorGUI.GetPropertyHeight(property, true);
            float totalHeight    = standardHeight;

            if (AssetsManager.IsLowEndPlatform())
            {
                totalHeight += 2 * standardHeight + EditorGUIUtility.standardVerticalSpacing;
            }
            return(totalHeight);
        }
Example #3
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            float standardHeight = EditorGUI.GetPropertyHeight(property, true);

            position.height = standardHeight;
            if (AssetsManager.IsLowEndPlatform())
            {
                LowEndPlatformWarningAttribute warningAttribute = attribute as LowEndPlatformWarningAttribute;
                Rect warningRect = new Rect(position.x, position.y, position.width, standardHeight * 2);
                EditorGUI.HelpBox(warningRect, warningAttribute.warning, MessageType.Warning);
                position.y += warningRect.height + EditorGUIUtility.standardVerticalSpacing;
            }
            EditorGUI.PropertyField(position, property, label);
        }