public void OnBeltExit(BeltController belt) { if (_activeBelts.Contains(belt)) { _activeBelts.Remove(belt); } }
public void OnBeltEnter(BeltController belt) { if (!_activeBelts.Contains(belt)) { _activeBelts.Add(belt); } }
/*******************************/ void Start () { belt = transform.FindChild ("Belt").GetComponent<BeltController> (); leftwheel = transform.FindChild ("left_wheel").GetComponent<WheelController> (); rightwheel = transform.FindChild ("right_wheel").GetComponent<WheelController> (); belt.speed = currspeed; belt.friction = friction; leftwheel.speed = currspeed; leftwheel.friction = friction; rightwheel.speed = currspeed; rightwheel.friction = friction; }
/*******************************/ void Start() { belt = transform.FindChild("Belt").GetComponent <BeltController> (); leftwheel = transform.FindChild("left_wheel").GetComponent <WheelController> (); rightwheel = transform.FindChild("right_wheel").GetComponent <WheelController> (); belt.speed = currspeed; belt.friction = friction; leftwheel.speed = currspeed; leftwheel.friction = friction; rightwheel.speed = currspeed; rightwheel.friction = friction; }