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)); }
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"); } }