Esempio n. 1
0
 // 英雄移动 [1/20/2015 Zmy]
 private void HeroForward()
 {
     FightEditorContrler.GetInstantiate().CamPlay();
     FightEditorContrler.GetInstantiate().HeroPathPlay();
     FightEditorContrler.GetInstantiate().HeroPathNormalMove();
     FightEditorContrler.GetInstantiate().HeroPathSetFormation();
 }
Esempio n. 2
0
        //英雄瞬间移动结束慢慢出现
        private void UpdateMomentMoveExit()
        {
            int nHeroCount = SceneObjectManager.GetInstance().GetObjectHeroCount();

            for (int i = 0; i < nHeroCount; ++i)
            {
                ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i);
                if (HeroObj != null && HeroObj.IsAlive())
                {
                    //..慢慢出现
                    m_ShowCount++;
                }
            }
            if (m_ShowCount == SceneObjectManager.GetInstance().GetObjectHeroCount())
            {
                m_ShowCount = 0;
                FightEditorContrler.GetInstantiate().HeroPathNormalMove();
                SetFightState(FightState.HeroMove);
                for (int i = 0; i < nHeroCount; ++i)
                {
                    ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i);
                    if (HeroObj != null && HeroObj.IsAlive())
                    {
                        HeroObj.GetNavMesh().enabled = true;
                        HeroObj.SetObjectActionState(ObjectCreature.ObjectActionState.forward);
                    }
                }
            }
        }
Esempio n. 3
0
        //当前战斗结束 [1/21/2015 Zmy]
        private void OnRoundOver()
        {
            //每回合结束 清空敌方的怒气值 [3/3/2015 Zmy]
            m_EnemyPower.OnUpdatePowerValue(-m_EnemyPower.GetPowerValue());
            //击杀一波怪物后,对本方怒气进行奖励刷新 [3/3/2015 Zmy]
            EachRewardPower();


            GameEventDispatcher.Inst.dispatchEvent(GameEventID.F_BattleRoundOver);

            if (ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter)
            {
                ObjectSelf.GetInstance().LimitFightMgr.SendRoundOver();
            }
            else
            {
                //胜利条件
                if (m_RoundInScene == FightEditorContrler.GetInstantiate().GetMonsterGroupCount())
                {
                    SetFightState(FightState.FightWin);
                }
                else
                {
                    FightEditorContrler.GetInstantiate().CamPause();
                    SetFightState(FightState.HeroMove);
                }
            }
            //每回合结束 清空战斗数据。 [6/26/2015 Zmy]
            SceneObjectManager.GetInstance().UpdateRoundOver();
        }
Esempio n. 4
0
        private void UpdateHeroBoarding()
        {
            moveTime += Time.deltaTime;

            if (moveTime < 0.1f)
            {
                return;
            }

            moveTime = 0f;

            int nHeroCount = SceneObjectManager.GetInstance().GetObjectHeroCount();

            for (int i = 0; i < nHeroCount; i++)
            {
                ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i);
                if (HeroObj != null && HeroObj.IsAlive())
                {
                    NavMeshAgent Nav = HeroObj.GetNavMesh();
                    Nav.speed = HeroObj.GetMoveSpeed();
                    Nav.SetDestination(FightEditorContrler.GetInstantiate().GetFormationPos(HeroObj));
                    //HeroObj.SetWorldPosRotation(FightEditorContrler.GetInstantiate().GetFormationPos(HeroObj), FightEditorContrler.GetInstantiate().GetFormationAngle(HeroObj));
                    HeroObj.SetObjectActionState(ObjectCreature.ObjectActionState.boarding);
                    HeroObj.GetAnimation().Anim_Fidle(false);
                }
            }
        }
