Exemplo n.º 1
0
 public void OnPlayerBrake(PlayerRigMotionEventArgs e)
 {
     if (m_playerBrake != null)
     {
         m_playerBrake.Invoke();
     }
     if (m_playerBrakeEventHandle != null)
     {
         m_playerBrakeEventHandle(this, e);
     }
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
        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);
            }
        }