Exemple #1
0
    public static Ground CreateGround()
    {
        GameObject gO     = new GameObject("Ground");
        Ground     ground = gO.AddComponent <Ground>();

        ground.CreateMesh();

        return(ground);
    }
Exemple #2
0
    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();
        }
    }