public static Ground CreateGround() { GameObject gO = new GameObject("Ground"); Ground ground = gO.AddComponent <Ground>(); ground.CreateMesh(); return(ground); }
public override void OnInspectorGUI() { EditorGUI.BeginChangeCheck(); #region Parameters ground.Width = EditorGUILayout.Slider("Width", ground.Width, 1f, 100f); ground.Height = EditorGUILayout.Slider("Height", ground.Height, 1f, 100f); ground.Depth = EditorGUILayout.Slider("Depth", ground.Depth, 1f, 100f); ground.groundHeight = EditorGUILayout.Slider("GroundHeight", ground.groundHeight, 0f, 1f); #endregion // Parameters if (EditorGUI.EndChangeCheck()) { ground.CreateMesh(); } }