Beispiel #1
0
        private static void DrawFoliageAndObjectSpawningGUI()
        {
            string label = "5. Foliage & Object Spawning";
            string id    = "wizard-foliage-object-spawning";

            GEditorCommon.Foldout(label, false, id, () =>
            {
                EditorGUILayout.LabelField("Select the workflow you prefer.", GEditorCommon.WordWrapLeftLabel);

                GEditorCommon.Header("Painting");
                EditorGUILayout.LabelField("Place trees, grasses and game objects by painting.", GEditorCommon.WordWrapLeftLabel);
                if (GUILayout.Button("Create Foliage Painter & Object Painter"))
                {
                    GFoliagePainter fPainter = GWizard.CreateFoliagePainter();
                    GObjectPainter oPainter  = GWizard.CreateObjectPainter();
                    EditorGUIUtility.PingObject(fPainter);
                    Selection.objects          = new GameObject[] { fPainter.gameObject, oPainter.gameObject };
                    Selection.activeGameObject = fPainter.gameObject;
                }

                GEditorCommon.Header("Stamping");
                EditorGUILayout.LabelField("Procedurally spawn trees, grasses and game objects using some rules such as height, normal vector and noise.", GEditorCommon.WordWrapLeftLabel);
                if (GUILayout.Button("Create Foliage Stamper & Object Stamper"))
                {
                    GFoliageStamper fStamper = GWizard.CreateFoliageStamper();
                    GObjectStamper oStamper  = GWizard.CreateObjectStamper();
                    EditorGUIUtility.PingObject(fStamper);
                    Selection.objects          = new GameObject[] { fStamper.gameObject, oStamper.gameObject };
                    Selection.activeGameObject = fStamper.gameObject;
                }
            });
        }