Esempio n. 5
0
        //实例化Hero对象
        private void CallBack_InitHeroObject()
        {
            for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
            {
                int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
                if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
                {
                    continue;
                }
                X_GUID pMemberGuiD = null;

                if (ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter)
                {
                    pMemberGuiD = ObjectSelf.GetInstance().LimitFightMgr.m_HeroInfo[i];
                    if (ObjectSelf.GetInstance().LimitFightMgr.m_HeroHp[i] == 0)
                    {
                        //初始英雄时,如果血量记录是0 代表本次是继续开启的试炼。并且上次的英雄已死亡。那么本次不再实例化英雄 [6/19/2015 Zmy]
                        pMemberGuiD.CleanUp();
                    }
                }
                else
                {
                    pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i]; //暂时默认上场第一组阵型的英雄[3/25/2015 Zmy]
                }
                if (!pMemberGuiD.IsValid())
                {
                    continue;
                }
                ObjectCard pHero = ObjectSelf.GetInstance().HeroContainerBag.FindHero(pMemberGuiD);
                if (pHero == null)
                {
                    continue;
                }
                ArtresourceTemplate _Artresourcedata = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(pHero.GetHeroData().GetHeroViewID());
                if (_Artresourcedata == null)
                {
                    continue;
                }

                GameObject pHeroObject = AssetLoader.Inst.GetAssetRes(_Artresourcedata.getArtresources());
                if (pHeroObject != null)
                {
                    GameObject obj1 = Instantiate(pHeroObject, FightEditorContrler.GetInstantiate().GetFormationCenterPos(i), FightEditorContrler.GetInstantiate().GetFormationCenterAngle(i)) as GameObject;
                    GameUtils.SetLayerRecursively(obj1, FightEditorContrler.GetInstantiate().GetShadowCullMaskLayer());
                    float _zoom = _Artresourcedata.getArtresources_zoom();
                    obj1.transform.localScale = new UnityEngine.Vector3(_zoom, _zoom, _zoom);
                    SceneObjectManager.GetInstance().SceneObjectAddHero(obj1, pHero.GetHeroRow().getId(), pHero);
                    FightEditorContrler.GetInstantiate().InitFormationPos(pHero, i);
                }
            }
            FightEditorContrler.GetInstantiate().HeroPathInitSpeed();

            GameEventDispatcher.Inst.dispatchEvent(GameEventID.SE_StoryCameraEnd);

            //初始化完成后,切换状态 [1/20/2015 Zmy]
            SetFightState(FightState.prepareData);

            //初始入场怒气
            InitFightPower();
        }
Esempio n. 6
0
    public void RoundOverProcess(endlessAttr data, bool _initEnter = true)
    {
        this.m_DropNum    = data.dropnum;
        this.m_AllDropNum = data.alldropnum;
        this.m_AttrAdd1   = data.add1;
        this.m_AttrAdd2   = data.add2;
        this.m_AttrAdd3   = data.add3;
        this.m_AttrAdd4   = data.add4;

        //// 使用英雄的血量(key为位置,value为血量)
        //初次进入的时候,英雄血量的记录hash为空。 [6/19/2015 Zmy]
        foreach (DictionaryEntry item in data.herobloodlist)
        {
            int nIndex = (int)item.Key;
            if (nIndex >= 1 && nIndex <= GlobalMembers.MAX_TEAM_CELL_COUNT)
            {
                m_HeroHp[nIndex - 1] = (int)item.Value;
            }
        }

        if (_initEnter == true)//初次进入的时候。不用操作战斗控制器 [6/19/2015 Zmy]
        {
            return;
        }


        FightEditorContrler.GetInstantiate().CamPause();
        FightControler.Inst.SetFightState(FightState.HeroMove);
    }
Esempio n. 7
0
 private void HeroWait()
 {
     for (int i = 0; i < HerosList.Count; ++i)
     {
         HerosList[i].GetComponent <ForllowPoint>().SetGo();
     }
     FightEditorContrler.GetInstantiate().HeroPathNormalMove();
 }
Esempio n. 8
0
 private void HeroPathMomentMoveIng()
 {
     for (int i = 0; i < HerosList.Count; ++i)
     {
         HerosList[i].GetComponent <ForllowPoint>().MomentMove();
     }
     FightEditorContrler.GetInstantiate().HeroPathNormalMove();
     Invoke("HeroWait", 3);
 }
 private void FightEnd()
 {
     FightTempContrler.inst.Sencetype = FightTempContrler.SenceType.LineUp;
     for (int i = 0; i < HeroGroupContrler.inst.HerosList.Count; i++)
     {
         HeroGroupContrler.inst.HerosList[i].GetComponent <ForllowPoint>().SetGo();
     }
     FightEditorContrler.GetInstantiate().CamPause();
     MonstersList.Clear();
     FightEditorContrler.GetInstantiate().HeroPathNormalMove();
 }
