Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | |
| | | if (_player != null) |
| | | { |
| | | byte _suitLevel = 0; |
| | | var _equipInfo = new GActorPlayerBase.EquipInfo(); |
| | | _equipInfo.place = vNetData.EquipIndex; |
| | | _equipInfo.itemID = vNetData.EquipID; |
| | | |
| | | if (vNetData.UserDataLen > 2) |
| | | { |
| | | Dictionary<int, List<int>> _userDataDict = ConfigParse.Analysis(vNetData.UserData); |
| | | if (_userDataDict.ContainsKey(30)) |
| | | if (_userDataDict.ContainsKey(25)) |
| | | { |
| | | _suitLevel = (byte)_userDataDict[30][0]; |
| | | _equipInfo.suitLV_1 = (byte)_userDataDict[25][0]; |
| | | _equipInfo.suitLV_2 = (byte)_userDataDict[25][1]; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | _player.ChangeEquip(vNetData.EquipIndex, vNetData.EquipID, _suitLevel); |
| | | if (vNetData.EquipIndex == (int)RoleEquipType.retClothes |
| | | || vNetData.EquipIndex == (int)RoleEquipType.retHat |
| | | || vNetData.EquipIndex == (int)RoleEquipType.retShoes |
| | | || vNetData.EquipIndex == (int)RoleEquipType.retTrousers |
| | | || vNetData.EquipIndex == (int)RoleEquipType.retBelt) |
| | | { |
| | | |
| | | _player.ChangeEquip(_equipInfo); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | || vNetData.EquipIndex == (int)RoleEquipType.retTrousers |
| | | || vNetData.EquipIndex == (int)RoleEquipType.retBelt) |
| | | { |
| | | _player.UnloadSuitSFX(); |
| | | var _equipInfo = new GActorPlayerBase.EquipInfo |
| | | { |
| | | place = vNetData.EquipIndex, |
| | | itemID = 0, |
| | | suitLV_1 = 0, |
| | | suitLV_2 = 0 |
| | | }; |
| | | // 脱下衣服 |
| | | _player.ChangeEquip(_equipInfo); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (PlayerDatas.Instance.hero != null |
| | | && vNetData.Result == 1) |
| | | { |
| | | // 这里处理套装合成的时候同步套装特效的逻辑 |
| | | int _start = (int)RoleEquipType.retHat; |
| | | int _end = (int)RoleEquipType.retShoes; |
| | | |
| | | PlayerPackModel _packModel = ModelCenter.Instance.GetModel<PlayerPackModel>(); |
| | | SinglePackModel _equipModel = _packModel.GetSinglePackModel(PackType.rptEquip); |
| | | ItemModel _itemModel = null; |
| | | int _suitLevel = 0; |
| | | for (int i = _start; i <= _end; ++i) |
| | | { |
| | | _itemModel = _equipModel.GetItemModelByIndex(i); |
| | | if (_itemModel != null) |
| | | { |
| | | if (_itemModel.itemInfo.IsSuite == 1) |
| | | { |
| | | _suitLevel = 0; |
| | | _suitLevel = (byte)_itemModel.useDataDict[30][0]; |
| | | PlayerDatas.Instance.hero.ChangeEquip(i, (uint)_itemModel.itemInfo.ItemID, _suitLevel); |
| | | } |
| | | } |
| | | } |
| | | PlayerDatas.Instance.hero.ChangeEquip(default(GActorPlayerBase.EquipInfo)); |
| | | } |
| | | } |
| | | |
| | |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | | if (_hero != null) |
| | | { |
| | | _hero.ChangeEquip(0, 0, 0); |
| | | _hero.ChangeEquip(default(GActorPlayerBase.EquipInfo)); |
| | | } |
| | | } |
| | | |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class MaterialLoader |
| | | { |
| | | |
| | | public static Material Load(string modelName, string materialName) |
| | | { |
| | | |
| | | string _bundleName = StringUtility.Contact(ResourcesPath.MOB_FOLDER_NAME, |
| | | ResourcesPath.MOB_SUFFIX, |
| | | modelName); |
| | | |
| | | string _assetName = materialName; |
| | | |
| | | AssetInfo _assetInfo = new AssetInfo(_bundleName, _assetName); |
| | | |
| | | Material _controller = AssetBundleUtility.Instance.Sync_LoadAsset(_assetInfo) as Material; |
| | | |
| | | if (_controller == null) |
| | | { |
| | | DebugEx.LogErrorFormat("MaterialLoader.Load() => 加载不到资源: {0}.", _assetName); |
| | | } |
| | | |
| | | return _controller; |
| | | |
| | | } |
| | | readonly static Dictionary<string, ObjectPool<Material>> s_MatDict = new Dictionary<string, ObjectPool<Material>>(); |
| | | |
| | | public static Material LoadClothesMaterial(int id, bool isUI, bool isSuit) |
| | | { |
| | |
| | | return null; |
| | | } |
| | | |
| | | //Debug.LogFormat("想要加载的材质的名称: {0}", _assetName); |
| | | |
| | | ObjectPool<Material> _pool = null; |
| | | |
| | | if (s_MatDict.TryGetValue(_assetName, out _pool)) |
| | | { |
| | | if (_pool.inactivedCount > 0) |
| | | { |
| | | //Debug.Log(" |-- 池里有, 从池里取"); |
| | | return _pool.Get(); |
| | | } |
| | | } |
| | | |
| | | string _name = _modelResConfig.ResourcesName; |
| | | int _index = _name.IndexOf('/'); |
| | | if (_index != -1) |
| | |
| | | _name = _name.Substring(_index + 1); |
| | | } |
| | | |
| | | var _parentDirName = string.Empty; |
| | | |
| | | if (_name.Contains("A_Zs")) |
| | | { |
| | | _name = "A_Zs"; |
| | | _parentDirName = "A_Zs"; |
| | | } |
| | | else if (_name.Contains("A_Fs")) |
| | | { |
| | | _name = "A_Fs"; |
| | | _parentDirName = "A_Fs"; |
| | | } |
| | | |
| | | Material _mat = null; |
| | |
| | | #if UNITY_EDITOR |
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | | "Mob/", |
| | | _name, |
| | | _parentDirName, |
| | | "/Materials/", |
| | | _assetName, |
| | | ".mat"); |
| | |
| | | } |
| | | else |
| | | { |
| | | string _bundleName = StringUtility.Contact(ResourcesPath.MOB_FOLDER_NAME, _name.ToLower(), "_materials"); |
| | | string _bundleName = StringUtility.Contact(ResourcesPath.MOB_FOLDER_NAME, InstanceResourcesLoader.raceSuffix, _name.ToLower()); |
| | | AssetInfo _assetInfo = new AssetInfo(_bundleName, _assetName); |
| | | _mat = AssetBundleUtility.Instance.Sync_LoadAsset(_assetInfo) as Material; |
| | | } |
| | | |
| | | if (_mat == null) |
| | | { |
| | | DebugEx.LogErrorFormat("MaterialLoader.Load() => 加载不到资源: {0}.", _assetName); |
| | | DebugEx.LogErrorFormat("MaterialLoader.Load() => 加载不到资源: {0}", _assetName); |
| | | } |
| | | |
| | | return _mat; |
| | | } |
| | | |
| | | public static void Release(Material mat) |
| | | { |
| | | if (!mat) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var _name = mat.name.Replace(" (Instance)", ""); |
| | | //Debug.LogFormat("要释放的材质的名称: {0}, 修改后的名称: {1}", mat.name, _name); |
| | | |
| | | ObjectPool<Material> _pool = null; |
| | | |
| | | if (!s_MatDict.TryGetValue(_name, out _pool)) |
| | | { |
| | | _pool = new ObjectPool<Material>(null, null); |
| | | s_MatDict.Add(_name, _pool); |
| | | } |
| | | |
| | | _pool.Add(mat); |
| | | } |
| | | } |
| | |
| | |
|
| | | public void UnInit()
|
| | | {
|
| | | ClearOffLinePlayer();
|
| | |
|
| | | if (PreFightMission.Instance.IsFinished())
|
| | | {
|
| | | for (int i = m_AllList.Count - 1; i >= 0; --i)
|
| | |
| | | m_LastSyncTickTime = Time.realtimeSinceStartup;
|
| | | }
|
| | |
|
| | | private PlayerSuitModel _suitModel;
|
| | | private PlayerSuitModel SuitModel
|
| | | {
|
| | | get { return _suitModel ?? (_suitModel = ModelCenter.Instance.GetModel<PlayerSuitModel>()); }
|
| | | }
|
| | |
|
| | | private PlayerPackModel m_PlayerBackModel;
|
| | | private PlayerPackModel PlayerBackModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_PlayerBackModel ?? (m_PlayerBackModel = ModelCenter.Instance.GetModel<PlayerPackModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | public override void ChangeEquip(EquipInfo equipInfo)
|
| | | {
|
| | | var _equipModel = PlayerBackModel.GetSinglePackModel(PackType.rptEquip);
|
| | |
|
| | | var _suitCount = 0;
|
| | |
|
| | | int _start = (int)RoleEquipType.retHat;
|
| | | int _end = (int)RoleEquipType.retShoes;
|
| | | int _rank = 0;
|
| | |
|
| | | ItemModel _itemModel = null;
|
| | |
|
| | | // 先取得衣服的阶数
|
| | | _itemModel = _equipModel.GetItemModelByIndex((int)RoleEquipType.retClothes);
|
| | | if (_itemModel == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | _rank = _itemModel.chinItemModel.LV;
|
| | |
|
| | | for (int i = _start; i <= _end; ++i)
|
| | | {
|
| | | _itemModel = _equipModel.GetItemModelByIndex(i);
|
| | |
|
| | | if (_itemModel == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (_itemModel.chinItemModel.SuiteiD <= 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (SuitModel.suitModelDict.ContainsKey(i))
|
| | | {
|
| | | if (SuitModel.suitModelDict[i].ContainsKey(1)
|
| | | || SuitModel.suitModelDict[i].ContainsKey(2))
|
| | | {
|
| | | if (_itemModel.chinItemModel.LV >= _rank)
|
| | | {
|
| | | _suitCount += 1;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (m_SuitCount == _suitCount)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (m_SuitCount < 5 && _suitCount < 5)
|
| | | {
|
| | | m_SuitCount = _suitCount;
|
| | | return;
|
| | | }
|
| | |
|
| | | if (_suitCount == 5)
|
| | | {
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>((int)ClothesItemID);
|
| | | if (_itemConfig != null)
|
| | | {
|
| | | var _newMat = MaterialLoader.LoadClothesMaterial(_itemConfig.ChangeOrd, false, true);
|
| | | if (_newMat)
|
| | | {
|
| | | m_SMRenderer.material = m_Material = _newMat;
|
| | | MaterialUtility.SwitchXrayShader(m_SMRenderer.material, this is GA_Hero);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>((int)ClothesItemID);
|
| | | if (_itemConfig != null)
|
| | | {
|
| | | var _newMat = MaterialLoader.LoadClothesMaterial(_itemConfig.ChangeOrd, false, false);
|
| | | if (_newMat)
|
| | | {
|
| | | m_SMRenderer.material = m_Material = _newMat;
|
| | | MaterialUtility.SwitchXrayShader(m_SMRenderer.material, this is GA_Hero);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | m_SuitCount = _suitCount;
|
| | | }
|
| | | |
| | | protected sealed override void OnUnit()
|
| | | {
|
| | | Object.Destroy(m_BhvFindEnemy);
|
| | |
| | | && !IsStun()
|
| | | && !IsHurt()
|
| | | && !IsDaZuo()
|
| | | && !IsCollect()
|
| | | && State != E_ActorState.Roll
|
| | | && State != E_ActorState.Mocked
|
| | | && !s_MapSwitching
|
| | |
| | | {
|
| | | yield break;
|
| | | }
|
| | | yield return WaitingForSecondConst.WaitMS1500; |
| | | yield return WaitingForSecondConst.WaitMS1500;
|
| | | if (PlayerDatas.Instance.extersion.bossState == 1)
|
| | | {
|
| | | yield break;
|
| | |
| | | } |
| | | } |
| | | |
| | | public override void ChangeEquip(EquipInfo equipInfo) |
| | | { |
| | | } |
| | | |
| | | public void SyncHelpPlayerInfo() |
| | | { |
| | | var _valueInfo = LocalSave.GetString("GA_NpcFightZZPlayer_" + m_H0406.ObjID); |
| | |
| | |
|
| | | private int m_ComAtkIndex;// 普攻索引
|
| | |
|
| | | protected Dictionary<int, EquipInfo> m_EquipDict = new Dictionary<int, EquipInfo>();
|
| | |
|
| | | protected override void OnInit(GameNetPackBasic package)
|
| | | {
|
| | | m_H0434 = package as H0434_tagAreaPlayerAppearEx;
|
| | |
| | | // 处理装备
|
| | | H0434_tagAreaPlayerAppearEx.tagEquipInfo _equipInfo;
|
| | |
|
| | | Dictionary<int, List<int>> _userDataDict;
|
| | | EquipInfo _info;
|
| | |
|
| | | // 因为衣服是所有装备的父节点, 需要预先处理衣服
|
| | | for (int i = 0; i < m_H0434.EquipCount; ++i)
|
| | | {
|
| | | _equipInfo = m_H0434.EquipInfo[i];
|
| | |
|
| | | _info = new EquipInfo
|
| | | {
|
| | | itemID = _equipInfo.ItemID
|
| | | };
|
| | |
|
| | | _userDataDict = ConfigParse.Analysis(_equipInfo.UserData);
|
| | | if (_userDataDict.ContainsKey(25))
|
| | | {
|
| | | _info.suitLV_1 = (byte)_userDataDict[25][0];
|
| | | _info.suitLV_2 = (byte)_userDataDict[25][1];
|
| | | }
|
| | | m_EquipDict[_equipInfo.Place] = _info;
|
| | |
|
| | | if (_equipInfo.Place == (byte)RoleEquipType.retClothes)
|
| | | {
|
| | | m_SuitLevel = 0;
|
| | | if (_equipInfo.IsSuite == 1)
|
| | | {
|
| | | Dictionary<int, List<int>> _userData = ConfigParse.Analysis(_equipInfo.UserData);
|
| | | if (_userData.ContainsKey(30))
|
| | | {
|
| | | m_SuitLevel = (byte)_userData[30][0];
|
| | | }
|
| | | }
|
| | |
|
| | | SwitchClothes(_equipInfo.ItemID);
|
| | |
|
| | | ChangeEquip(_equipInfo.Place, _equipInfo.ItemID, m_SuitLevel);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | ActorInfo.horseItemID = _equipInfo.ItemID;
|
| | | }
|
| | |
|
| | | m_SuitLevel = 0;
|
| | | if (_equipInfo.IsSuite == 1)
|
| | | {
|
| | | Dictionary<int, List<int>> _userData = ConfigParse.Analysis(_equipInfo.UserData);
|
| | | if (_userData.ContainsKey(30))
|
| | | {
|
| | | m_SuitLevel = (byte)_userData[30][0];
|
| | | }
|
| | | }
|
| | |
|
| | | ChangeEquip(_equipInfo.Place, _equipInfo.ItemID, m_SuitLevel);
|
| | | }
|
| | |
|
| | | ChangeEquip(default(EquipInfo));
|
| | |
|
| | | if (ActorInfo.horseItemID != 0 && m_H0434.PlayerState == 2)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public override void ChangeEquip(EquipInfo equipInfo)
|
| | | {
|
| | | // 传入ID为0代表脱下了装备
|
| | | if(equipInfo.itemID == 0 && equipInfo.place != 0)
|
| | | {
|
| | | if(m_EquipDict.ContainsKey(equipInfo.place))
|
| | | {
|
| | | m_EquipDict.Remove(equipInfo.place);
|
| | | }
|
| | | }
|
| | |
|
| | | var _suitCount = 0;
|
| | |
|
| | | int _start = (int)RoleEquipType.retHat;
|
| | | int _end = (int)RoleEquipType.retShoes;
|
| | | int _rank = 0;
|
| | |
|
| | | EquipInfo _equipInfo;
|
| | |
|
| | | // 先取得衣服的阶数
|
| | | if (!m_EquipDict.TryGetValue((int)RoleEquipType.retClothes, out _equipInfo))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>((int)_equipInfo.itemID);
|
| | | _rank = _itemConfig.LV;
|
| | |
|
| | | for (int i = _start; i <= _end; ++i)
|
| | | {
|
| | | if (!m_EquipDict.TryGetValue(i, out _equipInfo))
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (_equipInfo.suitLV_1 > 0
|
| | | || _equipInfo.suitLV_2 > 0)
|
| | | {
|
| | | _itemConfig = Config.Instance.Get<ItemConfig>((int)_equipInfo.itemID);
|
| | | if (_itemConfig.LV >= _rank)
|
| | | {
|
| | | _suitCount += 1;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (m_SuitCount == _suitCount)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (m_SuitCount < 5 && _suitCount < 5)
|
| | | {
|
| | | m_SuitCount = _suitCount;
|
| | | return;
|
| | | }
|
| | |
|
| | | // Debug.Log("_suitCount: " + _suitCount);
|
| | |
|
| | | if (_suitCount == 5)
|
| | | {
|
| | | _itemConfig = Config.Instance.Get<ItemConfig>((int)ClothesItemID);
|
| | | if (_itemConfig != null)
|
| | | {
|
| | | var _newMat = MaterialLoader.LoadClothesMaterial(_itemConfig.ChangeOrd, false, true);
|
| | | if (_newMat)
|
| | | {
|
| | | MaterialLoader.Release(m_SMRenderer.material);
|
| | | m_SMRenderer.material = m_Material = _newMat;
|
| | | MaterialUtility.SwitchXrayShader(m_SMRenderer.material, false);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | _itemConfig = Config.Instance.Get<ItemConfig>((int)ClothesItemID);
|
| | | if (_itemConfig != null)
|
| | | {
|
| | | var _newMat = MaterialLoader.LoadClothesMaterial(_itemConfig.ChangeOrd, false, false);
|
| | | if (_newMat)
|
| | | {
|
| | | MaterialLoader.Release(m_SMRenderer.material);
|
| | | m_SMRenderer.material = m_Material = _newMat;
|
| | | MaterialUtility.SwitchXrayShader(m_SMRenderer.material, false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | m_SuitCount = _suitCount;
|
| | | }
|
| | |
|
| | | protected sealed override void OnUnit()
|
| | | {
|
| | | ShowOrHideModel(true);
|
| | |
| | |
|
| | | if (_itemInfo.place == (int)RoleEquipType.retClothes)
|
| | | {
|
| | | m_SuitLevel = 0;
|
| | | if (_itemInfo.isSuit == 1)
|
| | | {
|
| | | m_SuitLevel = (byte)_itemInfo.suitLevel;
|
| | | }
|
| | | //m_SuitLevel = 0;
|
| | | //if (_itemInfo.isSuit == 1)
|
| | | //{
|
| | | // m_SuitLevel = (byte)_itemInfo.suitLevel;
|
| | | //}
|
| | | SwitchClothes((uint)_itemInfo.id);
|
| | | ChangeEquip(_itemInfo.place, (uint)_itemInfo.id, m_SuitLevel);
|
| | | //ChangeEquip(_itemInfo.place, (uint)_itemInfo.id, m_SuitLevel);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | ActorInfo.horseItemID = (uint)_itemInfo.id;
|
| | | }
|
| | |
|
| | | m_SuitLevel = 0;
|
| | | if (_itemInfo.isSuit == 1)
|
| | | {
|
| | | m_SuitLevel = (byte)_itemInfo.suitLevel;
|
| | | }
|
| | | //m_SuitLevel = 0;
|
| | | //if (_itemInfo.isSuit == 1)
|
| | | //{
|
| | | // m_SuitLevel = (byte)_itemInfo.suitLevel;
|
| | | //}
|
| | |
|
| | | ChangeEquip(_itemInfo.place, (uint)_itemInfo.id, m_SuitLevel);
|
| | | //ChangeEquip(_itemInfo.place, (uint)_itemInfo.id, m_SuitLevel);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | RequestName();
|
| | | }
|
| | |
|
| | | public override void ChangeEquip(EquipInfo equipInfo)
|
| | | {
|
| | | }
|
| | |
|
| | | public sealed override void Destroy()
|
| | | {
|
| | | }
|
| | |
| | |
|
| | | if (_itemInfo.place == (int)RoleEquipType.retClothes)
|
| | | {
|
| | | m_SuitLevel = 0;
|
| | | if (_itemInfo.isSuit == 1)
|
| | | {
|
| | | m_SuitLevel = (byte)_itemInfo.suitLevel;
|
| | | }
|
| | | //m_SuitLevel = 0;
|
| | | //if (_itemInfo.isSuit == 1)
|
| | | //{
|
| | | // m_SuitLevel = (byte)_itemInfo.suitLevel;
|
| | | //}
|
| | | SwitchClothes((uint)_itemInfo.id);
|
| | | ChangeEquip(_itemInfo.place, (uint)_itemInfo.id, m_SuitLevel);
|
| | | //ChangeEquip(_itemInfo.place, (uint)_itemInfo.id, m_SuitLevel);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | ActorInfo.horseItemID = (uint)_itemInfo.id;
|
| | | }
|
| | |
|
| | | m_SuitLevel = 0;
|
| | | if (_itemInfo.isSuit == 1)
|
| | | {
|
| | | m_SuitLevel = (byte)_itemInfo.suitLevel;
|
| | | }
|
| | | //m_SuitLevel = 0;
|
| | | //if (_itemInfo.isSuit == 1)
|
| | | //{
|
| | | // m_SuitLevel = (byte)_itemInfo.suitLevel;
|
| | | //}
|
| | |
|
| | | ChangeEquip(_itemInfo.place, (uint)_itemInfo.id, m_SuitLevel);
|
| | | //ChangeEquip(_itemInfo.place, (uint)_itemInfo.id, m_SuitLevel);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | IdleImmediate();
|
| | | }
|
| | |
|
| | | public override void ChangeEquip(EquipInfo equipInfo)
|
| | | {
|
| | | }
|
| | |
|
| | | public override void Destroy()
|
| | | {
|
| | | }
|
| | |
| | | {
|
| | | public static UnityAction<bool> onShowEffect;
|
| | | private bool m_LoadDefaultHorse;
|
| | | protected struct EquipInfo
|
| | | public struct EquipInfo
|
| | | {
|
| | | public int place;
|
| | | public uint itemID;
|
| | | public int suitID;
|
| | | public int suitLevel;
|
| | | public int suitLV_1;
|
| | | public int suitLV_2;
|
| | | }
|
| | | protected int m_SuitCount;
|
| | |
|
| | | protected Material m_WingMaterial;
|
| | | protected Material m_HorseMaterial;
|
| | |
| | | WeaponItemID = uint.MaxValue;
|
| | | SecondaryID = uint.MaxValue;
|
| | | WingItemID = uint.MaxValue;
|
| | | m_SuitLevel = 0;
|
| | | MovingState = E_MovingState.Normal;
|
| | |
|
| | | SystemSetting.Instance.qualityLevelChangeEvent += OnGameQualityChange;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (m_SMRenderer)
|
| | | {
|
| | | MaterialLoader.Release(m_SMRenderer.material);
|
| | | m_SMRenderer.material = null;
|
| | | }
|
| | | m_Material = null;
|
| | |
|
| | | foreach (var _effect in m_GodWeaponEffectDict.Values)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(_effect);
|
| | | }
|
| | | m_GodWeaponEffectDict.Clear();
|
| | |
|
| | | UnloadSuitSFX();
|
| | | ReleaseLifeBar();
|
| | | ReleaseName();
|
| | | ReleaseShadow();
|
| | |
| | | private GameObject m_HorseModel;
|
| | | private GA_Guard m_Guard;
|
| | |
|
| | | private List<SFXController> m_SuitEffect = new List<SFXController>();
|
| | |
|
| | | private Transform m_HorseBindNode;
|
| | |
|
| | | protected uint ClothesItemID { get; private set; }
|
| | |
| | | protected uint SecondaryID { get; private set; }
|
| | | protected uint WingItemID { get; private set; }
|
| | | protected uint GuardID { get; private set; }
|
| | |
|
| | | protected byte m_SuitLevel;// 套装等级
|
| | |
|
| | | private Animator m_ClothesAnimator;
|
| | | private Animator m_WingAnimator;
|
| | |
| | | m_SMRenderer = m_ClothesModel.GetComponentInChildren<SkinnedMeshRenderer>();
|
| | | if (m_SMRenderer)
|
| | | {
|
| | | m_Material = m_SMRenderer.material;
|
| | | MaterialLoader.Release(m_SMRenderer.material);
|
| | | m_Material = m_SMRenderer.material = MaterialLoader.LoadClothesMaterial(_resID, false, false);
|
| | | }
|
| | |
|
| | | m_ClothesAnimator = m_ClothesModel.GetComponent<Animator>();
|
| | |
| | | HorseID = _newHorseID;
|
| | | }
|
| | |
|
| | | private void SyncSuitSFX(int suitEffectID)
|
| | | {
|
| | | if (!m_ClothesModel)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | UnloadSuitSFX();
|
| | |
|
| | | if (suitEffectID <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | SuitEffectConfig _suitEffect = Config.Instance.Get<SuitEffectConfig>(suitEffectID);
|
| | |
|
| | | // 上特效
|
| | | if (_suitEffect != null)
|
| | | {
|
| | | Transform _parent = null;
|
| | | SFXController _sfx = null;
|
| | | for (int i = 0; _suitEffect.bindbones != null && i < _suitEffect.bindbones.Length; ++i)
|
| | | {
|
| | | if (string.IsNullOrEmpty(_suitEffect.bindbones[i])
|
| | | || _suitEffect.effectIds[i] == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | _parent = m_ClothesModel.transform.GetChildTransformDeeply(_suitEffect.bindbones[i]);
|
| | |
|
| | | if (_parent == null)
|
| | | {
|
| | | Debug.LogErrorFormat("套装: {0} 配置的骨骼节点: {1} 不存在", suitEffectID, _suitEffect.bindbones[i]);
|
| | | continue;
|
| | | }
|
| | |
|
| | | _sfx = SFXPlayUtility.Instance.PlayBattleEffect(_suitEffect.effectIds[i], _parent);
|
| | | m_SuitEffect.Add(_sfx);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private PlayerSuitModel _suitModel;
|
| | | private PlayerSuitModel SuitModel
|
| | | {
|
| | | get { return _suitModel ?? (_suitModel = ModelCenter.Instance.GetModel<PlayerSuitModel>()); }
|
| | | }
|
| | |
|
| | | private PlayerPackModel m_PlayerBackModel;
|
| | | private PlayerPackModel PlayerBackModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_PlayerBackModel ?? (m_PlayerBackModel = ModelCenter.Instance.GetModel<PlayerPackModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | public void ChangeEquip(int place, uint itemID, int suitLevel)
|
| | | {
|
| | | if (PlayerDatas.Instance.PlayerId != ServerInstID)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var _equipModel = PlayerBackModel.GetSinglePackModel(PackType.rptEquip);
|
| | |
|
| | | int _suitCount = 0;
|
| | |
|
| | | int _start = (int)RoleEquipType.retHat;
|
| | | int _end = (int)RoleEquipType.retShoes;
|
| | | int _rank = 0;
|
| | |
|
| | | ItemModel _itemModel = null;
|
| | |
|
| | | // 先取得衣服的阶数
|
| | | _itemModel = _equipModel.GetItemModelByIndex((int)RoleEquipType.retClothes);
|
| | | if (_itemModel == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | _rank = _itemModel.chinItemModel.LV;
|
| | |
|
| | | for (int i = _start; i <= _end; ++i)
|
| | | {
|
| | | _itemModel = _equipModel.GetItemModelByIndex(i);
|
| | |
|
| | | if (_itemModel == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (_itemModel.chinItemModel.SuiteiD <= 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (SuitModel.suitModelDict.ContainsKey(i))
|
| | | {
|
| | | if (SuitModel.suitModelDict[i].ContainsKey(1)
|
| | | || SuitModel.suitModelDict[i].ContainsKey(2))
|
| | | {
|
| | | if (_itemModel.chinItemModel.LV >= _rank)
|
| | | {
|
| | | _suitCount += 1;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (_suitCount == 5)
|
| | | {
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>((int)ClothesItemID);
|
| | | if (_itemConfig != null)
|
| | | {
|
| | | var _newMat = MaterialLoader.LoadClothesMaterial(_itemConfig.ChangeOrd, false, true);
|
| | | if (_newMat)
|
| | | {
|
| | | m_SMRenderer.material = m_Material = _newMat;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>((int)ClothesItemID);
|
| | | if (_itemConfig != null)
|
| | | {
|
| | | var _newMat = MaterialLoader.LoadClothesMaterial(_itemConfig.ChangeOrd, false, false);
|
| | | if (_newMat)
|
| | | {
|
| | | m_SMRenderer.material = m_Material = _newMat;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void UnloadSuitSFX()
|
| | | {
|
| | | for (int i = 0; i < m_SuitEffect.Count; ++i)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_SuitEffect[i]);
|
| | | }
|
| | | m_SuitEffect.Clear();
|
| | | }
|
| | | public abstract void ChangeEquip(EquipInfo equipInfo);
|
| | |
|
| | | private bool TryRequest(uint itemID, ref GameObject model)
|
| | | {
|
| | |
| | | AnimatorStateInfo _stateInfo = m_ClothesAnimator.GetCurrentAnimatorStateInfo(0);
|
| | |
|
| | | return _stateInfo.shortNameHash == GAStaticDefine.State_StunHash;
|
| | | }
|
| | |
|
| | | public bool IsCollecting()
|
| | | {
|
| | | if (!m_ClothesAnimator)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | AnimatorStateInfo _stateInfo = m_ClothesAnimator.GetCurrentAnimatorStateInfo(0);
|
| | |
|
| | | return _stateInfo.shortNameHash == GAStaticDefine.State_CollectHash;
|
| | | }
|
| | |
|
| | | public sealed override void Hurt()
|
| | |
| | | }
|
| | |
|
| | | _hero.SwitchClothes((uint)_itemModel.itemInfo.ItemID);
|
| | | _hero.ChangeEquip((int)RoleEquipType.retClothes, (uint)_itemModel.itemInfo.ItemID, _suitLevel);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | _hero.SwitchGuard((uint)_itemModel.itemInfo.ItemID);
|
| | | }
|
| | |
|
| | | _itemModel = _equipModel.GetItemModelByIndex((int)RoleEquipType.retHat);
|
| | | if (_itemModel != null)
|
| | | {
|
| | | if (_itemModel.itemInfo.IsSuite == 1)
|
| | | {
|
| | | _suitLevel = (byte)_itemModel.useDataDict[30][0];
|
| | | _hero.ChangeEquip((int)RoleEquipType.retHat, (uint)_itemModel.itemInfo.ItemID, _suitLevel);
|
| | | }
|
| | | }
|
| | |
|
| | | _itemModel = _equipModel.GetItemModelByIndex((int)RoleEquipType.retBelt);
|
| | | if (_itemModel != null)
|
| | | {
|
| | | if (_itemModel.itemInfo.IsSuite == 1)
|
| | | {
|
| | | _suitLevel = (byte)_itemModel.useDataDict[30][0];
|
| | | _hero.ChangeEquip((int)RoleEquipType.retBelt, (uint)_itemModel.itemInfo.ItemID, _suitLevel);
|
| | | }
|
| | | }
|
| | |
|
| | | _itemModel = _equipModel.GetItemModelByIndex((int)RoleEquipType.retShoes);
|
| | | if (_itemModel != null)
|
| | | {
|
| | | if (_itemModel.itemInfo.IsSuite == 1)
|
| | | {
|
| | | _suitLevel = (byte)_itemModel.useDataDict[30][0];
|
| | | _hero.ChangeEquip((int)RoleEquipType.retShoes, (uint)_itemModel.itemInfo.ItemID, _suitLevel);
|
| | | }
|
| | | }
|
| | |
|
| | | _itemModel = _equipModel.GetItemModelByIndex((int)RoleEquipType.retTrousers);
|
| | | if (_itemModel != null)
|
| | | {
|
| | | if (_itemModel.itemInfo.IsSuite == 1)
|
| | | {
|
| | | _suitLevel = (byte)_itemModel.useDataDict[30][0];
|
| | | _hero.ChangeEquip((int)RoleEquipType.retTrousers, (uint)_itemModel.itemInfo.ItemID, _suitLevel);
|
| | | }
|
| | | }
|
| | | _hero.ChangeEquip(default(GActorPlayerBase.EquipInfo));
|
| | |
|
| | | _hero.IdleImmediate();
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | | m_TextNumber.text = PlayerLV.IceLodeFightPower.ToString();
|
| | | if (PlayerDatas.Instance.baseData.FightPoint >= PlayerLV.IceLodeFightPower)
|
| | | {
|
| | | m_Text_Fight.color = new Color32(16,157,6,255);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Text_Fight.color = new Color32(255, 3, 3, 255);
|
| | | }
|
| | | //if (PlayerDatas.Instance.baseData.FightPoint >= PlayerLV.IceLodeFightPower)
|
| | | //{
|
| | | // m_Text_Fight.color = new Color32(16,157,6,255);
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // m_Text_Fight.color = new Color32(255, 3, 3, 255);
|
| | | //}
|
| | | }
|
| | | private void SelectedByDefault()//默认选中
|
| | | {
|
| | |
| | | bool SatisfyTransmitState()
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero == null || hero.IsCollecting()
|
| | | if (hero == null || hero.IsCollect()
|
| | | || hero.IsCollect() || hero.IsDaZuo() || nearNpc)
|
| | | {
|
| | | return false;
|
| | |
| | | FairyLeagueBattleData battleData = new FairyLeagueBattleData()
|
| | | {
|
| | | grade = (int)_pakData.Value1,
|
| | | ring = (int)_pakData.Value2 - 1,
|
| | | session = (int)_pakData.Value2 - 1,
|
| | | fairyId1 = (int)_pakData.Value3,
|
| | | fairyId2 = (int)_pakData.Value4,
|
| | | winFairyId = (int)_pakData.Value5,
|
| | |
| | | _error = 5;
|
| | | }
|
| | | return _fairyBattle.winFairyId == 0;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool RequireFairyLeagueRemind(int session)
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.FairyLeague))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var _fairyId = PlayerDatas.Instance.fairyData.fairy.FamilyID;
|
| | | if (!fairyLeagueBattleDict.ContainsKey(session))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var dict = fairyLeagueBattleDict[session];
|
| | | foreach (var grade in dict.Keys)
|
| | | {
|
| | | if (dict[grade] == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | foreach (var battleList in dict[grade])
|
| | | {
|
| | | if (battleList.fairyId1 == _fairyId
|
| | | || battleList.fairyId2 == _fairyId)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | if (time.Hour == overStage.endHour && time.Minute > overStage.endMinute)
|
| | | if (time.Hour == overStage.endHour && time.Minute >= overStage.endMinute)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | public class FairyLeagueBattleData
|
| | | {
|
| | | public int grade;
|
| | | public int ring;
|
| | | public int session;
|
| | | public int fairyId1;
|
| | | public int fairyId2;
|
| | | public int winFairyId;
|
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FairyLeagueRemindBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] RectTransform m_Container;
|
| | | [SerializeField] Text m_Timer;
|
| | | [SerializeField] Button m_Goto;
|
| | |
|
| | | FairyLeagueModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<FairyLeagueModel>(); }
|
| | | }
|
| | |
|
| | | bool requireRemind = false;
|
| | | DateTime startTime = DateTime.Now;
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_Goto.AddListener(Goto);
|
| | | }
|
| | |
|
| | | public void Init()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent += OnPerSecond;
|
| | | model.OnRefreshFairyLeagueEvent += OnRefreshFairyLeagueEvent;
|
| | | model.onFairyLeagueBattleEvent += OnFairyLeagueBattleEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo += OnRefreshFairyInfo;
|
| | | requireRemind = SatisfyRemindCondition() && model.RequireFairyLeagueRemind(1)
|
| | | && TryGetStartTime(out startTime);
|
| | | m_Container.gameObject.SetActive(requireRemind);
|
| | | if (requireRemind)
|
| | | {
|
| | | DisplayTimer();
|
| | | }
|
| | | }
|
| | |
|
| | | public void UnInit()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= OnPerSecond;
|
| | | model.OnRefreshFairyLeagueEvent -= OnRefreshFairyLeagueEvent;
|
| | | model.onFairyLeagueBattleEvent -= OnFairyLeagueBattleEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo -= OnRefreshFairyInfo;
|
| | | requireRemind = false;
|
| | | }
|
| | |
|
| | | private void OnPerSecond()
|
| | | {
|
| | | if (requireRemind)
|
| | | {
|
| | | DisplayTimer();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnRefreshFairyInfo()
|
| | | {
|
| | | OnRefreshFairyLeagueEvent();
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int id)
|
| | | {
|
| | | if (id == (int)FuncOpenEnum.FairyLeague)
|
| | | {
|
| | | OnRefreshFairyLeagueEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnFairyLeagueBattleEvent()
|
| | | {
|
| | | requireRemind = SatisfyRemindCondition() && model.RequireFairyLeagueRemind(1)
|
| | | && TryGetStartTime(out startTime);
|
| | | m_Container.gameObject.SetActive(requireRemind);
|
| | | if (requireRemind)
|
| | | {
|
| | | DisplayTimer();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnRefreshFairyLeagueEvent()
|
| | | {
|
| | | requireRemind = SatisfyRemindCondition() && model.RequireFairyLeagueRemind(1)
|
| | | && TryGetStartTime(out startTime);
|
| | | m_Container.gameObject.SetActive(requireRemind);
|
| | | if (requireRemind)
|
| | | {
|
| | | DisplayTimer();
|
| | | }
|
| | | }
|
| | |
|
| | | bool SatisfyRemindCondition()
|
| | | {
|
| | | var fairyLeagueStage = model.fairyLeagueStage;
|
| | | var session = model.fairyLeagueSession;
|
| | | return fairyLeagueStage == FairyLeagueStage.Grouping && session == 1;
|
| | | }
|
| | |
|
| | | bool TryGetStartTime(out DateTime time)
|
| | | {
|
| | | time = DateTime.Now;
|
| | | var fairyLeagueTime = model.currentWeekTime;
|
| | | if (fairyLeagueTime == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var ring = fairyLeagueTime.rings[fairyLeagueTime.currentRing];
|
| | | var session = ring.sessions[ring.sessions.Count - 1];
|
| | | var stage = session.stages.Find((x) =>
|
| | | {
|
| | | return x.stage == FairyLeagueStage.Fight;
|
| | | });
|
| | | time = new DateTime(TimeUtility.ServerNow.Year, TimeUtility.ServerNow.Month, TimeUtility.Day,
|
| | | stage.startHour, stage.startMinute, 0);
|
| | | return true;
|
| | | }
|
| | |
|
| | | private void DisplayTimer()
|
| | | {
|
| | | var seconds = (int)(startTime - TimeUtility.ServerNow).TotalSeconds;
|
| | | seconds = Mathf.Max(0, seconds);
|
| | | m_Timer.text = TimeUtility.SecondsToMS(seconds);
|
| | | }
|
| | |
|
| | | private void Goto()
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.UnionFunc4);
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 355afb8d09a2ee5418b118791b4f63d2 |
| | | timeCreated: 1543888926 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public Dictionary<int, int> SetItemEffectDict(ItemConfig config)
|
| | | {
|
| | | Dictionary<int, int> itemEffectDict = new Dictionary<int, int>();
|
| | | if (config == null) return itemEffectDict;
|
| | |
|
| | | try
|
| | | {
|
| | | if (config.Effect1 != 0)
|
| | |
| | | #region 设置物品使用的限制条件
|
| | | #endregion
|
| | |
|
| | | #region 物品增加战斗力
|
| | | PlayerMountDatas mountDatas { get { return ModelCenter.Instance.GetModel<PlayerMountDatas>(); } }
|
| | | public PlayerStrengthengDatas strengthengmodel
|
| | | {
|
| | | get
|
| | | {
|
| | | return ModelCenter.Instance.GetModel<PlayerStrengthengDatas>();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetFightPowerByItemId(int itemId,out int fightPower)
|
| | | {
|
| | | fightPower = 0;
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(itemId);
|
| | | if (itemConfig == null) return false;
|
| | |
|
| | | var attrIdlist = Config.Instance.GetAllKeys<PlayerPropertyConfig>();
|
| | | Dictionary<int, int> attrDict = new Dictionary<int, int>();
|
| | | Dictionary<int, int> itemEffectDict = SetItemEffectDict(itemConfig);
|
| | | int atk = 0;
|
| | | int hp = 0;
|
| | | int def = 0;
|
| | | foreach(var attrId in itemEffectDict.Keys)
|
| | | {
|
| | | var attrValue = itemEffectDict[attrId];
|
| | | switch ((AttrEnum)attrId)
|
| | | {
|
| | | case AttrEnum.ATK:
|
| | | atk += attrValue;
|
| | | break;
|
| | | case AttrEnum.HP:
|
| | | hp += attrValue;
|
| | | break;
|
| | | case AttrEnum.DEF:
|
| | | def += attrValue;
|
| | | break;
|
| | | case AttrEnum.HorseAtkPer:
|
| | | float mountAtk = mountDatas.GetAllMountAttack();
|
| | | atk += Mathf.RoundToInt(mountAtk * ((float)attrValue / 10000));
|
| | | break;
|
| | | case AttrEnum.StoneBasePer:
|
| | | var stoneDict = GetStoneAttrDict();
|
| | | foreach (var key in stoneDict.Keys)
|
| | | {
|
| | | var stoneValue = stoneDict[key];
|
| | | switch ((AttrEnum)key)
|
| | | {
|
| | | case AttrEnum.ATK:
|
| | | atk += Mathf.RoundToInt(stoneValue *((float)attrValue / 10000));
|
| | | break;
|
| | | case AttrEnum.HP:
|
| | | hp += Mathf.RoundToInt(stoneValue * ((float)attrValue / 10000));
|
| | | break;
|
| | | case AttrEnum.DEF:
|
| | | def += Mathf.RoundToInt(stoneValue * ((float)attrValue / 10000));
|
| | | break;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case AttrEnum.RealmBasePer:
|
| | | var realmDict = GetRealmAttrDict();
|
| | | foreach (var key in realmDict.Keys)
|
| | | {
|
| | | var realmValue = realmDict[key];
|
| | | switch ((AttrEnum)key)
|
| | | {
|
| | | case AttrEnum.ATK:
|
| | | atk += Mathf.RoundToInt(realmValue * ((float)attrValue / 10000));
|
| | | break;
|
| | | case AttrEnum.HP:
|
| | | hp += Mathf.RoundToInt(realmValue * ((float)attrValue / 10000));
|
| | | break;
|
| | | case AttrEnum.DEF:
|
| | | def += Mathf.RoundToInt(realmValue * ((float)attrValue / 10000));
|
| | | break;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case AttrEnum.PetSkillAtkRate:
|
| | | break;
|
| | | case AttrEnum.PlusBaseAtkPer:
|
| | | var strengthDict = GetStrengthAttrDict();
|
| | | if(strengthDict.ContainsKey((int)AttrEnum.ATK))
|
| | | {
|
| | | var strengthValue = strengthDict[(int)AttrEnum.ATK];
|
| | | atk += Mathf.RoundToInt(strengthValue * ((float)attrValue / 10000));
|
| | | }
|
| | | break;
|
| | | default:
|
| | | if(attrIdlist.Contains(attrId.ToString()))
|
| | | {
|
| | | attrDict.Add(attrId,attrValue);
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | |
| | | if(atk > 0)
|
| | | {
|
| | | attrDict.Add((int)AttrEnum.ATK,atk);
|
| | | }
|
| | | |
| | | if(def > 0)
|
| | | {
|
| | | attrDict.Add((int)AttrEnum.DEF,def);
|
| | | }
|
| | | |
| | | if(hp > 0)
|
| | | {
|
| | | attrDict.Add((int)AttrEnum.HP,hp);
|
| | | }
|
| | |
|
| | | fightPower = UIHelper.GetFightPower(attrDict);
|
| | | return fightPower > 0;
|
| | | }
|
| | | |
| | | private Dictionary<int,int> GetStoneAttrDict()
|
| | | {
|
| | | Dictionary<int, int> attrDict = new Dictionary<int, int>();
|
| | | var stoneDict = PlayerStoneData.Instance.GetAllStone();
|
| | | foreach(var key in stoneDict.Keys)
|
| | | {
|
| | | var stoneIds = stoneDict[key];
|
| | | var itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip,key);
|
| | | if (itemModel != null && stoneIds != null)
|
| | | {
|
| | | for(int i = 0; i < stoneIds.Length; i++)
|
| | | {
|
| | | int stoneId = (int)stoneIds[i];
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(stoneId);
|
| | | if(itemConfig != null)
|
| | | {
|
| | | var itemEffectDict = SetItemEffectDict(itemConfig);
|
| | | foreach (var attrId in itemEffectDict.Keys)
|
| | | {
|
| | | var attrValue = itemEffectDict[attrId];
|
| | | if (!attrDict.ContainsKey(attrId))
|
| | | {
|
| | | attrDict.Add(attrId, attrValue);
|
| | | }
|
| | | else
|
| | | {
|
| | | attrDict[attrId] += attrValue;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return attrDict;
|
| | | }
|
| | |
|
| | | private Dictionary<int,int> GetRealmAttrDict()
|
| | | {
|
| | | Dictionary<int, int> attrDict = new Dictionary<int, int>();
|
| | | int realmLv = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var realmConfig = Config.Instance.Get<RealmConfig>(realmLv);
|
| | | if(realmConfig != null)
|
| | | {
|
| | | var attrIds = realmConfig.AddAttrType;
|
| | | var attrValues = realmConfig.AddAttrNum;
|
| | | if(attrIds != null && attrValues != null
|
| | | && attrIds.Length == attrValues.Length)
|
| | | {
|
| | | for (int i = 0; i < attrIds.Length; i++)
|
| | | {
|
| | | var attrId = attrIds[i];
|
| | | var attrValue = attrValues[i];
|
| | | if(attrValue > 0)
|
| | | {
|
| | | if (!attrDict.ContainsKey(attrId))
|
| | | {
|
| | | attrDict.Add(attrId, attrValue);
|
| | | }
|
| | | else
|
| | | {
|
| | | attrDict[attrId] += attrValue;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return attrDict;
|
| | | }
|
| | |
|
| | | private Dictionary<int,int> GetStrengthAttrDict()
|
| | | {
|
| | | Dictionary<int, int> attrDict = new Dictionary<int, int>();
|
| | | var strengthDict = strengthengmodel._EqInfo;
|
| | | foreach(var index in strengthDict.Keys)
|
| | | {
|
| | | var itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip, index);
|
| | | if(itemModel != null)
|
| | | {
|
| | | int lv = strengthengmodel.StrengthenTheCeiling(index);
|
| | | int type = strengthengmodel.GameDefineIndex(index);
|
| | | var itemPlus = ItemPlusConfig.GetItemPlusData(type, lv);
|
| | | if (itemPlus != null)
|
| | | {
|
| | | int[] attrIDs = itemPlus.attrIds;
|
| | | int[] attrValues = itemPlus.attrValues;
|
| | | for (int i = 0; i < attrIDs.Length; i++)
|
| | | {
|
| | | var attrId = attrIDs[i];
|
| | | var attrValue = attrValues[i];
|
| | | if (attrValue > 0)
|
| | | {
|
| | | if (!attrDict.ContainsKey(attrId))
|
| | | {
|
| | | attrDict.Add(attrId, attrValue);
|
| | | }
|
| | | else
|
| | | {
|
| | | attrDict[attrId] += attrValue;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return attrDict;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | }
|
| | |
|
| | | public class ItemAttrData
|
| | |
| | | if (!isbetter)
|
| | | {
|
| | | equipItemModel = singlePack.GetItemModelByIndex(10);
|
| | | if (equipItemModel != null)
|
| | | {
|
| | | putOnScore = equipItemModel.equipScore;
|
| | | }
|
| | | putOnScore = equipItemModel == null ? 0 : equipItemModel.equipScore;
|
| | | isbetter = CheckIsBetterEquip(model.equipScore, putOnScore);
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] RectTransform m_ContainerAdaptiveChat;
|
| | | [SerializeField] Button m_GotoFairyGrabBoss;
|
| | | [SerializeField] Button m_FlyToFairyGrabBoss;
|
| | | [SerializeField] FairyLeagueRemindBehaviour m_FairyLeagueRemind;
|
| | |
|
| | | [SerializeField] Transform m_EffectTask;//任务完成特效播放位置
|
| | | private int m_CollectNPCID;
|
| | |
| | | m_TeamInvitationEntrance.Init();
|
| | | m_FairyCallBehaviour.Init();
|
| | | m_MapSwitchingBehaviour.Init();
|
| | | m_FairyLeagueRemind.Init();
|
| | | m_BossBriefInfos.gameObject.SetActive(false);
|
| | | UpdateWishAwardImag();
|
| | | UpdateMysticalPurchaseImag();
|
| | |
| | | m_AnimationFadeOut.Unit();
|
| | | m_TeamInvitationEntrance.UnInit();
|
| | | m_FairyCallBehaviour.UnInit();
|
| | | m_FairyLeagueRemind.UnInit();
|
| | | horseRidBool = false;
|
| | | purchaseModel.UpdateNewMysticalEvent -= UpdateMysticalPurchaseImag;
|
| | | assistModel.UpdateRedpointEvent -= UpdateDungeonAssistImag;
|
| | |
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Header, sort);
|
| | | if (functionOrder != sort)
|
| | | {
|
| | | m_ActivitySpreadDict[sort] = false;
|
| | | break;
|
| | | }
|
| | | if (!m_ActivitySpreadDict[sort])
|
| | |
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Header, sort);
|
| | | if (!m_ActivitySpreadDict[sort])
|
| | | {
|
| | | m_ActivitySpreadDict[sort] = false;
|
| | | break;
|
| | | }
|
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Normal, sort * 100 + 1);
|
| | |
| | | PutOnWing(wingsResId);
|
| | | PutOnGodWeaponEffect(godWeapons);
|
| | |
|
| | | LoadClothesEffect();
|
| | | return clothesModel;
|
| | | }
|
| | |
|
| | |
| | | PutOnWeapon(job, weaponResId);
|
| | | PutOnSecondary(job, secondaryResId);
|
| | | PutOnWing(wingsResId);
|
| | |
|
| | | LoadClothesEffect();
|
| | | return clothesModel;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | if (clothesId != 0)
|
| | | {
|
| | | if (clothesModel)
|
| | | {
|
| | | var smRenderer = clothesModel.GetComponentInChildren<SkinnedMeshRenderer>();
|
| | | if (smRenderer != null)
|
| | | {
|
| | | MaterialLoader.Release(smRenderer.material);
|
| | | smRenderer.material = smRenderer.sharedMaterial = null;
|
| | | smRenderer.materials = smRenderer.sharedMaterials = new Material[0];
|
| | | }
|
| | | }
|
| | |
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(clothesId, true);
|
| | | if (prefab)
|
| | | {
|
| | |
| | | wingsId = 0;
|
| | | secondaryId = 0;
|
| | |
|
| | | SwitchMaterial(false);
|
| | | TakeOffGodWeaponEffect();
|
| | | }
|
| | |
|
| | |
| | | var parent = clothesModel.transform.GetChildTransformDeeply(GAStaticDefine.SecondaryBindBoneName[job - 1]);
|
| | | wingsModel.transform.SetParentEx(parent, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | }
|
| | |
|
| | | LoadClothesEffect(suitLevel);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (clothesModel == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var smRenderer = clothesModel.GetComponentInChildren<SkinnedMeshRenderer>();
|
| | | if (smRenderer != null)
|
| | | {
|
| | | MaterialLoader.Release(smRenderer.material);
|
| | | smRenderer.material = smRenderer.sharedMaterial = null;
|
| | | smRenderer.materials = smRenderer.sharedMaterials = new Material[0];
|
| | | }
|
| | |
|
| | | var prefab = InstanceResourcesLoader.LoadModelRes(clothesId, true);
|
| | |
| | | private PlayerSuitModel SuitModel { get { return ModelCenter.Instance.GetModel<PlayerSuitModel>(); } }
|
| | | private PlayerPackModel PlayerBackModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
|
| | | private void LoadClothesEffect(int suitLevel)
|
| | | private void LoadClothesEffect()
|
| | | {
|
| | | var _equipModel = PlayerBackModel.GetSinglePackModel(PackType.rptEquip);
|
| | | if (_equipModel == null)
|
| | | {
|
| | | SwitchMaterial(DTC0309_tagPlayerLoginInfo.equipSuitID > 0);
|
| | | SwitchMaterial(false);
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | if (_itemModel == null)
|
| | | {
|
| | | SwitchMaterial(false);
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | SwitchMaterial(suitLevel > 0 || _suitCount >= 5);
|
| | | SwitchMaterial(_suitCount >= 5);
|
| | | }
|
| | |
|
| | | public void SwitchMaterial(bool isSuit)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | MaterialLoader.Release(smRenderer.material);
|
| | |
|
| | | var newMat = MaterialLoader.LoadClothesMaterial(this.clothesId, true, isSuit);
|
| | | if (newMat != null)
|
| | | {
|
| | |
| | | StoneBasePer = 83, //宝石基础属性
|
| | | RealmBasePer = 84, //境界基础属性
|
| | | PetSkillAtkRate = 85, //宠物技能伤害
|
| | | WingHPPer = 86, //翅膀生命
|
| | | SuiteBasePer = 87, //套装基础属性 |
| | | PlusBaseAtkPer = 88, //强化攻击
|
| | | NpcHurtAddPer = 89,//对怪物伤害加成
|
| | | }
|
| | | //UI图标类型
|
| | |
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | if (_hero != null)
|
| | | {
|
| | | if (_hero.IsCollecting())
|
| | | if (_hero.IsCollect())
|
| | | {
|
| | | _hero.Idle();
|
| | | }
|