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; }
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; } }
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; } }
public void Stuck() { state = EnumTracker.stuck; rigidbody.isKinematic = true; }