Esempio n. 10
0
        //技能每命中一次目标产生结算后的处理 [3/2/2015 Zmy]
        public void __SpellOverLogic(int Hitcount)
        {
            if (Hitcount >= 1)
            {
                if (FightEditorContrler.GetInstantiate() != null)
                {
                    FightEditorContrler.GetInstantiate().SkillShake(m_pSpellInfo.GetSpellRow().getVibrationScreen(), EM_SPELL_SHAKE_TYPE.EM_SPELL_SHAKE_TYPE_HIT);
                }

                AudioControler.Inst.PlaySound(m_pSpellInfo.GetSpellRow().getUnderAttackSound());
            }
        }
Esempio n. 11
0
 private void CreatHero()
 {
     for (int i = 0; i < HeroPathtContrler.GetInstantiate().GetFormationObj().transform.childCount; i++)
     {
         GameObject hero = Instantiate(Resources.Load("Hero"), HeroPathtContrler.GetInstantiate().GetFormationObj().transform.GetChild(i).position, Quaternion.identity) as GameObject;
         hero.transform.parent = this.transform;
         hero.AddComponent <ForllowPoint>().Init(HeroPathtContrler.GetInstantiate().GetFormationObj().transform.GetChild(i));
         HerosList.Add(hero);
     }
     FightEditorContrler.GetInstantiate().CamPlay();
     FightEditorContrler.GetInstantiate().HeroPathPlay();
     FightEditorContrler.GetInstantiate().HeroPathNormalMove();
 }
Esempio n. 12
0
    /// <summary>
    /// 实例化弹道特效
    /// </summary>
    /// <param name="effectName">特效名称</param>
    /// <param name="MasterObj">发起者对象</param>
    /// <param name="TargetObj">目标对象</param>
    /// <param name="_SpellInfo">子弹的技能信息</param>
    public void InstanceEffect_Bullet(string effectName, ObjectCreature MasterObj, ObjectCreature TargetObj, SpellInfo _SpellInfo, EffectHit_Callback HitHandle = null)
    {
        //子弹释放中音效
        AudioControler.Inst.PlaySound(_SpellInfo.GetSpellRow().getBulletsFiredSound());
        //技能弹道的音效
        AudioControler.Inst.PlaySound(_SpellInfo.GetSpellRow().getBallIsticSound());

        EffectSpell _effect = GetFreeEffectSpell(effectName);

        if (_effect != null && _effect.GetGameObject() != null)
        {
            GameObject obj = _effect.GetGameObject();
            _effect.ResetTime();
            _effect.InitBornPoint(MasterObj);
            _effect.InitTargetPoint(TargetObj);
            _effect.SetHitEffectHandle(HitHandle);
            _effect.SetGameObject(obj);
        }
        else
        {
            GameObject _AssetRes = AssetLoader.Inst.GetAssetRes(effectName);
            if (_AssetRes == null)
            {
                return;
            }

            EffectSpell _newEffect = new EffectSpell(_SpellInfo);
            _newEffect.InitBornPoint(MasterObj);
            _newEffect.InitTargetPoint(TargetObj);

            GameObject _obj = Instantiate(_AssetRes, _newEffect.GetInitialLocation(), Quaternion.identity) as GameObject;
            if (MasterObj is ObjectMonster)
            {
                float _scale = ((ObjectMonster)MasterObj).GetMonsterRow().getMonsterEnlarge();
                _obj.transform.localScale = new UnityEngine.Vector3(_scale, _scale, _scale);
            }
            GameUtils.AttachParticleCS(_obj.transform);
            _newEffect.SetGameObject(_obj);
            _newEffect.SetEffectName(effectName);
            _newEffect.SetHitEffectHandle(HitHandle);

            m_EffectSpellList.Add(_newEffect);
        }
        //技能震动
        if (FightEditorContrler.GetInstantiate() != null)
        {
            FightEditorContrler.GetInstantiate().SkillShake(_SpellInfo.GetSpellRow().getVibrationScreen(), EM_SPELL_SHAKE_TYPE.EM_SPELL_SHAKE_TYPE_RELEASE);
        }
    }
