private void OnNextSpawnGroups(ref NextSpawnGroupsParam prm) { if (prm.OldGroup == null) { return; } for (int i = 0; i < this.node_ary.Count; i++) { DragonIcon.DragonNode dragonNode = this.node_ary[i]; if (dragonNode != null && dragonNode.spawnGroup == prm.OldGroup) { dragonNode.spawnGroup = prm.NextGroups[0]; } } ActorMeta actorMeta = prm.OldGroup.TheActorsMeta[0]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff == null) { return; } if (dataCfgInfoByCurLevelDiff.bSoldierType == 9) { KillDetailInfo killDetailInfo = new KillDetailInfo(); killDetailInfo.bSelfCamp = true; killDetailInfo.Type = KillDetailInfoType.Info_Type_5V5SmallDragon_Suicide; Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, killDetailInfo); KillDetailInfo killDetailInfo2 = new KillDetailInfo(); killDetailInfo2.bSelfCamp = true; killDetailInfo2.Type = KillDetailInfoType.Info_Type_5V5SmallDragon_Enter; Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, killDetailInfo2); } }
public void Init(GameObject mmNode_ugui, GameObject bmNode_ugui, GameObject mmNode_3dui, GameObject bmNode_3dui, bool b5V5) { this.m_b5v5 = b5V5; Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_born", new Action <ActorRoot>(this.onDragon_Born)); Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_dead", new Action <ActorRoot>(this.onDragon_Dead)); Singleton <GameEventSys> .instance.AddEventHandler <NextSpawnGroupsParam>(GameEventDef.Event_NextSpawnGroups, new RefAction <NextSpawnGroupsParam>(this.OnNextSpawnGroups)); for (int i = 0; i < mmNode_ugui.transform.childCount; i++) { mmNode_ugui.transform.GetChild(i).gameObject.CustomSetActive(false); } for (int j = 0; j < bmNode_ugui.transform.childCount; j++) { bmNode_ugui.transform.GetChild(j).gameObject.CustomSetActive(false); } for (int k = 0; k < mmNode_3dui.transform.childCount; k++) { mmNode_3dui.transform.GetChild(k).gameObject.CustomSetActive(false); } for (int l = 0; l < bmNode_3dui.transform.childCount; l++) { bmNode_3dui.transform.GetChild(l).gameObject.CustomSetActive(false); } this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_3", 7, 0)); this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_big", 8, 0)); this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_small_1", 9, 13)); this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_small_2", 9, 13)); ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .instance.mapLogic.GetSpawnGroups(); if (spawnGroups != null) { for (int m = 0; m < spawnGroups.Count; m++) { SpawnGroup spawnGroup = spawnGroups[m]; if (spawnGroup != null) { ActorMeta actorMeta = spawnGroup.TheActorsMeta[0]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff != null) { bool flag = dataCfgInfoByCurLevelDiff.bSoldierType == 8 || dataCfgInfoByCurLevelDiff.bSoldierType == 9 || dataCfgInfoByCurLevelDiff.bSoldierType == 7 || dataCfgInfoByCurLevelDiff.bSoldierType == 13; if (flag && !spawnGroup.bTriggerSpawn) { DragonIcon.DragonNode dragonNode = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType); if (dragonNode != null) { dragonNode.spawnGroup = spawnGroup; dragonNode.SetData(spawnGroup.gameObject.transform.position, (int)dataCfgInfoByCurLevelDiff.bSoldierType, 0u, this.m_b5v5, true, true, true); dragonNode.ShowDead(true); MiniMapSysUT.RefreshMapPointerBig(dragonNode.bmDragonNode_3dui); } } } } } } this.m_cdTimer = Singleton <CTimerManager> .GetInstance().AddTimer(1000, 0, new CTimer.OnTimeUpHandler(this.OnCDTimer)); }
private DragonIcon.DragonNode getDragonNode(byte type = 0) { for (int i = 0; i < this.node_ary.get_Count(); i++) { DragonIcon.DragonNode dragonNode = this.node_ary.get_Item(i); if (dragonNode != null && dragonNode.IsType(type)) { return(dragonNode); } } return(null); }
private void onDragon_Dead(ActorRoot actor) { DragonIcon.DragonNode dragonNode = this.getDragonNode(actor.ObjID, actor.ActorControl.GetActorSubSoliderType()); if (dragonNode != null) { dragonNode.ShowDead(actor.ActorControl.IsDeadState); dragonNode.objid = 0u; SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext(); if (curLvelContext != null && curLvelContext.IsFireHolePlayMode()) { dragonNode.Recycle(); } } }
public void RefreshDragNode(bool bUseCache, bool bRefreshMM = false) { ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .get_instance().mapLogic.GetSpawnGroups(); if (spawnGroups != null) { for (int i = 0; i < spawnGroups.get_Count(); i++) { SpawnGroup spawnGroup = spawnGroups.get_Item(i); if (spawnGroup != null && spawnGroup.NextGroups.Length == 0) { ActorMeta actorMeta = spawnGroup.TheActorsMeta[0]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff != null) { bool flag = dataCfgInfoByCurLevelDiff.bSoldierType == 8 || dataCfgInfoByCurLevelDiff.bSoldierType == 9 || dataCfgInfoByCurLevelDiff.bSoldierType == 7 || dataCfgInfoByCurLevelDiff.bSoldierType == 13; if (flag) { DragonIcon.DragonNode dragonNode = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType); if (dragonNode != null) { dragonNode.spawnGroup = spawnGroup; dragonNode.SetData(spawnGroup.gameObject.transform.position, (int)dataCfgInfoByCurLevelDiff.bSoldierType, dragonNode.objid, this.m_b5v5, bUseCache, false, bRefreshMM); if (dragonNode.objid != 0u) { PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(dragonNode.objid); if (actor) { dragonNode.ShowDead(actor.get_handle().ActorControl.IsDeadState); } else { dragonNode.ShowDead(true); } } else { dragonNode.ShowDead(true); } MiniMapSysUT.RefreshMapPointerBig(dragonNode.bmDragonNode_3dui); } } } } } } }
private void onDragon_Born(ActorRoot actor) { DragonIcon.DragonNode dragonNode = this.getDragonNode(actor.ObjID, actor.ActorControl.GetActorSubSoliderType()); DebugHelper.Assert(dragonNode != null, "onDragon_Born mmDNode_ugui == null, check out..."); if (dragonNode == null) { return; } MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys; bool bRefreshCache = theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini; dragonNode.SetData(actor.myTransform.position, (int)actor.ActorControl.GetActorSubSoliderType(), actor.ObjID, this.m_b5v5, true, bRefreshCache, true); dragonNode.ShowDead(actor.ActorControl.IsDeadState); byte actorSubSoliderType = actor.ActorControl.GetActorSubSoliderType(); if (actorSubSoliderType == 8 || actorSubSoliderType == 9 || actorSubSoliderType == 13) { bool flag = theMinimapSys != null && theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini; if (flag) { Camera currentCamera = Singleton <Camera_UI3D> .GetInstance().GetCurrentCamera(); if (currentCamera != null) { Vector3 v = currentCamera.WorldToScreenPoint((!flag) ? dragonNode.bmDragonNode_3dui.transform.position : dragonNode.mmDragonNode_3dui.transform.position); Singleton <CUIParticleSystem> .get_instance().AddParticle(DragonIcon.dragonBornEffect, 3f, v); } } } if (actorSubSoliderType == 8) { Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_DaLong_VO_Refresh"); } else if (actorSubSoliderType == 9) { Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_XiaoLong_VO_Refresh"); } else { Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_BaoJun_VO_Anger"); } }
public void Clear() { Singleton <CTimerManager> .GetInstance().RemoveTimerSafely(ref this.m_cdTimer); for (int i = 0; i < this.node_ary.get_Count(); i++) { DragonIcon.DragonNode dragonNode = this.node_ary.get_Item(i); if (dragonNode != null) { dragonNode.Clear(); } } this.node_ary.Clear(); this.node_ary = null; Singleton <EventRouter> .GetInstance().RemoveEventHandler <ActorRoot>("Dragon_born", new Action <ActorRoot>(this.onDragon_Born)); Singleton <EventRouter> .GetInstance().RemoveEventHandler <ActorRoot>("Dragon_dead", new Action <ActorRoot>(this.onDragon_Dead)); this.m_b5v5 = false; }
private DragonIcon.DragonNode getDragonNode(uint objid, byte type) { for (int i = 0; i < this.node_ary.get_Count(); i++) { DragonIcon.DragonNode dragonNode = this.node_ary.get_Item(i); if (dragonNode != null && dragonNode.IsType(type) && dragonNode.objid == objid) { return(dragonNode); } } for (int j = 0; j < this.node_ary.get_Count(); j++) { DragonIcon.DragonNode dragonNode2 = this.node_ary.get_Item(j); if (dragonNode2 != null && dragonNode2.IsType(type) && dragonNode2.objid == 0u) { dragonNode2.objid = objid; return(dragonNode2); } } return(null); }
public void Clear() { Singleton <CTimerManager> .GetInstance().RemoveTimerSafely(ref this.m_cdTimer); for (int i = 0; i < this.node_ary.Count; i++) { DragonIcon.DragonNode dragonNode = this.node_ary[i]; if (dragonNode != null) { dragonNode.Clear(); } } this.node_ary.Clear(); this.node_ary = null; Singleton <EventRouter> .GetInstance().RemoveEventHandler <ActorRoot>("Dragon_born", new Action <ActorRoot>(this.onDragon_Born)); Singleton <EventRouter> .GetInstance().RemoveEventHandler <ActorRoot>("Dragon_dead", new Action <ActorRoot>(this.onDragon_Dead)); Singleton <GameEventSys> .instance.RmvEventHandler <NextSpawnGroupsParam>(GameEventDef.Event_NextSpawnGroups, new RefAction <NextSpawnGroupsParam>(this.OnNextSpawnGroups)); this.m_b5v5 = false; }