少年修仙传客户端代码仓库
client_Wu Xijin
2018-10-13 ee621c2f4093b435ac08a5ef4449fc2750a892da
3727 【前端】Npc读取待机动作2号
1个文件已修改
32 ■■■■■ 已修改文件
UI/Common/UI3DModelFactory.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI/Common/UI3DModelFactory.cs
@@ -82,9 +82,37 @@
        var animator = model.GetComponent<Animator>();
        if (animator != null)
        {
            var isDance = false;
            if (config.NPCType == (int)E_NpcType.Func)
            {
                var suffix = AnimatorControllerLoader.controllerUISuffix;
                var animatorController = AnimatorControllerLoader.LoadMobController(suffix, config.MODE);
                if (animatorController != null)
                {
                    animator.runtimeAnimatorController = animatorController;
                }
                var clipInfos = animator.runtimeAnimatorController.animationClips;
                foreach (var item in clipInfos)
                {
                    if (item.name == "Idle2")
                    {
                        isDance = true;
                        break;
                    }
                }
            }
            animator.enabled = true;
            animator.SetInteger(GAStaticDefine.Param_Action, GAStaticDefine.Act_Idle);
            animator.Play(GAStaticDefine.State_IdleHash);
            if (isDance)
            {
                animator.Play(GAStaticDefine.State_Dance);
            }
            else
            {
                animator.SetInteger(GAStaticDefine.Param_Action, GAStaticDefine.Act_Idle);
                animator.Play(GAStaticDefine.State_IdleHash);
            }
        }
        LayerUtility.SetLayer(model, LayerUtility.Monster, true);