Esempio n. 13
0
        //瞬间移动事件进入
        public void CallBack_eroPathMomentMoveEnter()
        {
            SetFightState(FightState.HeroMonmentMoveEnter);
            int nHeroCount = SceneObjectManager.GetInstance().GetObjectHeroCount();

            for (int i = 0; i < nHeroCount; ++i)
            {
                ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i);
                if (HeroObj != null && HeroObj.IsAlive())
                {
                    HeroObj.GetAnimation().Anim_Run();
                    NavMeshAgent Nav = HeroObj.GetNavMesh();
                    Nav.speed = HeroObj.GetMoveSpeed();
                    Nav.SetDestination(FightEditorContrler.GetInstantiate().GetFormationPos(HeroObj));
                    //Debug.Log(FightEditorContrler.GetInstantiate().GetFormationPos(HeroObj));
                    StartCoroutine(DelayCallPos(FightEditorContrler.GetInstantiate().GetFormationPos(HeroObj), HeroObj.GetGameObject(), HeroObj, CallBack_MomentMoveEnter));
                }
            }
        }
Esempio n. 14
0
        private void CallBack_PrepareBoard()
        {
            SetFightState(FightState.PrepareBoard);

            int nHeroCount = SceneObjectManager.GetInstance().GetObjectHeroCount();

            for (int i = 0; i < nHeroCount; ++i)
            {
                ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i);
                if (HeroObj != null && HeroObj.IsAlive())
                {
                    HeroObj.GetAnimation().Anim_Run();
                    NavMeshAgent Nav = HeroObj.GetNavMesh();
                    Nav.speed = HeroObj.GetMoveSpeed();
                    Nav.SetDestination(FightEditorContrler.GetInstantiate().GetFormationPos(HeroObj));

                    StartCoroutine(DelayCall(Nav, HeroObj.GetGameObject(), HeroObj, CallBack_PrepareBoardPos));
                }
            }
        }
 /// <summary>
 /// 点击跳过
 /// </summary>
 private void OnClickSkipBtn()
 {
     if (FightControler.isOpeningAnimation)
     {
         FightControler.isOpeningAnimation = false;
         if (FightControler.Inst.GetFightState() != FightState.FightInstantiateHero)
         {
             GameEventDispatcher.Inst.dispatchEvent(GameEventID.SE_StoryEnd);
             GameEventDispatcher.Inst.dispatchEvent(GameEventID.SE_FightEditorLoadDone);
         }
     }
     else
     {
         if (StoryAnimEditorContrler.GetInst().GetStoryAnimID() != 1)
         {
             FightEditorContrler.GetInstantiate().HeroPathFightEnterEnd();
             GameEventDispatcher.Inst.dispatchEvent(GameEventID.SE_StoryEnd);
             //GameEventDispatcher.Inst.dispatchEvent(GameEventID.SE_EnterFightState, StoryAnimEditorContrler.GetInst().GetCurrentFightCount());
         }
     }
 }
Esempio n. 16
0
        //进入战斗状态开始战斗,在这之前先修正一下人物位置 [1/20/2015 Zmy]
        private void CallBack_EnterFightState()
        {
            int nHeroCount = SceneObjectManager.GetInstance().GetObjectHeroCount();

            for (int i = 0; i < nHeroCount; ++i)
            {
                //                 ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i);
                //                 if (HeroObj != null)
                //                 {
                //                     GameObject obj = HeroObj.GetGameObject();
                //                     if (obj != null)
                //                     {
                //                         obj.GetComponent<NavMeshAgent>().Stop();
                //                         float _heroSpeed = HeroObj.GetMoveSpeed();
                //                         float _moveTime = Vector3.Distance(obj.transform.position, FightEditorContrler.inst.GetFormationPos(HeroObj.GetGameObject())) / _heroSpeed;
                //                         //修正高度值 [1/22/2015 Zmy]
                //                         Vector3 targetPos = new Vector3(FightEditorContrler.inst.GetFormationPos(HeroObj.GetGameObject()).x, obj.transform.position.y, FightEditorContrler.inst.GetFormationPos(HeroObj.GetGameObject()).z);
                //                         obj.transform.DOMove(targetPos, _moveTime).SetUpdate(true).SetEase(Ease.Linear).OnComplete(()=>CallBack_RevisepPos(obj,HeroObj));
                //                     }
                //                 }

                ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i);
                if (HeroObj != null && HeroObj.IsAlive())
                {
                    HeroObj.GetAnimation().Anim_Run();
                    NavMeshAgent Nav = HeroObj.GetNavMesh();
                    Nav.speed = HeroObj.GetMoveSpeed();
                    Nav.SetDestination(FightEditorContrler.GetInstantiate().GetFormationPos(HeroObj));

                    StartCoroutine(DelayCall(Nav, HeroObj.GetGameObject(), HeroObj, CallBack_RevisepPos));
                }
            }

            //切换准备战斗状态
            SetFightState(FightState.prepareFight);

            //重算一下移动位置偏移量;
            HeroPathtContrler.GetInstantiate().ResetMoveTargetOffset();
        }
