少年修仙传客户端代码仓库
client_linchunjie
2019-05-17 e8394d52c40cdb5275f74245f7e574fdc4f2e77a
3335 前端宝藏
2个文件已修改
82 ■■■■■ 已修改文件
Fight/Stage/Dungeon/ClientHazyPreciousDungeonStage.cs 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyRegionModel.cs 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/Dungeon/ClientHazyPreciousDungeonStage.cs
@@ -6,8 +6,16 @@
{
    public class ClientHazyPreciousDungeonStage : DungeonStage
    {
        readonly Vector3 s_PlayerPosition = new Vector3(17.609f, 5.469f, 2.233f);
        readonly Vector3 s_BossPosition = new Vector3(11.46125f, 5.810412f, 11.24522f);
        readonly Vector3 s_PreciousPosition = new Vector3(5.76f, 6.708447f, 23.48f);
        readonly Vector3 s_PreciousEffectPosition = new Vector3(5.8f, 6.708447f, 23.34f);
        readonly Vector3 s_IndicationPosition = new Vector3(12.1f, 6f, 11.95f);
        readonly Vector3 s_IndicationAngle = new Vector3(0, -30.74f, 0);
        readonly float s_BossAngle = 148.57f;
        readonly float s_PreciousAngle = -29.531f;
        readonly float s_PreciousEffectAngle = 77f;
        int m_LineId = 0;
@@ -18,11 +26,11 @@
        int m_PreciousEffectNpcId = 0;
        SFXController m_Indication;
        SFXController m_PreciousEffect;
        Clock m_PrepareClock;
        GA_NpcClientFightBoss clientBoss;
        GA_NpcClientCollect clientPrecious;
        GA_NpcClientFightNorm clientPreciousEffect;
        Step m_Step = Step.None;
        Step step
@@ -97,7 +105,7 @@
                case Step.Prepare:
                    break;
                case Step.Fight:
                    if (clientBoss.ActorInfo.serverDie)
                    if (clientBoss != null && clientBoss.ActorInfo.serverDie)
                    {
                        step = Step.Collect;
                    }
@@ -113,8 +121,18 @@
        {
            base.OnStageLoadFinish();
            StartCoroutine(Co_VerityExistBossShow());
            InitializePlayer();
            InitializeNpc();
        }
        private IEnumerator Co_VerityExistBossShow()
        {
            yield return WaitingForSecondConst.WaitMS500;
            if (!BossShowModel.Instance.BossShowing)
            {
                BossShowCompletedEvent();
            }
        }
        public override void UnInitialize()
@@ -123,19 +141,38 @@
            UnloadAssets();
            StopAllCoroutines();
            BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent;
        }
        private void InitializePlayer()
        {
            var hero = PlayerDatas.Instance.hero;
            if (hero != null)
            {
                hero.Pos = s_PlayerPosition;
            }
        }
        private void InitializeNpc()
        {
            clientBoss = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightBoss>((uint)m_BossNpcId, E_ActorGroup.Enemy);
            clientBoss.Pos = s_BossPosition;
            clientBoss.Rotation = Quaternion.Euler(0, s_BossAngle, 0);
            clientPrecious = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>((uint)m_PreciousNpcId, E_ActorGroup.FuncNpc);
            clientPreciousEffect = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightNorm>((uint)m_PreciousEffectNpcId, E_ActorGroup.Enemy);
            clientPrecious.Pos = s_PreciousPosition;
            clientPrecious.Rotation = Quaternion.Euler(0, s_PreciousAngle, 0);
            var npcConfig = NPCConfig.Get(m_PreciousEffectNpcId);
            m_PreciousEffect = SFXPlayUtility.Instance.PlayWithEulerAngle(npcConfig.NPCEffect, s_PreciousEffectPosition
                , new Vector3(0, s_PreciousEffectAngle, 0));
            var animator = m_PreciousEffect.GetComponentInChildren<Animator>(true);
            if (animator != null)
            {
                animator.Play(GAStaticDefine.State_IdleHash);
            }
        }
        void OnEnterPrepare()
@@ -156,16 +193,24 @@
            var seconds = GetStepSeconds(Step.Fight);
            model.UpdateCoolDown(DungeonCoolDownType.FightStart, (uint)seconds * 1000);
            UpdateMissionData();
        }
        void OnExitFight()
        {
            GAMgr.Instance.ServerDie(clientPreciousEffect.ServerInstID);
            var animator = m_PreciousEffect.GetComponentInChildren<Animator>(true);
            if (animator != null)
            {
                animator.Play(GAStaticDefine.State_DeadHash);
            }
        }
        void OnEnterCollect()
        {
            m_Indication = SFXPlayUtility.Instance.PlayWithEulerAngle(1051, s_IndicationPosition, s_IndicationAngle);
            UpdateMissionData();
        }
        int GetStepSeconds(Step step)
@@ -186,15 +231,14 @@
        private void UpdateMissionData()
        {
            //var npcTotal = 0;
            //if(step==Step.)
            //var missionData = new DungeonMissionData()
            //{
            //    lineID = m_LineId,
            //    step = (int)step < (int)Step.Collect ? 1 : 2,
            //    npcTotal = 0,
            //};
            //model.UpdateFakeDungeonMission(ClientHazyPreciousDungeon.DATAMAP, missionData);
            var npcTotal = 0;
            var missionData = new DungeonMissionData()
            {
                lineID = m_LineId,
                step = (int)step < (int)Step.Collect ? 1 : 2,
                npcTotal = npcTotal,
            };
            model.UpdateFakeDungeonMission(ClientHazyPreciousDungeon.DATAMAP, missionData);
        }
        void UnloadAssets()
@@ -224,11 +268,10 @@
                clientPrecious = null;
            }
            if (clientPreciousEffect != null)
            if (m_PreciousEffect != null)
            {
                GAMgr.Instance.ServerDie(clientPreciousEffect.ServerInstID);
                GAMgr.Instance.Release(clientPreciousEffect);
                clientPreciousEffect = null;
                SFXPlayUtility.Instance.Release(m_PreciousEffect);
                m_PreciousEffect = null;
            }
        }
System/HazyRegion/HazyRegionModel.cs
@@ -500,6 +500,7 @@
                    }
                    break;
                case HazyRegionIncidentType.Precious:
                    BossShowModel.Instance.reqDungeonLineId = 0;
                    ClientHazyPreciousDungeon.RequestEnter(id);
                    break;
            }