少年修仙传客户端代码仓库
client_linchunjie
2018-08-20 b78c5de93222addd09a9c5a09900ab7c1a58fff5
2030【前端】境界功能界面修改
3个文件已修改
87 ■■■■ 已修改文件
Core/GameEngine/Model/ConfigManager.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/ResModule/AnimatorControllerLoader.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Realm/RealmUpWin.cs 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/ConfigManager.cs
@@ -245,6 +245,7 @@
        StartSyncTask<IconConfig>(AssetPath.ResourceOut);
        StartSyncTask<SysInfoConfig>(AssetPath.ResourceOut);
        StartSyncTask<LanguageConfig>(AssetPath.ResourceOut);
        StartSyncTask<RealmConfig>(AssetPath.ResourceOut);
    }
    public bool AllCompleted()
Core/ResModule/AnimatorControllerLoader.cs
@@ -11,6 +11,7 @@
    public static readonly string controllerSuffix = "AnimatorController_";
    public static readonly string controllerUISuffix = "AnimatorController_UI_";
    public static readonly string controllerShowSuffix = "AnimatorController_Show_";
    public static readonly string controllerRealmSuffix = "AnimatorController_Realm_";
    public static AnimationClip LoadAnimationClip(string name, string clipName)
    {
System/Realm/RealmUpWin.cs
@@ -40,7 +40,6 @@
        [SerializeField] RealmProgressBehaviour m_RealmProgress;
        [SerializeField] UIEffect m_RealmDungeonSfx;
        [SerializeField] UIEffect m_GetRealmPointSfx;
        [SerializeField] Button m_FuncButton;
        [SerializeField] Text m_FuncButtonTxt;
@@ -55,8 +54,13 @@
        [SerializeField, Header("模型位置")] Vector3[] m_ModelPositions;
        [SerializeField, Header("当前境界位置")] Vector3[] m_RealmNowPositions;
        [SerializeField, Header("下一境界位置")] Vector3[] m_RealmNextwPositions;
        [SerializeField, Header("Boss位置")] Vector3[] m_BossPositions;
        int cacheRealmPoint = 0;
        Coroutine cacheCoroutine = null;
        RuntimeAnimatorController cacheController = null;
        const string State_EnterHash = "Show";
        const string State_IdleHash = "Idle";
        RealmModel realmModel { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
@@ -78,6 +82,18 @@
            Display();
        }
        protected override void OnActived()
        {
            base.OnActived();
            if (realmModel.realmDungeonState)
            {
                m_RawPlayer.gameObject.SetActive(true);
                StopBoss();
                m_RawBoss.gameObject.SetActive(false);
                UI3DModelExhibition.Instance.BeginShowSitDownPlayer(m_RawPlayer, PlayerDatas.Instance.baseData.Job);
            }
        }
        protected override void OnAfterOpen()
        {
            HandleAchievement();
@@ -91,6 +107,7 @@
            if (realmModel.realmDungeonState)
            {
                m_RealmDungeonSfx.Play();
                StartCoroutine(Co_DisplayBossShow());
            }
            realmModel.realmDungeonState = false;
        }
@@ -99,9 +116,14 @@
        {
            PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
            WindowCenter.Instance.windowAfterCloseEvent -= WindowAfterCloseEvent;
            UI3DModelExhibition.Instance.StopShowNPC();
            StopBoss();
            UI3DModelExhibition.Instance.StopShowPlayer();
            realmModel.realmDungeonState = false;
            if (cacheCoroutine != null)
            {
                StopCoroutine(cacheCoroutine);
                cacheCoroutine = null;
            }
        }
        protected override void OnAfterClose()
@@ -117,10 +139,21 @@
        }
        #endregion
        IEnumerator Co_DisplayBossShow()
        {
            yield return WaitingForSecondConst.WaitMS800;
            UI3DModelExhibition.Instance.StopShowPlayer();
            m_RawPlayer.gameObject.SetActive(false);
            m_RawBoss.gameObject.SetActive(true);
            var config = ConfigManager.Instance.GetTemplate<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
            StartBoss(config, true);
        }
        private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
        {
            if (refreshType == PlayerDataRefresh.OfficialRank)
            {
                StopBoss();
                DisplayRealmNow();
                DisplayRealmNext();
                DisplayModel();
@@ -135,10 +168,6 @@
                DisplayModel();
                DisplayButton();
                if (PlayerDatas.Instance.extersion.realmPoint >= cacheRealmPoint)
                {
                    DisplayGetRealmPointSfx();
                }
                cacheRealmPoint = PlayerDatas.Instance.extersion.realmPoint;
            }
        }
@@ -236,8 +265,8 @@
            if (realmModel.IsRealmHighest || _realmPoint < config.NeedPoint)
            {
                m_RawPlayer.gameObject.SetActive(true);
                StopBoss();
                m_RawBoss.gameObject.SetActive(false);
                UI3DModelExhibition.Instance.StopShowNPC();
                UI3DModelExhibition.Instance.BeginShowSitDownPlayer(m_RawPlayer, PlayerDatas.Instance.baseData.Job);
            }
            else if (_realmPoint >= config.NeedGood)
@@ -245,7 +274,41 @@
                m_RawBoss.gameObject.SetActive(true);
                m_RawPlayer.gameObject.SetActive(false);
                UI3DModelExhibition.Instance.StopShowPlayer();
                StartBoss(config);
            }
        }
        private void StopBoss()
        {
            var npcModel = UI3DModelExhibition.Instance.NpcModelPet;
            if (npcModel != null && m_RawBoss.gameObject.activeSelf)
            {
                var animator = npcModel.GetComponentInChildren<Animator>();
                if (animator != null && cacheController != null)
                {
                    animator.runtimeAnimatorController = cacheController;
                }
            }
            UI3DModelExhibition.Instance.StopShowNPC();
        }
        private void StartBoss(RealmConfig config, bool act = false)
        {
            UI3DModelExhibition.Instance.StopShowPlayer();
                UI3DModelExhibition.Instance.BeginShowNPC(config.BossID, config.IsBigRealm == 1 ? Vector3.zero : direction, m_RawBoss, false);
            var npcConfig = ConfigManager.Instance.GetTemplate<NPCConfig>(config.BossID);
            var npcModel = UI3DModelExhibition.Instance.NpcModelPet;
            m_RawBoss.transform.localPosition = config.IsBigRealm == 1 ? m_BossPositions[1] : m_BossPositions[0];
            if (npcModel != null)
            {
                var animator = npcModel.GetComponentInChildren<Animator>();
                if (animator != null)
                {
                    cacheController = animator.runtimeAnimatorController;
                    var runtimeController = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerRealmSuffix, npcConfig.MODE);
                    animator.runtimeAnimatorController = runtimeController;
                    animator.Play(act ? State_EnterHash : State_IdleHash, 0);
                }
            }
        }
@@ -271,14 +334,6 @@
            else
            {
                m_FuncButtonTxt.text = Language.Get("RealmWin_Bewrite_1");
            }
        }
        void DisplayGetRealmPointSfx()
        {
            if (m_GetRealmPointSfx != null)
            {
                m_GetRealmPointSfx.Play();
            }
        }