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); }
public override void Destroy() { base.Destroy(); if (null != _moveJoy) { RemoveEvent(); _moveJoy = null; } }
public override void Init() { base.Init(); _moveJoy = GameObject.Find("UIManager/Canvas/MainPanel/MoveJoystick").GetComponent <JoystickBase>(); if (null != _moveJoy) { InitEvent(); } }
void CreateDefaultJoystics() { m_MoveJoystick = new JoystickFloating(leftArea); m_ViewJoystick = new ViewControl(rightArea.x, rightArea.y, rightArea.width, rightArea.height); OnControlSchemeChange(); }