Esempio n. 17
0
        //英雄慢慢消失后瞬间移动
        private void UpdateMomentMoveIng()
        {
            int nHeroCount = SceneObjectManager.GetInstance().GetObjectHeroCount();

            for (int i = 0; i < nHeroCount; ++i)
            {
                ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i);
                if (HeroObj != null && HeroObj.IsAlive())
                {
                    //..慢慢消失
                    m_DisappearCount++;
                    HeroObj.GetNavMesh().enabled = false;
                    HeroObj.OnConcealThis();
                }
            }
            if (m_DisappearCount == SceneObjectManager.GetInstance().GetObjectHeroCount())
            {
                m_DisappearCount = 0;
                FightEditorContrler.GetInstantiate().HeroPathNormalMove();
                SetFightState(FightState.HeroMonmentMoveEnter);
            }
        }
Esempio n. 18
0
    /// <summary>
    /// 在指定坐标实例化一个存在指定生存时间的静态特效
    /// </summary>
    /// <param name="effectName"></param>
    /// <param name="parent">坐标</param>
    /// <param name="lifetime">生存时间</param>
    /// <param name="_SpellInfo"></param>
    public void InstanceEffect_Static(string effectName, ObjectCreature pCaster, Vector3 parent, float lifetime, SpellInfo _SpellInfo)
    {
        EffectStatic _effect = GetFreeEffectStatic(effectName);

        if (_effect != null && _effect.GetGameObject() != null)
        {
            GameObject obj = _effect.GetGameObject();
            obj.transform.position = parent;
            _effect.SetCasterObj(pCaster);
            _effect.ResetTime();
            _effect.SetActivation(true);
        }
        else
        {
            GameObject _AssetRes = AssetLoader.Inst.GetAssetRes(effectName);
            if (_AssetRes == null)
            {
                return;
            }

            EffectStatic _newEffect = new EffectStatic();

            GameObject _obj = Instantiate(_AssetRes, parent, Quaternion.identity) as GameObject;
            if (pCaster is ObjectMonster)
            {
                float _scale = ((ObjectMonster)pCaster).GetMonsterRow().getMonsterEnlarge();
                _obj.transform.localScale = new UnityEngine.Vector3(_scale, _scale, _scale);
            }
            GameUtils.AttachParticleCS(_obj.transform);
            _newEffect.SetGameObject(_obj);
            _newEffect.SetLiftTime(lifetime);
            _newEffect.SetCasterObj(pCaster);
            _newEffect.SetEffectName(effectName);
            m_EffectStaticList.Add(_newEffect);
        }
        //技能震动
        FightEditorContrler.GetInstantiate().SkillShake(_SpellInfo.GetSpellRow().getVibrationScreen(), EM_SPELL_SHAKE_TYPE.EM_SPELL_SHAKE_TYPE_RELEASE);
    }
