public void OnPlayerBrake(PlayerRigMotionEventArgs e) { if (m_playerBrake != null) { m_playerBrake.Invoke(); } if (m_playerBrakeEventHandle != null) { m_playerBrakeEventHandle(this, e); } }
public void OnPlayerMove(PlayerRigMotionEventArgs e) { if (m_playerMove != null) { m_playerMove.Invoke(); } if (m_playerMoveEventHandle != null) { m_playerMoveEventHandle(this, e); } StartCoroutine(MoveEnumerator(e.m_direction, e.m_forceIndensity, e.m_impulseTime)); }
private void Update() { var x = Input.GetAxis("Horizontal"); var y = Input.GetAxis("Vertical"); if (x != 0 || y != 0) { var args = new PlayerRigMotionEventArgs(); var vec = new Vector3(x, 0, y); args.m_direction = vec.normalized; args.m_forceIndensity = m_moveCoefficient * vec.magnitude; // args.m_impulseTime = m_intervalTime; OnPlayerMove(args); } }