Exemplo n.º 1
0
        [Shortcut("Terrain/Select Bridge Tool", typeof(TerrainToolShortcutContext))]                // tells shortcut manager what to call the shortcut and what to pass as args
        static void SelectShortcut(ShortcutArguments args)
        {
            TerrainToolShortcutContext context = (TerrainToolShortcutContext)args.context;          // gets interface to modify state of TerrainTools

            context.SelectPaintTool <BridgeTool>();                                                 // set active tool
            TerrainToolsAnalytics.OnShortcutKeyRelease("Select Bridge Tool");
        }
Exemplo n.º 2
0
        static void SelectShortcut(ShortcutArguments args)
        {
            TerrainToolShortcutContext context = (TerrainToolShortcutContext)args.context;

            context.SelectPaintTool <SmoothHeightTool>();
            TerrainToolsAnalytics.OnShortcutKeyRelease("Select Smooth Tool");
        }
Exemplo n.º 3
0
        public void HandleShortcutChanged(ShortcutArguments args, TKey key)
        {
            switch (args.stage)
            {
            case ShortcutStage.Begin:
            {
                if (m_OnPressedByKey.TryGetValue(key, out Action onPressed))
                {
                    m_ActiveKeys.Add(key);
                    onPressed?.Invoke();
                }
                break;
            }

            case ShortcutStage.End:
            {
                if (m_OnReleasedByKey.TryGetValue(key, out Action onReleased))
                {
                    onReleased?.Invoke();
                    m_ActiveKeys.Remove(key);

                    TerrainToolsAnalytics.OnShortcutKeyRelease(key.ToString());
                    TerrainToolsAnalytics.OnParameterChange();
                }
                break;
            }

            default:
            {
                throw new ArgumentOutOfRangeException();
            }
            }             // End of switch.
        }
Exemplo n.º 4
0
        [Shortcut("Terrain/Select Hydraulic Erosion Brush", typeof(TerrainToolShortcutContext), KeyCode.F4)]               // tells shortcut manager what to call the shortcut and what to pass as args
        static void SelectShortcut(ShortcutArguments args)
        {
            TerrainToolShortcutContext context = (TerrainToolShortcutContext)args.context;          // gets interface to modify state of TerrainTools

            context.SelectPaintTool <HydroErosionTool>();                                           // set active tool
            TerrainToolsAnalytics.OnShortcutKeyRelease("Select Hydraulic Erosion Brush");
        }
Exemplo n.º 5
0
        static void SelectShortcut(ShortcutArguments args)
        {
            TerrainToolShortcutContext context = (TerrainToolShortcutContext)args.context;

            context.SelectPaintTool <TerraceErosion>();
            TerrainToolsAnalytics.OnShortcutKeyRelease("Select Terrace Tool");
        }
Exemplo n.º 6
0
 static void StrengthBrushShortcut(ShortcutArguments args)
 {
     if (args.stage == ShortcutStage.Begin)
     {
         m_editTransform = true;
     }
     else if (args.stage == ShortcutStage.End)
     {
         m_editTransform = false;
         TerrainToolsAnalytics.OnShortcutKeyRelease("Adjust Mesh Stamp Transform");
     }
 }
Exemplo n.º 7
0
 static void LayerShortcut(ShortcutArguments args)
 {
     m_EyedropperSelected = args.stage == ShortcutStage.Begin ? true : false;
     if (m_EyedropperSelected && m_PaintToolSelected)
     {
         Cursor.SetCursor(m_CursorTexture, m_CursorOffset, CursorMode.Auto);
     }
     else
     {
         Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
         TerrainToolsAnalytics.OnShortcutKeyRelease("Layer Eyedropper");
     }
 }