public MyCharacterController getOffCoast(string passenger_name) //角色离开岸,返回离开岸边的角色 { // 0->priest, 1->devil for (int i = 0; i < passengerPlaner.Length; i++) { if (passengerPlaner[i] != null && passengerPlaner[i].getName() == passenger_name) { MyCharacterController charactorCtrl = passengerPlaner[i]; passengerPlaner[i] = null; return(charactorCtrl); } } Debug.Log("cant find passenger on coast: " + passenger_name); return(null); }
public MyCharacterController GetOffBoat(string passenger_name) //下船 { for (int i = 0; i < passenger.Length; i++) { if (passenger[i] != null && passenger[i].getName() == passenger_name) { MyCharacterController charactorCtrl = passenger[i]; passenger[i] = null; return(charactorCtrl); } } Debug.Log("Cant find passenger in boat: " + passenger_name); return(null); }
public void getOnCoast(MyCharacterController characterCtrl) //角色上岸 { int index = getEmptyIndex(); passengerPlaner[index] = characterCtrl; }
public void GetOnBoat(MyCharacterController characterCtrl) //上船 { int index = getEmptyIndex(); passenger[index] = characterCtrl; }