void CreateBarn(Vector3 position) { if (barn == null) { barn = (BarnController)Instantiate(barnPrefab, position, Quaternion.identity); barn.carController = car; barn.BarnEnter += new BarnEnterEventHandler(BarnEnter); } barn.GetTransform().position = position + new Vector3(0, 0, 30); }
public void BarnEnter(BarnController barn) { //int newlyCollected = car.GetCargo().Count; //update the score... //scoreController.addCollected foreach (CreatureController c in car.GetCargo()) { hudController.CreatureReturnedToBarn(c); } car.ClearCargo(); }