From 458f4c831623966402f78d1ec00b24aebf674e66 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期三, 12 十二月 2018 09:46:22 +0800
Subject: [PATCH] Merge branch 'master' into Cross_Server
---
Fight/GameActor/PartialModelResConfig.cs | 72 ++++++++++++++++++++++++++++++++++--
1 files changed, 68 insertions(+), 4 deletions(-)
diff --git a/Fight/GameActor/PartialModelResConfig.cs b/Fight/GameActor/PartialModelResConfig.cs
index ad282e3..6ef4ca6 100644
--- a/Fight/GameActor/PartialModelResConfig.cs
+++ b/Fight/GameActor/PartialModelResConfig.cs
@@ -5,7 +5,10 @@
{
public partial class ModelResConfig : ConfigBase, IConfigPostProcess
{
- private static readonly Dictionary<string, ModelResConfig> dict = new Dictionary<string, ModelResConfig>();
+ private static readonly Dictionary<string, ModelResConfig> suitDict = new Dictionary<string, ModelResConfig>();
+ private static readonly Dictionary<string, ModelResConfig> petDict = new Dictionary<string, ModelResConfig>();
+ private static readonly Dictionary<string, ModelResConfig> horseDict = new Dictionary<string, ModelResConfig>();
+ private static readonly Dictionary<string, Dictionary<string, int>> effectDict = new Dictionary<string, Dictionary<string, int>>();
public void OnConfigParseCompleted()
{
@@ -17,15 +20,76 @@
{
_name = _name.Substring(_index + 1);
}
- dict[_name] = this;
+ suitDict[_name] = this;
}
+ else if (Type == (int)E_ModelResType.Horse)
+ {
+ horseDict[ResourcesName] = this;
+ }
+ else if (Type == (int)E_ModelResType.Pet)
+ {
+ petDict[ResourcesName] = this;
+ }
+
+ if (Type == (int)E_ModelResType.Horse
+ || Type == (int)E_ModelResType.Pet)
+ {
+ if (!string.IsNullOrEmpty(boneNameList))
+ {
+ var _bones = boneNameList.Split('|');
+ var _effects = EffFileName.Split('|');
+
+ if (_bones.Length != _effects.Length)
+ {
+ Debug.LogWarningFormat("{0} 绑定骨骼的数量和特效的数量无法对应 {1} != {2}", ID, _bones.Length, _effects.Length);
+ }
+
+ var _dict = new Dictionary<string, int>();
+
+ for (int i = 0; i < _bones.Length && i < _effects.Length; ++i)
+ {
+ _dict[_bones[i]] = int.Parse(_effects[i]);
+
+// Debug.LogFormat("设置特效配置: {0} => {1}", _bones[i], _dict[_bones[i]]);
+ }
+
+ effectDict[ResourcesName] = _dict;
+ }
+ }
+ }
+
+ public static Dictionary<string, int> GetEffectDict(string name)
+ {
+ if (effectDict.ContainsKey(name))
+ {
+ return effectDict[name];
+ }
+ return null;
}
public static ModelResConfig GetClothesConfig(string name)
{
- if(dict.ContainsKey(name))
+ if (suitDict.ContainsKey(name))
{
- return dict[name];
+ return suitDict[name];
+ }
+ return null;
+ }
+
+ public static ModelResConfig GetHorseConfig(string name)
+ {
+ if (horseDict.ContainsKey(name))
+ {
+ return horseDict[name];
+ }
+ return null;
+ }
+
+ public static ModelResConfig GetPetConfig(string name)
+ {
+ if (petDict.ContainsKey(name))
+ {
+ return petDict[name];
}
return null;
}
--
Gitblit v1.8.0