//上船 public void GetOnBoat(CharacterController charactrl, BoatController boatCtrl) { //船控制器 int index = boatCtrl.GetEmptyIndex(); boatCtrl.boat.passenger[index] = charactrl; //人物控制器 charactrl.character.Coast = null; charactrl.character.Role.transform.parent = boatCtrl.boat._Boat.transform; charactrl.character.IsOnBoat = true; }
//下船 public void GetOffBoat(string passenger_name, BoatController boatCtrl) { for (int i = 0; i < boatCtrl.boat.passenger.Length; ++i) { if (boatCtrl.boat.passenger[i] != null && boatCtrl.boat.passenger[i].character.Name == passenger_name) { boatCtrl.boat.passenger[i] = null; } } }
//船移动 public void boatMove(BoatController boatCtrl) { if (boatCtrl.boat.Location == Location.left) { boatCtrl.boat.mScript.SetDestination(boatCtrl.boat.departure); boatCtrl.boat.Location = Location.right; } else { boatCtrl.boat.mScript.SetDestination(boatCtrl.boat.destination); boatCtrl.boat.Location = Location.left; } }
public void GetOnBoat(BoatController boatCtrl) { character.Coast = null; character.Role.transform.parent = boatCtrl.boat._Boat.transform; character.IsOnBoat = true; }