From 54fad068f41ba7b0d2f16699a3f774be2a0d84e9 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 14 二月 2019 12:02:50 +0800
Subject: [PATCH] 3335 配置表读取重构。
---
Assets/Editor/Actor/ResourcesBuilder.cs | 111 ++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 77 insertions(+), 34 deletions(-)
diff --git a/Assets/Editor/Actor/ResourcesBuilder.cs b/Assets/Editor/Actor/ResourcesBuilder.cs
index 7532bc0..acec95b 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,6 +107,25 @@
}
}
+ 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, string outName = null, bool isHighMesh = false)
@@ -115,18 +135,22 @@
outName = 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);
+ 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 (!suffix.Equals(InstanceResourcesLoader.raceSuffix))
+ if ((resName.StartsWith("A_Zs") || resName.StartsWith("A_Fs"))
+ && !isHighMesh
+ && (suffix.Equals(InstanceResourcesLoader.raceSuffix) || suffix.Equals(InstanceResourcesLoader.handSuffix)))
{
- _absOriginalePath = string.Format("{0}/ART/Role/{1}/{2}.FBX", Application.dataPath, path, resName);
- _originalAssetPath = string.Format("Assets/ART/Role/{0}/{1}.FBX", path, resName);
+ _absOriginalePath = string.Format("{0}/ART/Role/{1}/{2}_Dm.FBX", Application.dataPath, path, resName);
+ _originalAssetPath = string.Format("Assets/ART/Role/{0}/{1}_Dm.FBX", path, resName);
}
string _tempPrefabName = outName;
- if (isHighMesh && suffix.Equals(InstanceResourcesLoader.raceSuffix))
+ if (isHighMesh
+ && ((resName.StartsWith("A_Zs") || resName.StartsWith("A_Fs"))
+ && (suffix.Equals(InstanceResourcesLoader.raceSuffix) || suffix.Equals(InstanceResourcesLoader.handSuffix))))
{
_tempPrefabName += "_UI";
@@ -270,17 +294,17 @@
}
// 鍔犺浇鐗规晥
- if (outName.StartsWith("M")
- || outName.StartsWith("N")
- || outName.StartsWith("B_")
- || outName.StartsWith("Zq"))
- {
- HandlerModelEffect("horseEffectConfig", null, outName, ref _prefab);
- }
- else if (InstanceResourcesLoader.raceSuffix.Equals(suffix))
- {
- HandlerModelEffect("clothesEffectConfig", path, resName, ref _prefab);
- }
+ //if (outName.StartsWith("M")
+ // || outName.StartsWith("N")
+ // || outName.StartsWith("B_")
+ // || outName.StartsWith("Zq"))
+ //{
+ // HandlerModelEffect("horseEffectConfig", null, outName, ref _prefab);
+ //}
+ //else if (InstanceResourcesLoader.raceSuffix.Equals(suffix))
+ //{
+ // HandlerModelEffect("clothesEffectConfig", path, resName, ref _prefab);
+ //}
if (_colliderInfo != null)
{
@@ -292,7 +316,10 @@
string _tempName = resName;
- if (suffix.Equals(InstanceResourcesLoader.raceSuffix) && !isHighMesh)
+ if ((resName.StartsWith("A_Zs") || resName.StartsWith("A_Fs"))
+ && (suffix.Equals(InstanceResourcesLoader.raceSuffix)
+ || suffix.Equals(InstanceResourcesLoader.handSuffix))
+ && !isHighMesh)
{
_tempName += "_Dm";
}
@@ -306,7 +333,7 @@
Renderer _renderer = _rendererNode.GetComponent<Renderer>();
if (_renderer)
{
- OnSetupRenderer(path, resName, ref _renderer);
+ OnSetupRenderer(path, _tempName, ref _renderer);
}
Animation _animation = _prefab.GetComponent<Animation>();
@@ -315,18 +342,26 @@
Object.DestroyImmediate(_animation);
}
- Animator _animator = _prefab.GetComponent<Animator>();
-
- if (!_animator)
+ if (suffix.Equals(InstanceResourcesLoader.raceSuffix)
+ || suffix.Equals(InstanceResourcesLoader.horseSuffix)
+ || suffix.Equals(InstanceResourcesLoader.wingSuffix))
{
- _animator = _prefab.AddComponent<Animator>();
- }
+ Animator _animator = _prefab.GetComponent<Animator>();
- // 缁戝畾鍔ㄧ敾鎺у埗鍣�
- RuntimeAnimatorController _runtimeAnimatorContorller = AssetDatabase.LoadAssetAtPath<RuntimeAnimatorController>(_acAssetPath);
- if (_runtimeAnimatorContorller)
- {
- _animator.runtimeAnimatorController = _runtimeAnimatorContorller;
+ if (!_animator)
+ {
+ _animator = _prefab.AddComponent<Animator>();
+ }
+
+ if (suffix.Equals(InstanceResourcesLoader.wingSuffix))
+ {
+ // 缁戝畾鍔ㄧ敾鎺у埗鍣�
+ RuntimeAnimatorController _runtimeAnimatorContorller = AssetDatabase.LoadAssetAtPath<RuntimeAnimatorController>(_acAssetPath);
+ if (_runtimeAnimatorContorller)
+ {
+ _animator.runtimeAnimatorController = _runtimeAnimatorContorller;
+ }
+ }
}
PrefabUtility.CreatePrefab(_assetPath, _prefab, ReplacePrefabOptions.Default);
@@ -412,7 +447,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);
}
}
@@ -534,26 +569,34 @@
outName = resName;
}
- string _absAssetPath = string.Format("{0}Mob/{1}", ResourcesPath.ResourcesOutPath, 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, outName);
+ _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, outName);
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))
@@ -596,7 +639,7 @@
EditorUtility.SetDirty(_animatorController);
AssetImporter _assetImport = AssetImporter.GetAtPath(_assetPath);
- _assetImport.assetBundleName = ResourcesPath.MOB_FOLDER_NAME + ResourcesPath.MOB_SUFFIX + resName;
+ _assetImport.assetBundleName = ResourcesPath.MOB_FOLDER_NAME + ResourcesPath.MOB_SUFFIX + outName;
EditorUtility.ClearProgressBar();
--
Gitblit v1.8.0