示例#1
0
    private void Update()
    {
        // Get the flick direction and length from the state machine
        flickDirection = _stateMachine.GetCurrentFlickDirection();
        flickMagnitude = flickDirection.magnitude;

        // If the mouse button is pressed down, draw the flicking UI
        if (_stateMachine.AllowClick() == true)
        {
            // Set the mouse cursor
            Cursor.SetCursor(closedHandTexture, Vector2.zero, CursorMode.Auto);

            DrawUIGrabRing();
            DrawUILinePull(pullLines);
            DrawUILineDashed(forwardLines);
        }
        else   // If the mouse button is NOT held down, then hide the flicking UI objects.
        {
            // Set the mouse cursor
            Cursor.SetCursor(openHandTexture, Vector2.zero, CursorMode.Auto);

            SetUILineVisibility(grabRing, false);
            SetUILineVisibility(pullLines, false);
            SetUILineVisibility(forwardLines, false);
        }
    }