Esempio n. 19
0
        //移动中更新obj位置 [1/20/2015 Zmy]
        private void UpdateHeroForward()
        {
            moveTime += Time.deltaTime;
            if (moveTime < 0.1f)
            {
                //控制刷新延迟 [1/21/2015 Zmy]
                return;
            }
            moveTime = 0.0f;
            int nHeroCount = SceneObjectManager.GetInstance().GetObjectHeroCount();

            for (int i = 0; i < nHeroCount; ++i)
            {
                ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i);
                if (HeroObj != null && HeroObj.IsAlive())
                {
                    NavMeshAgent Nav = HeroObj.GetNavMesh();
                    Nav.speed = HeroObj.GetMoveSpeed();
                    Nav.SetDestination(FightEditorContrler.GetInstantiate().GetFormationPos(HeroObj));

                    HeroObj.SetObjectActionState(ObjectCreature.ObjectActionState.forward);
                }
            }
        }
Esempio n. 20
0
        // ============================= 事件响应回调函数 =================================

        //实例化hero出场特效;
        private void CallBack_InitHeroEffect()
        {
            for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
            {
                int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
                if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
                {
                    continue;
                }
                X_GUID pMemberGuiD = null;

                if (ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter)
                {
                    pMemberGuiD = ObjectSelf.GetInstance().LimitFightMgr.m_HeroInfo[i];
                    if (ObjectSelf.GetInstance().LimitFightMgr.m_HeroHp[i] == 0)
                    {
                        //初始英雄时,如果血量记录是0 代表本次是继续开启的试炼。并且上次的英雄已死亡。那么本次不再实例化英雄 [6/19/2015 Zmy]
                        pMemberGuiD.CleanUp();
                    }
                }
                else
                {
                    pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i]; //暂时默认上场第一组阵型的英雄[3/25/2015 Zmy]
                }
                if (!pMemberGuiD.IsValid())
                {
                    continue;
                }
                ObjectCard pHero = ObjectSelf.GetInstance().HeroContainerBag.FindHero(pMemberGuiD);
                if (pHero == null)
                {
                    continue;
                }
                ArtresourceTemplate _Artresourcedata = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(pHero.GetHeroData().GetHeroViewID());
                if (_Artresourcedata == null)
                {
                    continue;
                }

                GameObject pHeroObject = AssetLoader.Inst.GetAssetRes(_Artresourcedata.getArtresources());
                if (pHeroObject != null)
                {
                    //创建出场特效;
                    GameObject eff = Instantiate(Resources.Load("Effect/Effect_Chuchang01"), FightEditorContrler.GetInstantiate().GetFormationCenterPos(i), FightEditorContrler.GetInstantiate().GetFormationCenterAngle(i)) as GameObject;
                    Destroy(eff, 0.3f);
                }
            }

            Invoke("CallBack_InitHeroObject", 0.3f);
        }
Esempio n. 21
0
        //数据更新。状态修改时,只进入一次,基类调用顺序优先级最高。 [1/19/2015 Zmy]
        protected override void UpdateData()
        {
            ObjectSelf.GetInstance().LimitFightMgr.UpdateData();

            if (m_CurState != m_LastState)
            {
                m_LastState = m_CurState;
                switch (m_CurState)
                {
                case FightState.prepareData:
                    SetFightState(FightState.HeroMove);
                    m_bActiveCountDown = m_FightCountDown < 0 ? false : true;
                    break;

                case FightState.HeroMove:
                    //HeroForward();
                    break;

                case FightState.HeroMonmentMoveEnter:
                    break;

                case FightState.HeroMonmentMoveIng:

                    break;

                case FightState.HeroMonmentMoveExit:
                    break;

                case FightState.prepareEnemy:
                    InstantiateMonsterObj();

                    break;

                case FightState.prepareEnemy_over:

                    break;

                case FightState.FightStory:
                    break;

                case FightState.FightStoryCamera:
                    FightEditorContrler.GetInstantiate().CamPlay();
                    break;

                case FightState.prepareFight:

                    break;

                case FightState.Fighting:

                    break;

                case FightState.FightOver:
                    OnRoundOver();
                    break;

                case FightState.FightWin:
                    OnSceneFightWin();
                    break;

                case FightState.FightLose:
                    OnSceneFightLose();
                    break;

                case FightState.PrepareBoard:
                    break;

                case FightState.PrepareBoardOver:
                    SetFightState(FightState.Boarding);
                    break;

                case FightState.Boarding:
                    break;

                case FightState.BoardingOver:
                    break;

                case FightState.FightInstantiateHero:
                    if (FightControler.isOpeningAnimation)
                    {
                        FightControler.isOpeningAnimation = false;
                        GameEventDispatcher.Inst.dispatchEvent(GameEventID.SE_StoryEnd);
                        //FightEditorContrler.GetInstantiate().CamPause();
                        GameEventDispatcher.Inst.dispatchEvent(GameEventID.SE_FightEditorLoadDone);
                    }
                    else
                    {
                        SetFightState(FightState.HeroMove);
                    }
                    break;
                }
            }
        }
