public void loadResources() { GameObject river = Instantiate(Resources.Load("Prefabs/River", typeof(GameObject)), new Vector3(0, -3f, 0), Quaternion.identity, null) as GameObject; river.name = "river"; leftBank = new BankController("left"); rightBank = new BankController("right"); boat = new BoatController(); for (int i = 0; i < 3; i++) { dpGame.CharacterController tmp = new dpGame.CharacterController("devil", i); tmp.setPosition(leftBank.getPos(i)); tmp.moveToBank(leftBank); leftBank.moveToBank(tmp); characters[i] = tmp; } for (int i = 0; i < 3; i++) { dpGame.CharacterController tmp = new dpGame.CharacterController("priest", i + 3); tmp.setPosition(leftBank.getPos(i + 3)); tmp.moveToBank(leftBank); leftBank.moveToBank(tmp); characters[i + 3] = tmp; } }
private void setCharacterPosition(dpGame.CharacterController chr) { if (u.status == 0) { return; } if (forbid) { return; } if (chr.getState() == 1) { BankController bank; if (boat.getLR() == 0) { bank = leftBank; } else { bank = rightBank; } boat.outOfBoat(chr.getTag()); chr.moveToBank(bank); // 动作分离版改变move调用方式 // chr.goMoving(bank.getPos(chr.getTag())); chr.getObj().transform.position = bank.getPos(chr.getTag()); bank.moveToBank(chr); } else { BankController bank = chr.getBank(); if (boat.getLR() == bank.getLR()) { if (!boat.isFull()) { bank.outOfBank(chr.getTag()); chr.moveToBoat(boat); // 动作分离版改变move调用方式 // chr.goMoving(boat.getSeat()); // actionManager.moveCharacter(chr.getObj(), boat.getSeat(), speed); chr.getObj().transform.position = boat.getSeat(); boat.moveToBoat(chr); } } } u.status = judger.checkGame(); }
public void moveCharacters(dpGame.CharacterController chr) { if (u.status == 0) { return; } if (forbidEvent()) { return; } if (chr.getState() == 1) { BankController bank; if (boat.getLR() == 0) { bank = leftBank; } else { bank = rightBank; } boat.outOfBoat(chr.getTag()); chr.moveToBank(bank); chr.goMoving(bank.getPos(chr.getTag())); bank.moveToBank(chr); } else { BankController bank = chr.getBank(); if (boat.getLR() == bank.getLR()) { if (!boat.isFull()) { bank.outOfBank(chr.getTag()); chr.moveToBoat(boat); chr.goMoving(boat.getSeat()); boat.moveToBoat(chr); } } } u.status = checkGame(); }
public void setChrController(dpGame.CharacterController chr) { character = chr; }