コード例 #1
0
ファイル: Ground.cs プロジェクト: pwilken/UnityMario
    public static Ground CreateGround()
    {
        GameObject gO     = new GameObject("Ground");
        Ground     ground = gO.AddComponent <Ground>();

        ground.CreateMesh();

        return(ground);
    }
コード例 #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();
        }
    }