Esempio n. 22
0
        //实例化怪物 [1/20/2015 Zmy]
        private void InstantiateMonsterObj()
        {
            int MonsterNum = FightEditorContrler.GetInstantiate().GetMonsterGroupEditorData(m_RoundInScene).Count;

            FightEditorContrler.GetInstantiate().SetMonsterTroopType(ObjectSelf.GetInstance().LimitFightMgr.m_MonsterTroopType);
            FightEditorContrler.GetInstantiate().SetBeginFightCount(ObjectSelf.GetInstance().LimitFightMgr.m_RoundNum);

            for (int i = 0; i < MonsterNum; ++i)
            {
                int                 nTableID  = SceneObjectManager.GetInstance().GetMosnterBundleRes(m_RoundInTotal, i);
                MonsterTemplate     pRow      = (MonsterTemplate)DataTemplate.GetInstance().m_MonsterTable.getTableData(nTableID);
                ArtresourceTemplate art       = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(pRow.getArtresources());
                string              _res      = art.getArtresources();
                GameObject          _AssetRes = AssetLoader.Inst.GetAssetRes(_res);
                GameObject          obj       = Instantiate(_AssetRes,
                                                            FightEditorContrler.GetInstantiate().GetMonsterGroupEditorData(m_RoundInScene)[i].MyPos,
                                                            FightEditorContrler.GetInstantiate().GetMonsterGroupEditorData(m_RoundInScene)[i].MyAngle) as GameObject;
                GameUtils.SetLayerRecursively(obj, FightEditorContrler.GetInstantiate().GetShadowCullMaskLayer());
                float _zoom = art.getArtresources_zoom() * pRow.getMonsterEnlarge();
                obj.transform.localScale = new UnityEngine.Vector3(_zoom, _zoom, _zoom);

                FightEditorContrler.GetInstantiate().SetMonsterBirthState(obj, FightEditorContrler.GetInstantiate().GetMonsterGroupEditorData(m_RoundInScene)[i], false);
                SceneObjectManager.GetInstance().SceneObjectAddMonster(obj, m_RoundInTotal, i);


                //Transform _body = null;
                //_body = obj.transform.FindChild("Body");
                //if (_body != null)
                //{
                //    _body.gameObject.SetActive(false);
                //    StartCoroutine(OnShowMonsterObj(_body));
                //}

                for (int m = 0, n = obj.transform.childCount; m < n; m++)
                {
                    obj.transform.GetChild(m).gameObject.SetActive(false);
                }
                StartCoroutine(OnShowMonsterObj(obj.transform));

                //怪物入场怒气加成 [10/17/2015 Zmy]
                AngertableTemplate _data = (AngertableTemplate)DataTemplate.GetInstance().m_AngerTable.getTableData(pRow.getFuryId());
                if (_data == null)
                {
                    continue;
                }

                m_EnemyPower.OnUpdatePowerValue(_data.getStartFury());
            }

//             //每波怪物初始化时候,初始敌方怒气值 [3/3/2015 Zmy]
//             if (m_RoundInScene - 1 >= 0 && m_RoundInScene - 1 < m_StageRow.m_waveFury.Length)
//             {
//                 int nValue = m_StageRow.m_waveFury[m_RoundInScene - 1];
//                 m_EnemyPower.OnUpdatePowerValue(nValue);
//             }

            //初始化释放怪物的被动技能 [7/31/2015 Zmy]
            SceneObjectManager.GetInstance().OnMonsterFreePassiveSpell();

            // add by zcd
            SetFightState(FightState.prepareEnemy_over);
        }