Beispiel #1
0
        private void onDragon_Born(ActorRoot actor)
        {
            DragonNode node = this.getDragonNode(actor.ObjID, actor.ActorControl.GetActorSubSoliderType());

            DebugHelper.Assert(node != null, "onDragon_Born node == null, check out...");
            if (node != null)
            {
                node.SetData(actor.gameObject.transform.position, actor.ActorControl.GetActorSubSoliderType(), actor.ObjID, this.m_b5v5);
                node.ShowDead(actor.ActorControl.IsDeadState);
                switch (actor.ActorControl.GetActorSubSoliderType())
                {
                case 8:
                case 9:
                case 13:
                {
                    bool flag = Singleton <CBattleSystem> .instance.GetMinimapSys().CurMapType() == MinimapSys.EMapType.Mini;

                    if (flag)
                    {
                        TowerHit._play_effect("Prefab_Skill_Effects/tongyong_effects/Indicator/blin_01_c.prefab", 3f, !flag ? node.node_in_bigMap : node.node_in_smallMap);
                    }
                    Singleton <CSoundManager> .GetInstance().PlayBattleSound("Play_BaoJun_VO_Anger", null);

                    MiniMapSysUT.RefreshMapPointerBig(node.node_in_bigMap);
                    break;
                }
                }
            }
        }
Beispiel #2
0
        public static DragonNode DeSerialize(int ID, Vector3 wPos, bool use = true)
        {
            DragonNode node = null;

            switch (ID)
            {
            case 215:
                node = DragonNode.New(DragonNode.Name.HEAD, wPos, use);
                if (use)
                {
                    lastDragon = Instantiate(R.asset.prefab.dragon, wPos, Quaternion.identity);
                    lastDragon.transform.parent = Board.instance.platformAnchor;
                }
                else
                {
                    lastDragon = null;
                }
                break;

            case 216:
                node = DragonNode.New(DragonNode.Name.BODY, wPos, use);
                break;

            case 217:
                node = DragonNode.New(DragonNode.Name.TAIL, wPos, use);
                break;
            }

            lastDragon?.Use(node);
            return(node);
        }
Beispiel #3
0
        private void onDragon_Born(ActorRoot actor)
        {
            DragonNode node = this.getDragonNode(actor.ObjID, actor.ActorControl.GetActorSubSoliderType());

            DebugHelper.Assert(node != null, "onDragon_Born node == null, check out...");
            if (node != null)
            {
                node.SetData(actor.gameObject.transform.position, actor.ActorControl.GetActorSubSoliderType(), actor.ObjID, this.m_b5v5);
                node.ShowDead(actor.ActorControl.IsDeadState);
                byte actorSubSoliderType = actor.ActorControl.GetActorSubSoliderType();
                if (((actorSubSoliderType == 8) || (actorSubSoliderType == 9)) || (actorSubSoliderType == 13))
                {
                    MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

                    bool flag = (theMinimapSys != null) && (theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini);
                    if (flag)
                    {
                        TowerHit._play_effect("Prefab_Skill_Effects/tongyong_effects/Indicator/blin_01_c.prefab", 3f, !flag ? node.node_in_bigMap : node.node_in_smallMap);
                    }
                    switch (actorSubSoliderType)
                    {
                    case 7:
                        MiniMapSysUT.SetMapElement_EventParam(node.node_in_bigMap, false, MinimapSys.ElementType.Dragon_3, actor.ObjID, 0);
                        break;

                    case 8:
                        MiniMapSysUT.SetMapElement_EventParam(node.node_in_bigMap, false, MinimapSys.ElementType.Dragon_5_big, actor.ObjID, 0);
                        break;

                    case 9:
                        MiniMapSysUT.SetMapElement_EventParam(node.node_in_bigMap, false, MinimapSys.ElementType.Dragon_5_small, actor.ObjID, 0);
                        break;
                    }
                    MiniMapSysUT.RefreshMapPointerBig(node.node_in_bigMap);
                }
                switch (actorSubSoliderType)
                {
                case 8:
                    Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_DaLong_VO_Refresh");

                    break;

                case 9:
                    Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_XiaoLong_VO_Refresh");

                    break;

                default:
                    Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_BaoJun_VO_Anger");

                    break;
                }
            }
        }
