예제 #1
0
 public void SwitchTrack(BoxMovementController newBoxCtrl)
 {
     // por enquanto vamos começar do começo, no futuro podemos calcular uma transição
     previousId = 0;
     boxCtrl    = newBoxCtrl;
     boxCtrl.boxes.Add(this.gameObject);
     rigidbody.isKinematic = true;
     state = EnumTracker.bound;
 }
예제 #2
0
 public void BackTrack()
 {
     if (boxCtrl && state != EnumTracker.bound)
     {
         //Debug.Log("Back");
         //Debug.Log(this + " voltou!");
         boxCtrl.boxes.Add(this.gameObject);
         rigidbody.isKinematic = true;
         state = EnumTracker.bound;
     }
 }
예제 #3
0
 public void LeaveTrack()
 {
     if (boxCtrl && state != EnumTracker.unbound)
     {
         //Debug.Log("Leave");
         //Debug.Log(this + " saiu!");
         boxCtrl.removeBoxes.Add(this.gameObject);
         rigidbody.isKinematic = false;
         rigidbody.velocity    = velocity;
         state = EnumTracker.unbound;
     }
 }
예제 #4
0
 public void Stuck()
 {
     state = EnumTracker.stuck;
     rigidbody.isKinematic = true;
 }