Example #1
0
            public InputSamplingScope(CameraFlyModeContext context)
            {
                m_Disposed = false;
                m_Context  = context;

                if (currentlyMoving && Mathf.Approximately(m_Context.m_PreviousVector.sqrMagnitude, 0f))
                {
                    s_Timer.Begin();
                }

                if (context.active)
                {
                    ShortcutController.priorityContext = context;
                }
            }
            // controlID will get hotControl if using arrow keys while shortcut context is not active
            // passing a value of zero disables the arrow keys
            public InputSamplingScope(CameraFlyModeContext context, int controlID, bool orthographic = false)
            {
                m_ArrowKeysActive = false;
                m_Disposed        = false;
                m_Context         = context;

                if (!context.active)
                {
                    m_ArrowKeysActive = DoArrowKeys(controlID, orthographic);
                }

                if (currentlyMoving && Mathf.Approximately(m_Context.m_PreviousVector.sqrMagnitude, 0f))
                {
                    s_Timer.Begin();
                }
            }
Example #3
0
            // controlID will get hotControl if using arrow keys while shortcut context is not active
            // passing a value of zero disables the arrow keys
            public InputSamplingScope(CameraFlyModeContext context, ViewTool currentViewTool, int controlID, bool orthographic = false)
            {
                m_ArrowKeysActive = false;
                m_Disposed        = false;
                m_Context         = context;
                m_Context.active  = currentViewTool == ViewTool.FPS;

                if (m_Context.active)
                {
                    ShortcutIntegration.instance.contextManager.SetPriorityContext(context);
                }
                else
                {
                    ShortcutIntegration.instance.contextManager.ClearPriorityContext();
                    m_ArrowKeysActive = DoArrowKeys(controlID, orthographic);
                }

                if (currentlyMoving && Mathf.Approximately(m_Context.m_PreviousVector.sqrMagnitude, 0f))
                {
                    s_Timer.Begin();
                }
            }
Example #4
0
            // controlID will get hotControl if using arrow keys while shortcut context is not active
            // passing a value of zero disables the arrow keys
            public InputSamplingScope(CameraFlyModeContext context, ViewTool currentViewTool, int controlID, EditorWindow window, bool orthographic = false)
            {
                m_ArrowKeysActive  = false;
                m_Disposed         = false;
                m_Context          = context;
                m_Context.active   = currentViewTool == ViewTool.FPS;
                m_Context.m_Window = window;

                if (m_Context.active)
                {
                    ShortcutIntegration.instance.contextManager.RegisterToolContext(context);
                    ForceArrowKeysUp(orthographic);
                }
                else
                {
                    ShortcutIntegration.instance.contextManager.DeregisterToolContext(context);
                    m_ArrowKeysActive = DoArrowKeys(controlID, orthographic);
                }

                if (currentlyMoving && Mathf.Approximately(m_Context.m_PreviousVector.sqrMagnitude, 0f))
                {
                    s_Timer.Begin();
                }
            }