示例#1
0
    public override void OnInspectorGUI()
    {
        TerrainManager instance = (TerrainManager)target;

        if (!TerrainManager.HasValidTerrain())
        {
            GUILayout.Label("Create or load a map to continue...");
            return;
        }

        GUILayout.Label("Paint Controls", EditorStyles.boldLabel);

        GUILayout.Space(5f);

        paintType = (PaintType)EditorGUILayout.EnumPopup("Paint Mode", paintType);
        if (paintType != instance.PaintMode)
        {
            instance.ChangePaintType(paintType);
            return;
        }

        if (paintType == PaintType.Topology)
        {
            topologyType = (TerrainTopology.Enum)EditorGUILayout.EnumPopup("Topology Layer", topologyType);
            if (topologyType != instance.SelectedTopology)
            {
                instance.ChangeTopologyLayer(topologyType);
            }
        }
    }