private void DrawPaintMode()
    {
        GNBlockMapEditorVM.PaintMode mode = viewModel.CurrentPaintMode;
        GUILayout.BeginHorizontal();
        GUILayout.BeginVertical();
        GUILayout.BeginHorizontal();
        GUILayout.Label("Paint Mode (p): ", EditorStyles.whiteBoldLabel);
        if (viewModel.SetCurrentPaintMode(NPVoxGUILayout.HotkeyToggleBar <GNBlockMapEditorVM.PaintMode>(
                                              new string[] { "Brush", "Random" },
                                              new GNBlockMapEditorVM.PaintMode[] {
            GNBlockMapEditorVM.PaintMode.BRUSH,
            GNBlockMapEditorVM.PaintMode.RANDOM
        },
                                              KeyCode.P,
                                              mode,
                                              true
                                              )))
        {
            SceneView.RepaintAll();
        }
        GUILayout.EndHorizontal();

        // if (viewModel.CurrentPaintMode == GNBlockMapEditorVM.PaintMode.RANDOM) // this leads to exception
        {
            GUILayout.BeginHorizontal();
            GNBlockMapEditorVM.RandomBrushFlags flags = (GNBlockMapEditorVM.RandomBrushFlags)EditorGUILayout.MaskField(
                new GUIContent("Options"),
                (int)viewModel.CurrentRandomBrushFlags,
                new string[] { "Prefab", "Rotate X", "Rotate Y", "Rotate Z", "Flip X", "Flip Y", "Flip Z" });
            if (flags != viewModel.CurrentRandomBrushFlags)
            {
                viewModel.CurrentRandomBrushFlags = flags;
                SceneView.RepaintAll();
            }
            GUILayout.EndHorizontal();
        }

        GUILayout.EndVertical();
        DrawBrushSetup();
        GUILayout.EndHorizontal();
    }
 private void DrawShowLayerMode()
 {
     GNBlockMapEditorVM.ShowLayerMode mode = viewModel.CurrentShowLayerMode;
     GUILayout.BeginHorizontal();
     GUILayout.Label("Layer Mode (z/y): ", EditorStyles.whiteBoldLabel);
     if (viewModel.SetCurrentShowLayerMode(NPVoxGUILayout.HotkeyToggleBar <GNBlockMapEditorVM.ShowLayerMode>(
                                               new string[] { "Active", "Below", "All" },
                                               new GNBlockMapEditorVM.ShowLayerMode[] {
         GNBlockMapEditorVM.ShowLayerMode.ACTIVE,
         GNBlockMapEditorVM.ShowLayerMode.BELOW,
         GNBlockMapEditorVM.ShowLayerMode.ALL
     },
                                               //    KeyCode.Z,
                                               KeyCode.None,
                                               mode,
                                               true
                                               )))
     {
         SceneView.RepaintAll();
     }
     GUILayout.EndHorizontal();
 }
예제 #3
0
    private void DrawModeToolbar()
    {
        GUILayout.BeginHorizontal();

        GUILayout.Label("Brightenmod (V): ");
        NPVoxAnimationEditorVM.BrightenMode brightenMode = viewModel.CurrentBrightenMode;
        if (viewModel.CurrentBrightenMode != (brightenMode = NPVoxGUILayout.HotkeyToggleBar <NPVoxAnimationEditorVM.BrightenMode>(
                                                  new string[] { "Off", "Selected" },
                                                  new NPVoxAnimationEditorVM.BrightenMode[] {
            NPVoxAnimationEditorVM.BrightenMode.OFF,
            NPVoxAnimationEditorVM.BrightenMode.SELECTED,
            // NPVoxAnimationEditorVM.BrightenMode.CURRENT
        },
                                                  KeyCode.V,
                                                  brightenMode
                                                  )))
        {
            viewModel.SetCurrentBrightenMode(brightenMode);
        }


        GUILayout.EndHorizontal();
    }