Пример #1
0
    public void ChangeMode(CursorModes p_mode, bool p_force)
    {
        if (!p_force && p_mode == m_currentMode)
        {
            return;
        }

        string axisUsed = "Aim";

        if (p_mode == CursorModes.CURSOR)
        {
            axisUsed = "UI" + axisUsed;
        }

        m_mouse.xAxis.actionName = axisUsed + "X";
        m_mouse.yAxis.actionName = axisUsed + "Y";

        m_currentMode = p_mode;

        // ui cursor doesn't know the real cursor mode, only player cursor does
        if (p_mode == CursorModes.LINE)
        {
            if (m_usingController)
            {
                m_uiCursor.ChangeModes(p_mode);
                m_mouse.screenPosition = new Vector2(Screen.width / 2, Screen.height / 2 + 1);
            }
        }
        else
        {
            m_uiCursor.ChangeModes(p_mode);
        }

        SetCursorState(p_mode);
        OnScreenPositionChanged(m_mouse.screenPosition);
    }