Пример #1
0
    public void OnControlSchemeChange()
    {
        //Debug.Log("OnControlSchemeChange: " + GuiOptions.m_ControlScheme + " " + GuiOptions.leftHandAiming);

        switch (GuiOptions.m_ControlScheme)
        {
        case GuiOptions.E_ControlScheme.FloatingMovePad:
        {
            m_MoveJoystick = new JoystickFloating(GuiOptions.leftHandAiming ? rightArea : leftArea);
        }
        break;

        case GuiOptions.E_ControlScheme.FixedMovePad:
        {
            m_MoveJoystick = new JoystickFixed(GuiOptions.MoveStick.Positon.x, Screen.height - GuiOptions.MoveStick.Positon.y);

            //
        }
        break;
        }

        //view joystick
        Rect viewArea = GuiOptions.leftHandAiming ? leftArea : rightArea;

        m_ViewJoystick = new ViewControl(viewArea.x, viewArea.y, viewArea.width, viewArea.height);
    }
Пример #2
0
 public override void Destroy()
 {
     base.Destroy();
     if (null != _moveJoy)
     {
         RemoveEvent();
         _moveJoy = null;
     }
 }
Пример #3
0
 public override void Init()
 {
     base.Init();
     _moveJoy = GameObject.Find("UIManager/Canvas/MainPanel/MoveJoystick").GetComponent <JoystickBase>();
     if (null != _moveJoy)
     {
         InitEvent();
     }
 }
Пример #4
0
 void CreateDefaultJoystics()
 {
     m_MoveJoystick = new JoystickFloating(leftArea);
     m_ViewJoystick = new ViewControl(rightArea.x, rightArea.y, rightArea.width, rightArea.height);
     OnControlSchemeChange();
 }