From ee621c2f4093b435ac08a5ef4449fc2750a892da Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期六, 13 十月 2018 11:47:07 +0800
Subject: [PATCH] 3727 【前端】Npc读取待机动作2号

---
 UI/Common/UI3DModelFactory.cs |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/UI/Common/UI3DModelFactory.cs b/UI/Common/UI3DModelFactory.cs
index c21fdd0..ec3b410 100644
--- a/UI/Common/UI3DModelFactory.cs
+++ b/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);

--
Gitblit v1.8.0