public void OnActivate() { if (entity == null && !mIsProcessing) { MonsterSpawnPoint mst = mstPoint; if ((mst == null || !mst.isDead) && (spawnPoint.Enable || spawnPoint.EntityID != -1)) { SceneMan.self.StartCoroutine(CreateEntity()); } } else if (entity != null && !mIsProcessing) { if (entity.peTrans != null) { Vector3 pos = entity.peTrans.position; if (SceneAgentsContoller.CheckPos(out pos, pos, spawnPoint, spawnArea)) { entity.ExtSetPos(pos); } else { Debug.LogWarning("The Entity id [" + entity.Id + "] position is wrong"); } } } }
public void OnConstruct() { if (_firstConstruct) { _firstConstruct = false; Vector3 pos = spawnPoint.spawnPos; if (SceneAgentsContoller.CheckPos(out pos, pos, spawnPoint, spawnArea)) { spawnPoint.spawnPos = pos; } } }
void Awake() { _self = this; mMlItems = new List <IMonoLike>(10); // Spawn DataSource & Controllerrc mSpawnData = new SpawnDataSource(); SceneAgentsContoller sac = new SceneAgentsContoller(); sac.Binder.Bind(mSpawnData); mControllers.Add(sac); scenario = new PeScenario(); sac.Binder.Bind(mSpawnData); mControllers.Add(scenario); }