internal void setGenGameObject(GenGameObject ggo) { if (null == ggameobject) { ggameobject = ggo; } }
internal void setGenGameObject(GenGameObject ggo) { if (null == _gen_game_obj) { _gen_game_obj = ggo; } }
internal void setGenGameObject(GenGameObject it) { if (gen_game_obj == null) { gen_game_obj = it; } }
internal void setGenGameObject(GenGameObject ggo) { if (null == _ggo) { _ggo = ggo; } }
public void loadResources() { GameObject water = Instantiate(Resources.Load("Perfabs/Water", typeof(GameObject)), water_pos, Quaternion.identity, null) as GameObject; water.name = "water"; fromCoast = new CoastController("from", NumDevil + NumPriest); toCoast = new CoastController("to", NumDevil + NumPriest); boat = new BoatController(); for (int i = 0; i < NumPriest; i++) { GenGameObject cha = new GenGameObject("priest"); cha.setName("priest" + i); cha.setPosition(fromCoast.getEmptyPosition()); cha.getOnCoast(fromCoast); fromCoast.getOnCoast(cha); characters[i] = cha; } for (int i = 0; i < NumDevil; i++) { GenGameObject cha = new GenGameObject("devil"); cha.setName("devil" + i); cha.setPosition(fromCoast.getEmptyPosition()); cha.getOnCoast(fromCoast); fromCoast.getOnCoast(cha); characters[i + NumPriest] = cha; } }
internal void setGenGameObject(GenGameObject obj) { if (genGameobj == null) { genGameobj = obj; } }
public GenGameObject GetOffBoat(string passenger_name) { for (int i = 0; i < passenger.Length; i++) { if (passenger[i] != null && passenger[i].getName() == passenger_name) { GenGameObject charactorCtrl = passenger[i]; passenger[i] = null; return(charactorCtrl); } } Debug.Log("Cant find passenger in boat: " + passenger_name); return(null); }
public GenGameObject 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) { GenGameObject charactorCtrl = passengerPlaner[i]; passengerPlaner[i] = null; return(charactorCtrl); } } Debug.Log("cant find passenger on coast: " + passenger_name); return(null); }
public void characterIsClicked(GenGameObject characterCtrl) { if (GameStatus() == 0) { if (characterCtrl.isOnBoat()) { CoastController whichCoast; if (boat.get_to_or_from() == -1) { // to->-1; from->1 whichCoast = toCoast; } else { whichCoast = fromCoast; } boat.GetOffBoat(characterCtrl.getName()); characterCtrl.moveToPosition(whichCoast.getEmptyPosition()); characterCtrl.getOnCoast(whichCoast); whichCoast.getOnCoast(characterCtrl); } else { CoastController whichCoast = characterCtrl.getCoastController(); if (boat.getEmptyIndex() == -1) { return; } if (whichCoast.get_to_or_from() != boat.get_to_or_from()) { return; } whichCoast.getOffCoast(characterCtrl.getName()); characterCtrl.moveToPosition(boat.getEmptyPosition()); characterCtrl.getOnBoat(boat); boat.GetOnBoat(characterCtrl); } userGUI.status = GameStatus(); } }
public void LoadWithNum(int pri, int dev) { restart(); if (pri != NumPriest || dev != NumDevil) { Destroy(fromCoast.coast); Destroy(toCoast.coast); fromCoast = new CoastController("from", pri + dev); toCoast = new CoastController("to", pri + dev); for (int i = 0; i < NumPriest + NumDevil; i++) { Destroy(characters[i].character); } for (int i = 0; i < pri; i++) { GenGameObject cha = new GenGameObject("priest"); cha.setName("priest" + i); cha.setPosition(fromCoast.getEmptyPosition()); cha.getOnCoast(fromCoast); fromCoast.getOnCoast(cha); characters[i] = cha; } for (int i = 0; i < dev; i++) { GenGameObject cha = new GenGameObject("devil"); cha.setName("devil" + i); cha.setPosition(fromCoast.getEmptyPosition()); cha.getOnCoast(fromCoast); fromCoast.getOnCoast(cha); characters[i + pri] = cha; } NumPriest = pri; NumDevil = dev; } }
public void GetOnBoat(GenGameObject characterCtrl) { int index = getEmptyIndex(); passenger[index] = characterCtrl; }
public void getOnCoast(GenGameObject characterCtrl) { int index = getEmptyIndex(); passengerPlaner[index] = characterCtrl; }
public void setController(GenGameObject characterCtrl) { characterController = characterCtrl; }