Beispiel #4
0
 private DragonNode getDragonNode(byte type = 0)
 {
     for (int i = 0; i < this.node_ary.Count; i++)
     {
         DragonNode node = this.node_ary[i];
         if ((node != null) && node.IsType(type))
         {
             return(node);
         }
     }
     return(null);
 }
Beispiel #5
0
        public void Init(GameObject node, GameObject bigNode, 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));

            for (int i = 0; i < node.transform.childCount; i++)
            {
                node.transform.GetChild(i).gameObject.CustomSetActive(false);
            }
            for (int j = 0; j < bigNode.transform.childCount; j++)
            {
                bigNode.transform.GetChild(j).gameObject.CustomSetActive(false);
            }
            this.node_ary.Add(new DragonNode(node, bigNode, "d_3", 7, 0));
            this.node_ary.Add(new DragonNode(node, bigNode, "d_5_big", 8, 0));
            this.node_ary.Add(new DragonNode(node, bigNode, "d_5_small_1", 9, 13));
            this.node_ary.Add(new DragonNode(node, bigNode, "d_5_small_2", 9, 13));
            SpawnGroup            group       = null;
            ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .instance.mapLogic.GetSpawnGroups();

            if (spawnGroups != null)
            {
                for (int k = 0; k < spawnGroups.Count; k++)
                {
                    group = spawnGroups[k];
                    if ((group != null) && (group.NextGroups.Length == 0))
                    {
                        ActorMeta         meta = group.TheActorsMeta[0];
                        ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(meta.ConfigId);
                        if ((dataCfgInfoByCurLevelDiff != null) && ((((dataCfgInfoByCurLevelDiff.bSoldierType == 8) || (dataCfgInfoByCurLevelDiff.bSoldierType == 9)) || (dataCfgInfoByCurLevelDiff.bSoldierType == 7)) || (dataCfgInfoByCurLevelDiff.bSoldierType == 13)))
                        {
                            DragonNode node2 = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType);
                            if (node2 != null)
                            {
                                node2.spawnGroup = group;
                                node2.SetData(group.gameObject.transform.position, dataCfgInfoByCurLevelDiff.bSoldierType, 0, this.m_b5v5);
                                node2.ShowDead(true);
                                MiniMapSysUT.RefreshMapPointerBig(node2.node_in_bigMap);
                            }
                        }
                    }
                }
            }
            if (Singleton <WatchController> .GetInstance().IsWatching)
            {
                this.m_cdTimer = Singleton <CTimerManager> .GetInstance().AddTimer(0x3e8, 0, new CTimer.OnTimeUpHandler(this.OnCDTimer));
            }
        }
Beispiel #6
0
        private void onDragon_Dead(ActorRoot actor)
        {
            DragonNode node = this.getDragonNode(actor.ObjID, actor.ActorControl.GetActorSubSoliderType());

            if (node != null)
            {
                node.SetData(actor.gameObject.transform.position, actor.ActorControl.GetActorSubSoliderType(), actor.ObjID, this.m_b5v5);
                node.ShowDead(actor.ActorControl.IsDeadState);
                node.objid = 0;
                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                if ((curLvelContext != null) && (curLvelContext.iLevelID == 0x4e29))
                {
                    node.Recycle();
                }
            }
        }
Beispiel #7
0
        public void Clear()
        {
            for (int i = 0; i < this.node_ary.Count; i++)
            {
                DragonNode node = this.node_ary[i];
                if (node != null)
                {
                    node.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;
        }
Beispiel #8
0
 private DragonNode getDragonNode(uint objid, byte type)
 {
     for (int i = 0; i < this.node_ary.Count; i++)
     {
         DragonNode node = this.node_ary[i];
         if (((node != null) && node.IsType(type)) && (node.objid == objid))
         {
             return(node);
         }
     }
     for (int j = 0; j < this.node_ary.Count; j++)
     {
         DragonNode node2 = this.node_ary[j];
         if (((node2 != null) && node2.IsType(type)) && (node2.objid == 0))
         {
             node2.objid = objid;
             return(node2);
         }
     }
     return(null);
 }
Beispiel #9
0
 private void Use(DragonNode node)
 {
     nodes.Add(node);
     node.dragon           = this;
     node.transform.parent = transform;
 }