private BoatController boatRoleController; //船控制器 //导入资源 public void LoadResources() { //初始化 roleModelControllers = new RoleModelController[6]; for (int i = 0; i < 6; i++) { roleModelControllers[i] = new RoleModelController(); roleModelControllers[i].CreateRole(PositionModel.roles[i], i < 3 ? true : false, i); } leftLandRoleController = new LandModelController(); leftLandRoleController.CreateLand("left_land", PositionModel.left_land); rightLandRoleController = new LandModelController(); rightLandRoleController.CreateLand("right_land", PositionModel.right_land); foreach (RoleModelController roleModelController in roleModelControllers) { roleModelController.GetRoleModel().role.transform.localPosition = leftLandRoleController.AddRole(roleModelController.GetRoleModel()); } riverModel = new RiverModel(PositionModel.river); boatRoleController = new BoatController(); boatRoleController.CreateBoat(PositionModel.left_boat); moveController = new MoveController(); isRuning = true; time = 60; }
//导入资源 public void LoadResources() { //人物初始化 roleControllers = new RoleModelController[6]; for (int i = 0; i < 6; i++) { roleControllers[i] = new RoleModelController(); roleControllers[i].CreateRole(PositionModel.roles[i], i < 3 ? true : false, i); } //左右岸初始化 leftLandController = new LandModelController(); leftLandController.CreateLand("left_land", PositionModel.left_land); rightLandController = new LandModelController(); rightLandController.CreateLand("right_land", PositionModel.right_land); //将人物添加并定位至左岸 foreach (RoleModelController roleModelController in roleControllers) { roleModelController.GetRoleModel().role.transform.localPosition = leftLandController.AddRole(roleModelController.GetRoleModel()); } //河流Model实例化 riverModel = new RiverModel(PositionModel.river); //船初始化 boatController = new BoatModelController(); boatController.CreateBoat(PositionModel.left_boat); //移动控制器实例化 //moveController = new MoveController(); //数据初始化 isRuning = true; time = 60; }
//游戏重置 public void Restart() { time = 60; leftLandRoleController.CreateLand("left_land", PositionModel.left_land); rightLandRoleController.CreateLand("right_land", PositionModel.right_land); for (int i = 0; i < 6; i++) { roleModelControllers[i].CreateRole(PositionModel.roles[i], i < 3 ? true : false, i); roleModelControllers[i].GetRoleModel().role.transform.localPosition = leftLandRoleController.AddRole(roleModelControllers[i].GetRoleModel()); } boatRoleController.CreateBoat(PositionModel.left_boat); isRuning = true; }
public void Restart() { landRoleController.CreateLand(); for (int i = 0; i < 6; i++) { roleModelControllers[i].CreateRole(i < 3? true:false, i); roleModelControllers[i].GetRoleModel().role.transform.localPosition = landRoleController.AddRole(roleModelControllers[i].GetRoleModel()); } boatRoleController.CreateBoat(); leftPriestNum = leftDevilNum = 3; rightPriestNum = rightDevilNum = 0; isRuning = true; this.gameObject.GetComponent <UserGUI>().gameMessage = ""; }
// loading resources for the first scence public void LoadResources() { landRoleController = new LandModelController(); landRoleController.CreateLand(); roleModelControllers = new RoleModelController[6]; for (int i = 0; i < 6; i++) { roleModelControllers[i] = new RoleModelController(); roleModelControllers[i].CreateRole(i < 3? true:false, i); roleModelControllers[i].GetRoleModel().role.transform.localPosition = landRoleController.AddRole(roleModelControllers[i].GetRoleModel()); } boatRoleController = new BoatController(); boatRoleController.CreateBoat(); moveController = new MoveController(); leftPriestNum = leftDevilNum = 3; rightPriestNum = rightDevilNum = 0; isRuning = true; }