Esempio n. 1
0
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     ThisNPC = animator.transform.GetComponent <NPCMoveTest>();
     SaveOtherNPC();
     ThisNPC.Overtaking = true;
     _OvertSpeed        = ThisNPC.configData.Speed /** 2*/;
 }
Esempio n. 2
0
 private void CheckOvertake(NPCMoveTest _other)
 {
     if (_other != null)
     {
         float _distance = Vector3.Distance(ThisNPC.transform.position, _other.transform.position);
         if ((_distance > 5f && !_other.Overtaking) || _other.direction == ThisNPC.direction)
         {
             ThisNPC.OvertakeZone = _OvertakeZone;
             ThisNPC.GetComponent <Animator>().SetBool("CanOvertake", true);
         }
     }
     else
     {
         ThisNPC.OvertakeZone = _OvertakeZone;
         ThisNPC.GetComponent <Animator>().SetBool("CanOvertake", true);
     }
 }
Esempio n. 3
0
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     ThisNPC = animator.transform.GetComponent <NPCMoveTest>();
     ZoneCheck();
     CheckDistance();
 }
Esempio n. 4
0
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     Character = animator.GetComponent <NPCMoveTest>();
     CheckDistance(animator);
     UpdateNPCValues();
 }