From fc8f110cc6922432ddaccfdf5643dadf9fdce00b Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期六, 24 十一月 2018 15:08:17 +0800
Subject: [PATCH] 4735 子 【1.3】【前端】神兵系统修改 / 【1.3】人物模型的特效展示
---
Fight/GameActor/GActorPlayerBase.cs | 77 ++++++++++++++++++++++++++++++++++++++
1 files changed, 77 insertions(+), 0 deletions(-)
diff --git a/Fight/GameActor/GActorPlayerBase.cs b/Fight/GameActor/GActorPlayerBase.cs
index 5d922c8..7a4b250 100644
--- a/Fight/GameActor/GActorPlayerBase.cs
+++ b/Fight/GameActor/GActorPlayerBase.cs
@@ -327,6 +327,12 @@
}
}
+ foreach (var _effect in m_GodWeaponEffectDict.Values)
+ {
+ SFXPlayUtility.Instance.Release(_effect);
+ }
+ m_GodWeaponEffectDict.Clear();
+
UnloadSuitSFX();
ReleaseLifeBar();
ReleaseName();
@@ -2477,4 +2483,75 @@
}
}
}
+
+ private Dictionary<int, SFXController> m_GodWeaponEffectDict = new Dictionary<int, SFXController>();
+
+ public void SwitchGodWeapon(int type, int level)
+ {
+ bool _showOrHide = true;
+ GodWeaponEffectConfig _config = null;
+ if (level <= 0)
+ {
+ _showOrHide = false;
+ }
+ else
+ {
+ _config = GodWeaponEffectConfig.Get(type, level);
+ if (_config == null)
+ {
+ _showOrHide = false;
+ }
+ }
+
+ SFXController _effect = null;
+
+ if (m_GodWeaponEffectDict.TryGetValue(type, out _effect))
+ {
+ if (_effect)
+ {
+ SFXPlayUtility.Instance.Release(_effect);
+ m_GodWeaponEffectDict.Remove(type);
+ }
+ }
+
+ if (_showOrHide)
+ {
+ Transform _bindBone = null;
+ switch (type)
+ {
+ case 1:
+ if (m_ClothesModel)
+ {
+ _bindBone = m_ClothesModel.transform.GetChildTransformDeeply("Bip001 Spine");
+ }
+ break;
+ case 2:
+ if (m_WeaponModel != null)
+ {
+ _bindBone = m_WeaponModel.transform;
+ }
+ break;
+ case 3:
+ if (m_SecondaryModel != null)
+ {
+ _bindBone = m_SecondaryModel.transform;
+ }
+ break;
+ case 4:
+ if (m_ClothesModel != null)
+ {
+ _bindBone = m_ClothesModel.transform.GetChildTransformDeeply("Bip001 Neck");
+ }
+ break;
+ }
+
+ if (_bindBone)
+ {
+ var _effectJson = LitJson.JsonMapper.ToObject(_config.effect);
+ var _effectID = int.Parse(_effectJson[JobSetup.Job.ToString()].ToString());
+ _effect = SFXPlayUtility.Instance.PlayBattleEffect(_effectID, _bindBone);
+ m_GodWeaponEffectDict[type] = _effect;
+ }
+ }
+ }
}
--
Gitblit v1.8.0