private static void DrawSculptingGUI() { string label = "3. Sculpting"; string id = "wizard-sculpting"; GEditorCommon.Foldout(label, false, id, () => { EditorGUILayout.LabelField("Select the workflow you prefer.", GEditorCommon.WordWrapLeftLabel); GEditorCommon.Header("Painting"); EditorGUILayout.LabelField("Use a set of painters for hand sculpting terrain shape.", GEditorCommon.WordWrapLeftLabel); if (GUILayout.Button("Create Geometry - Texture Painter")) { GTerrainTexturePainter painter = GWizard.CreateGeometryTexturePainter(); EditorGUIUtility.PingObject(painter.gameObject); Selection.activeGameObject = painter.gameObject; } GEditorCommon.Header("Stamping"); EditorGUILayout.LabelField("Use grayscale textures to stamp mountains, plateaus, rivers, etc. and blend using some math operations.", GEditorCommon.WordWrapLeftLabel); if (GUILayout.Button("Create Geometry Stamper")) { GGeometryStamper stamper = GWizard.CreateGeometryStamper(); EditorGUIUtility.PingObject(stamper.gameObject); Selection.activeGameObject = stamper.gameObject; } }); }
public static void CreateGeometryStamper(MenuCommand menuCmd) { GameObject geometryStamperGO = new GameObject("Geometry Stamper"); if (menuCmd != null) { GameObjectUtility.SetParentAndAlign(geometryStamperGO, menuCmd.context as GameObject); } geometryStamperGO.transform.localPosition = Vector3.zero; geometryStamperGO.transform.hideFlags = HideFlags.HideInInspector; GGeometryStamper geoStamper = geometryStamperGO.AddComponent <GGeometryStamper>(); geoStamper.GroupId = -1; Selection.activeGameObject = geometryStamperGO; Undo.RegisterCreatedObjectUndo(geometryStamperGO, "Creating Geometry Stamper"); }
public static GGeometryStamper CreateGeometryStamper() { GameObject root = GetTerrainToolsRoot(); if (root == null) { root = CreateTerrainToolsRoot(); } GameObject g = new GameObject("Geometry Stamper"); g.transform.parent = root.transform; g.transform.position = Vector3.zero; g.transform.rotation = Quaternion.identity; g.transform.localScale = Vector3.one; g.transform.hideFlags = HideFlags.HideInInspector; GGeometryStamper stamper = g.AddComponent <GGeometryStamper>(); return(stamper); }