Beispiel #1
0
        private void Transition_WaitingForInput_RecordingInput()
        {
            // Can't check for null as Color is a struct
            // But it's harmless to call this if the color really has been set to black
            if (m_lastChosenColor == Color.black)
            {
                m_lastChosenColor = PointerColor;
            }

            if (JitterEnabled)
            {
                // Bypass the code in the PointerColor setter
                // Size is jittered in PointerScript. Should we also do color there?
                ChangeAllPointerColorsDirectly(GenerateJitteredColor(MainPointer.CurrentBrush.m_ColorLuminanceMin));
            }


            if (m_StraightEdgeEnabled)
            {
                StraightEdgeGuide.SetTempShape(StraightEdgeGuideScript.Shape.Line);
                StraightEdgeGuide.ResolveTempShape();
                m_StraightEdgeGesture.InitGesture(MainPointer.transform.position,
                                                  m_GestureMinCircleSize, m_GestureBeginDist, m_GestureCloseLoopDist,
                                                  m_GestureStepDist, m_GestureMaxAngle);
            }

            InitiateLine();
            m_CurrentLineCreationState = LineCreationState.RecordingInput;
            WidgetManager.m_Instance.WidgetsDormant = true;
        }
Beispiel #2
0
        private void Transition_WaitingForInput_RecordingInput()
        {
            if (m_StraightEdgeEnabled)
            {
                StraightEdgeGuide.SetTempShape(StraightEdgeGuideScript.Shape.Line);
                StraightEdgeGuide.ResolveTempShape();
                m_StraightEdgeGesture.InitGesture(MainPointer.transform.position,
                                                  m_GestureMinCircleSize, m_GestureBeginDist, m_GestureCloseLoopDist,
                                                  m_GestureStepDist, m_GestureMaxAngle);
            }

            InitiateLine();
            m_CurrentLineCreationState = LineCreationState.RecordingInput;
            WidgetManager.m_Instance.WidgetsDormant = true;
        }
Beispiel #3
0
        void CheckGestures()
        {
            m_StraightEdgeGesture.UpdateGesture(MainPointer.transform.position);
            if (m_StraightEdgeGesture.IsGestureComplete())
            {
                // If gesture succeeded, change the line creator.
                if (m_StraightEdgeGesture.DidGestureSucceed())
                {
                    FinalizeLine(discard: true);
                    StraightEdgeGuideScript.Shape nextShape = StraightEdgeGuide.CurrentShape;
                    switch (nextShape)
                    {
                    case StraightEdgeGuideScript.Shape.Line:
                        nextShape = StraightEdgeGuideScript.Shape.Circle;
                        break;

                    case StraightEdgeGuideScript.Shape.Circle:
                    {
                        if (App.Config.IsMobileHardware)
                        {
                            nextShape = StraightEdgeGuideScript.Shape.Line;
                        }
                        else
                        {
                            nextShape = StraightEdgeGuideScript.Shape.Sphere;
                        }
                    }
                    break;

                    case StraightEdgeGuideScript.Shape.Sphere:
                        nextShape = StraightEdgeGuideScript.Shape.Line;
                        break;
                    }

                    StraightEdgeGuide.SetTempShape(nextShape);
                    StraightEdgeGuide.ResolveTempShape();
                    InitiateLineAt(m_MainPointerData.m_StraightEdgeXf_CS);
                }

                m_StraightEdgeGesture.ResetGesture();
            }
        }