From 6f8ed2e37f8762fb3501a671d0dca40bcd68edae Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期日, 21 十月 2018 10:26:29 +0800
Subject: [PATCH] Merge branch 'master' into leonard

---
 Assets/Editor/Actor/ResourcesBuilder.cs |  108 ++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 93 insertions(+), 15 deletions(-)

diff --git a/Assets/Editor/Actor/ResourcesBuilder.cs b/Assets/Editor/Actor/ResourcesBuilder.cs
index 0942768..2740cb2 100644
--- a/Assets/Editor/Actor/ResourcesBuilder.cs
+++ b/Assets/Editor/Actor/ResourcesBuilder.cs
@@ -10,6 +10,7 @@
     protected const byte param_Prefab = 2;
     protected const byte param_Clip = 4;
     protected const byte param_AnimatorController = 8;
+    protected const byte param_AnimatorUIController = 16;
 
     protected class MountPointInfo
     {
@@ -106,18 +107,67 @@
         }
     }
 
+    public static bool IsBuildAnimatorUIController
+    {
+        get
+        {
+            return (buildParams & param_AnimatorUIController) != 0;
+        }
+        set
+        {
+            if (value)
+            {
+                buildParams |= param_AnimatorUIController;
+            }
+            else
+            {
+                buildParams &= ~param_AnimatorUIController;
+            }
+        }
+    }
+
     protected static List<MountPointInfo> m_MountPointInfoList = new List<MountPointInfo>();
 
-    public void BuildPrefab(string path, string resName, string suffix)
+    public void BuildPrefab(string path, string resName, string suffix, string outName = null, bool isHighMesh = false)
     {
-        string _absOriginalePath = string.Format("{0}/ART/Role/{1}/{2}.FBX", Application.dataPath, path, resName);
-        string _originalAssetPath = string.Format("Assets/ART/Role/{0}/{1}.FBX", path, resName);
+        if (string.IsNullOrEmpty(outName))
+        {
+            outName = resName;
+        }
 
-        string _absAssetPath = string.Format("{0}Mob/{1}{2}.prefab", ResourcesPath.ResourcesOutPath, suffix, resName);
-        string _assetPath = string.Format("{0}Mob/{1}{2}.prefab", ResourcesPath.ResourcesOutAssetPath, suffix, resName);
+        string _absOriginalePath = string.Format("{0}/ART/Role/{1}/{2}_Dm.FBX", Application.dataPath, path, resName);
+        string _originalAssetPath = string.Format("Assets/ART/Role/{0}/{1}_Dm.FBX", path, resName);
+
+        if ((!resName.StartsWith("A_Zs") && !resName.StartsWith("A_Fs"))
+          || !suffix.Equals(InstanceResourcesLoader.raceSuffix))
+        {
+            _absOriginalePath = string.Format("{0}/ART/Role/{1}/{2}.FBX", Application.dataPath, path, resName);
+            _originalAssetPath = string.Format("Assets/ART/Role/{0}/{1}.FBX", path, resName);
+        }
+
+        string _tempPrefabName = outName;
+
+        if (isHighMesh
+        && ((!resName.StartsWith("A_Zs") && !resName.StartsWith("A_Fs"))
+            || !suffix.Equals(InstanceResourcesLoader.raceSuffix)))
+        {
+            _tempPrefabName += "_UI";
+
+            _absOriginalePath = string.Format("{0}/ART/Role/{1}/{2}.FBX", Application.dataPath, path, resName);
+            _originalAssetPath = string.Format("Assets/ART/Role/{0}/{1}.FBX", path, resName);
+        }
+
+        string _absAssetPath = string.Format("{0}Mob/{1}{2}.prefab", ResourcesPath.ResourcesOutPath, suffix, _tempPrefabName);
+        string _assetPath = string.Format("{0}Mob/{1}{2}.prefab", ResourcesPath.ResourcesOutAssetPath, suffix, _tempPrefabName);
 
         string _acAbsAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, path, AnimatorControllerLoader.controllerSuffix, path);
         string _acAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, path, AnimatorControllerLoader.controllerSuffix, path);
