// 自动翻滚 [8/3/2015 tgame] public void OnScrollClicked(JoystickWrap.JoystickKeyMapping k) { Vector3 f = m_mainPlayer.MainObj.transform.forward; JoystickWrap joystick = WindowRoot.GetComponent <JoystickWrap>(); if (joystick.m_axisMapping != null && joystick.m_axisMapping.Count > 0) { JoystickWrap.JoystickAxisMapping axis = joystick.m_axisMapping[0]; if (axis.GetVector3D().sqrMagnitude > 0.01f) { f = axis.GetVector3D() * 5.0f; } } f = m_mainPlayer.MainPos + f * 3.0f; m_mainPlayer.CurrentCmd = new MainPlayer.Cmd(f, Player.ENCmdType.enRoll); }
//移动 [8/3/2015 tgame] public void OnMoveClicked(JoystickWrap.JoystickAxisMapping axis) { Vector3 f = axis.GetVector3D(); if (f.sqrMagnitude < 0.01f) { MoveAction ac = m_mainPlayer.ActionControl.LookupAction(ActorAction.ENType.enMoveAction) as MoveAction; if (ac != null) { m_mainPlayer.CurrentCmd = new MainPlayer.Cmd(f, Player.ENCmdType.enStopMove); } return; } f = m_mainPlayer.MainPos + f * 4.0f; m_mainPlayer.CurrentCmd = new MainPlayer.Cmd(f, Player.ENCmdType.enMove); m_mainPlayer.CurrentCmd.m_isMoveByNoAStar = true; }