public virtual void OnSuceededToCreate(SceneEntityPosAgent agent) { // Default behavior: LodCmpt entityLodCmpt = agent.entity.lodCmpt; if (entityLodCmpt != null) { entityLodCmpt.onDestruct += (e) => { agent.DestroyEntity(); }; } }
void OnMonsterEdge(LodCmpt lc) { lc.OnDestroy(); if (_uiData != null) { _uiData.CurCount++; } if (handlerOneDeath != null) { handlerOneDeath(); } }
public override void OnSuceededToCreate(SceneEntityPosAgent agent) { //base.OnSuceededToCreate(agent); LodCmpt entityLodCmpt = agent.entity.lodCmpt; if (entityLodCmpt != null) { entityLodCmpt.onDestruct += (e) => { agent.DestroyEntity(); }; } _agent.OnSuceededToCreate(); }
// For SceneMan Coroutine IEnumerator CreateEntity() { mIsProcessing = true; int n = 0; while (n++ < MaxTimes) { switch (mType) { case EntityType.EntityType_Npc: scene.Notify(ESceneNoification.CreateNpc, this); break; case EntityType.EntityType_Monster: scene.Notify(ESceneNoification.CreateMonster, this, mIsSave); break; } if (entity != null) { entity.scenarioId = ScenarioId; SkAliveEntity skAlive = entity.GetCmpt <Pathea.SkAliveEntity> (); if (skAlive != null) { skAlive.deathEvent += OnEntityDeath; } // Note: this entity might be group LodCmpt entityLodCmpt = entity.lodCmpt; if (entityLodCmpt != null) { entityLodCmpt.onDestruct += (e) => { DestroyEntity(); }; } break; } yield return(new WaitForSeconds(OneWait)); } mIsProcessing = false; }
void CreateEntityStatic() { scene.Notify(ESceneNoification.CreateDoodad, this, IsSave); if (entity != null) { entity.scenarioId = ScenarioId; SkAliveEntity skAlive = entity.GetCmpt <Pathea.SkAliveEntity>(); if (skAlive != null) { skAlive.deathEvent += OnEntityDeath; } LodCmpt entityLodCmpt = entity.lodCmpt; if (entityLodCmpt != null) { entityLodCmpt.onDestruct += (e) => { DestroyEntity(); }; } } }
public override void OnSuceededToCreate(SceneEntityPosAgent agent) { LodCmpt entityLodCmpt = agent.entity.lodCmpt; if (entityLodCmpt != null) { entityLodCmpt.onDestruct += (e) => { agent.DestroyEntity(); }; } if (_bsRate >= 0) { if (agent.entity.aliveEntity != null) { agent.entity.aliveEntity.deathEvent += (a, b) => { SceneMan.self.StartCoroutine(DelayBossReborn(agent)); }; } } if (_bcn != null) { SceneMan.RemoveSceneObj(agent); } }
public bool ForceCreateEntity() { if (spawnPoint.isDead) { return(false); } switch (mType) { case EntityType.EntityType_Npc: scene.Notify(ESceneNoification.CreateNpc, this, false); break; case EntityType.EntityType_Monster: scene.Notify(ESceneNoification.CreateMonster, this, mIsSave, false); break; } if (entity != null) { SkAliveEntity skAlive = entity.GetCmpt <Pathea.SkAliveEntity>(); if (skAlive != null) { skAlive.deathEvent += OnEntityDeath; } LodCmpt entityLodCmpt = entity.lodCmpt; if (entityLodCmpt != null) { entityLodCmpt.onDestruct += (e) => { DestroyEntity(); }; } return(true); } return(false); }
public virtual void OnMonsterCreated(PeEntity e) { if (e != null) { CommonCmpt cc = e.GetCmpt <CommonCmpt>(); if (cc != null) { cc.TDObj = gameObject; cc.TDpos = gameObject.transform.position; } SkAliveEntity sae = e.GetCmpt <SkAliveEntity>(); if (sae != null) { sae.deathEvent += (t, c) => OnMonsterDeath(e); sae.SetAttribute(AttribType.DefaultPlayerID, MonsterBeaconPlayerID); sae.SetAttribute(AttribType.CampID, MonsterBeaconCampID); LodCmpt lc = e.lodCmpt; if (e.lodCmpt != null && PeGameMgr.IsSingle && isSweep) { e.lodCmpt.onDestroyView = (p) => OnMonsterEdge(lc); } } } }