+
+        if (!outName.Equals(resName))
+        {
+            _acAbsAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, path, AnimatorControllerLoader.controllerSuffix, outName);
+            _acAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, path, AnimatorControllerLoader.controllerSuffix, outName);
+        }
 
         if (string.IsNullOrEmpty(_absOriginalePath))
         {
@@ -127,7 +177,7 @@
         // 鎸囧畾鍔ㄧ敾鎺у埗鍣�
         if (!File.Exists(_acAbsAssetPath))
         {
-            Debug.LogWarningFormat("妫�娴嬪埌姝refab璧勬簮: {0} 鐨凙nimatorContorller(鍔ㄧ敾鎺у埗鍣�)璧勬簮灏氭湭鐢熸垚, 杩欓噷闇�瑕佹敞鎰忓晩姝よ祫婧愭槸鍚﹂渶瑕佸厛鐢熸垚AnimatorContorller(鍔ㄧ敾鎺у埗鍣�), 鍐嶇敓鎴恜refab璧勬簮.", path);
+            Debug.LogWarningFormat("妫�娴嬪埌姝refab璧勬簮: {0} 鐨凙nimatorContorller(鍔ㄧ敾鎺у埗鍣�)璧勬簮灏氭湭鐢熸垚, 杩欓噷闇�瑕佹敞鎰忓晩姝よ祫婧愭槸鍚﹂渶瑕佸厛鐢熸垚AnimatorContorller(鍔ㄧ敾鎺у埗鍣�), 鍐嶇敓鎴恜refab璧勬簮.", _acAssetPath);
         }
 
         ColliderInfo _colliderInfo = null;
@@ -243,10 +293,12 @@
         }
 
         // 鍔犺浇鐗规晥
-        if (InstanceResourcesLoader.horseSuffix.Equals(suffix)
-         || resName.Contains("B_Cw"))
+        if (outName.StartsWith("M")
+         || outName.StartsWith("N")
+         || outName.StartsWith("B_")
+         || outName.StartsWith("Zq"))
         {
-            HandlerModelEffect("horseEffectConfig", null, resName, ref _prefab);
+            HandlerModelEffect("horseEffectConfig", null, outName, ref _prefab);
         }
         else if (InstanceResourcesLoader.raceSuffix.Equals(suffix))
         {
@@ -261,7 +313,15 @@
             _collider.height = _colliderInfo.height;
         }
 
-        Transform _rendererNode = _prefab.transform.Find(resName);
+        string _tempName = resName;
+
+        if ((resName.StartsWith("A_Zs") || resName.StartsWith("A_Fs"))
+            && suffix.Equals(InstanceResourcesLoader.raceSuffix) && !isHighMesh)
+        {
+            _tempName += "_Dm";
+        }
+
+        Transform _rendererNode = _prefab.transform.Find(_tempName);
         if (!_rendererNode)
         {
             _rendererNode = _prefab.transform;
@@ -376,7 +436,7 @@
             _effect = Object.Instantiate(_effect);
             _effect.name = _effect.name.Replace("(Clone)", "");
             _effect.transform.SetParentEx(_parent, Vector3.zero, Quaternion.identity, Vector3.one);
-            _effect.SetLayer(LayerUtility.BattleEffect, true);
+            _effect.SetLayer(LayerUtility.BattleEffectLow, true);
         }
     }
 
@@ -491,23 +551,41 @@
         AssetDatabase.Refresh();
     }
 
-    public static void BuildAnimatorController(string resName, string templeName, string configName)
+    public static void BuildAnimatorController(string resName, string templeName, string configName, string outName = null)
     {
-        string _absAssetPath = string.Format("{0}Mob/{1}", ResourcesPath.ResourcesOutPath, resName);
+        if (string.IsNullOrEmpty(outName))
+        {
+            outName = resName;
+        }
+
+        string _absAssetPath = string.Format("{0}Mob/{1}", ResourcesPath.ResourcesOutPath, outName);
 
         if (!Directory.Exists(_absAssetPath))
         {
             Directory.CreateDirectory(_absAssetPath);
         }
 
-        _absAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, resName, AnimatorControllerLoader.controllerSuffix, resName);
+        _absAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, outName, AnimatorControllerLoader.controllerSuffix, outName);
+        string _assetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, outName, AnimatorControllerLoader.controllerSuffix, outName);
 
-        string _assetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, resName, AnimatorControllerLoader.controllerSuffix, resName);
         if (templeName.Equals("Temple_AnimatorController_BossShow"))
         {
             _absAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, resName, AnimatorControllerLoader.controllerShowSuffix, resName);
             _assetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, resName, AnimatorControllerLoader.controllerShowSuffix, resName);
         }
+
+        if (templeName.Equals("Temple_AnimatorController_Realm"))
+        {
+            _absAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, resName, AnimatorControllerLoader.controllerRealmSuffix, resName);
+            _assetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, resName, AnimatorControllerLoader.controllerRealmSuffix, resName);
+        }
+
+        if(templeName.Equals("Temple_AnimatorController_UI"))
+        {
+            _absAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, outName, AnimatorControllerLoader.controllerUISuffix, outName);
+            _assetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, outName, AnimatorControllerLoader.controllerUISuffix, outName);
+        }
+
         string _templePath = string.Format("{0}Mob/{1}.controller", ResourcesPath.ResourcesOutPath, templeName);
 
         if (File.Exists(_absAssetPath))

--
Gitblit v1.8.0