public void loadResources() { GameObject river = GameObject.Instantiate(Resources.Load("Prefabs/river"), Vector3.zero, Quaternion.identity) as GameObject; river.name = "river"; startLand = new landModel(1); endLand = new landModel(-1); boat = new boatModel(); roles = new roleModel[6]; for (int i = 0; i < 3; ++i) { roleModel role = new roleModel(0); //priest role.setName("priest" + i); role.getOnLand(startLand); role.lastPosition = role.getPosition(); roles[i] = role; } for (int i = 0; i < 3; ++i) { roleModel role = new roleModel(1); //devil role.setName("devil" + i); role.getOnLand(startLand); role.lastPosition = role.getPosition(); roles[i + 3] = role; } }
void Start() //初始化写在 Start() 中防止出问题 { sceneController = (Controller)SSDirector.getInstance().CurrentSceneController; startLand = sceneController.startLand; endLand = sceneController.endLand; boat = sceneController.boat; callback = sceneController; sceneController.judge = this; }