Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (onOrOff)
|
| | | var _itemConfig = ItemConfig.Get((int)ClothesItemID);
|
| | | if (_itemConfig != null)
|
| | | {
|
| | | var _itemConfig = ItemConfig.Get((int)ClothesItemID);
|
| | | if (_itemConfig != null)
|
| | | Material _replaceMat = null;
|
| | | if (onOrOff)
|
| | | {
|
| | | 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);
|
| | | }
|
| | | _replaceMat = MaterialLoader.LoadClothesMaterial(_itemConfig.ChangeOrd, false, true);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var _itemConfig = ItemConfig.Get((int)ClothesItemID);
|
| | | if (_itemConfig != null)
|
| | | else
|
| | | {
|
| | | 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);
|
| | | }
|
| | | _replaceMat = MaterialLoader.LoadClothesMaterial(_itemConfig.ChangeOrd, false, false);
|
| | | }
|
| | | if (_replaceMat)
|
| | | {
|
| | | MaterialLoader.Release(m_SMRenderer.material);
|
| | | m_SMRenderer.material = m_Material = _replaceMat;
|
| | | MaterialUtility.SwitchXrayShader(m_SMRenderer.material, true);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | // Debug.Log("_suitCount: " + _suitCount);
|
| | | var _itemConfig = ItemConfig.Get((int)ClothesItemID);
|
| | |
|
| | | if (onOrOff)
|
| | | if (_itemConfig != null)
|
| | | {
|
| | | if (_itemConfig != null)
|
| | | Material _replaceMat = null;
|
| | | if (onOrOff)
|
| | | {
|
| | | 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);
|
| | | }
|
| | | _replaceMat = MaterialLoader.LoadClothesMaterial(_itemConfig.ChangeOrd, false, true);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_itemConfig != null)
|
| | | else
|
| | | {
|
| | | 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);
|
| | | }
|
| | | _replaceMat = MaterialLoader.LoadClothesMaterial(_itemConfig.ChangeOrd, false, false);
|
| | | }
|
| | | if (_replaceMat)
|
| | | {
|
| | | MaterialLoader.Release(m_SMRenderer.material);
|
| | | m_SMRenderer.material = m_Material = _replaceMat;
|
| | | MaterialUtility.SwitchXrayShader(m_SMRenderer.material, false);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | private float m_ClosedFuncNpcDistSqrt;
|
| | | public float conversationDistSqrt;
|
| | |
|
| | | private List<maptransportConfig> m_MapTransportCfgs;
|
| | | private List<int> m_TransMapLine = new List<int>();
|
| | |
|
| | | public void Initialize()
|
| | | {
|
| | | FuncConfigConfig _funcModel = FuncConfigConfig.Get("ConversationDistanc");
|
| | |
| | | m_ClosedFuncNpcDistSqrt = float.Parse(_funcModel.Numerical2);
|
| | | m_ClosedFuncNpcDistSqrt *= m_ClosedFuncNpcDistSqrt;
|
| | | }
|
| | |
|
| | | m_MapTransportCfgs = maptransportConfig.GetValues();
|
| | | m_TransMapLine.Clear();
|
| | | var _id = 122549;
|
| | | var _configs = maptransportConfig.Get(_id);
|
| | | m_TransMapLine.Add(_configs.OriginalMapID);
|
| | | while (true)
|
| | | {
|
| | | if (!m_TransMapLine.Contains(_configs.TargetMapID))
|
| | | {
|
| | | m_TransMapLine.Add(_configs.TargetMapID);
|
| | | }
|
| | | else
|
| | | {
|
| | | break;
|
| | | }
|
| | | var _nextID = GetMapID(_configs.TargetMapID, _configs.OriginalMapID);
|
| | | if (_nextID == -1)
|
| | | {
|
| | | break;
|
| | | }
|
| | | _configs = maptransportConfig.Get(_nextID);
|
| | | }
|
| | | conversationDistSqrt = conversationDistSqrt == 0 ? 6 : conversationDistSqrt;
|
| | | m_ClosedFuncNpcDistSqrt = m_ClosedFuncNpcDistSqrt == 0 ? 1 : m_ClosedFuncNpcDistSqrt;
|
| | |
|
| | | }
|
| | |
|
| | | private int GetMapID(int start, int target)
|
| | | {
|
| | | var _configs = maptransportConfig.GetValues();
|
| | | foreach (var _cfg in _configs)
|
| | | {
|
| | | if (_cfg.OriginalMapID == start && _cfg.TargetMapID != target)
|
| | | {
|
| | | return _cfg.TransportID;
|
| | | }
|
| | | }
|
| | | return -1;
|
| | | }
|
| | |
|
| | | private int GetNextTransportID(int start, int end)
|
| | | {
|
| | | foreach (var _cfg in m_MapTransportCfgs)
|
| | | {
|
| | | if (_cfg.OriginalMapID == start && _cfg.TargetMapID == end)
|
| | | {
|
| | | return _cfg.TransportID;
|
| | | }
|
| | | }
|
| | | return -1;
|
| | | }
|
| | |
|
| | | #region 打坐
|
| | |
| | |
|
| | | public void MoveToNPC(int _npcID, int _sid = 0)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | Debug.LogFormat("想要切换至目标npc: {0}", _npcID);
|
| | | #endif
|
| | | StopCoroutine("CoMoveToNPC");
|
| | | var _data = new MoveToData
|
| | | {
|
| | |
| | | yield break;
|
| | | }
|
| | |
|
| | | var npcID = data.npcID;
|
| | | var sid = data.sid;
|
| | | NpcID = data.npcID;
|
| | | MapTransferDoType = E_MapTransferDoType.Npc;
|
| | |
|
| | | Vector3 _destPostion = Vector3.zero;
|
| | |
|
| | | // 判断是否能够得到到达指定点
|
| | | // 获取NPC位置数据
|
| | | GAStaticDefine.NPCLocation _npcLocation;
|
| | | var _findLocation = GAStaticDefine.TryGetMapNPCLocation(npcID, out _npcLocation);
|
| | | var _findLocation = GAStaticDefine.TryGetMapNPCLocation(NpcID, out _npcLocation);
|
| | | if (!_findLocation)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | Debug.LogWarningFormat("需要传送至的npcid有错,无法在mapnpc表中查询到, id: {0}", npcID);
|
| | | Debug.LogWarningFormat("需要传送至的npcid有错,无法在mapnpc表中查询到, id: {0}", NpcID);
|
| | | #endif
|
| | | // 如果找不到配置, 可能为客户端战斗配置的刷怪逻辑
|
| | | // 由于可能有回包慢问题, 这里等待
|
| | | yield return WaitingForSecondConst.WaitMS200;
|
| | | GActor _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, npcID);
|
| | | GActor _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, NpcID);
|
| | | if (_npc != null)
|
| | | {
|
| | | _destPostion = _npc.Pos;
|
| | |
|
| | | NpcID = npcID;
|
| | | NpcID = NpcID;
|
| | | MapTransferDoType = E_MapTransferDoType.Npc;
|
| | |
|
| | | _hero.MoveToPosition(_destPostion);
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | _destPostion = new Vector3(_npcLocation.position.x, 0, _npcLocation.position.y);
|
| | | // 判断是否在同一张地图中
|
| | | if (_npcLocation.mapId != PlayerDatas.Instance.baseData.MapID)
|
| | | {
|
| | | _MoveToNPC(npcID, sid);
|
| | | int _idx1 = m_TransMapLine.IndexOf(PlayerDatas.Instance.baseData.MapID);
|
| | | int _idx2 = m_TransMapLine.IndexOf(_npcLocation.mapId);
|
| | | bool _valid = true;
|
| | | if (_idx1 == -1)
|
| | | {
|
| | | _valid = false;
|
| | | Debug.LogErrorFormat("寻找的地图ID不在线路中: {0}", PlayerDatas.Instance.baseData.MapID);
|
| | | }
|
| | | if (_idx2 == -1)
|
| | | {
|
| | | _valid = false;
|
| | | Debug.LogErrorFormat("寻找的地图ID不在线路中: {0}", _npcLocation.mapId);
|
| | | }
|
| | | if (_valid)
|
| | | {
|
| | | int _nextMapID = -1;
|
| | | // 顺序
|
| | | if (_idx2 > _idx1)
|
| | | {
|
| | | _nextMapID = m_TransMapLine[_idx1 + 1];
|
| | | }
|
| | | // 逆序
|
| | | else
|
| | | {
|
| | | _nextMapID = m_TransMapLine[_idx1 - 1];
|
| | | }
|
| | |
|
| | | // 先寻找传送点
|
| | | int _transportID = GetNextTransportID(PlayerDatas.Instance.baseData.MapID,
|
| | | _nextMapID);
|
| | | if (_transportID != -1)
|
| | | {
|
| | | var _curStage = StageLoad.Instance.currentStage as DungeonStage;
|
| | | if (_curStage)
|
| | | {
|
| | | Vector3 _moveToPos;
|
| | | if (_curStage.TryGetTransportPosition(_transportID, out _moveToPos))
|
| | | {
|
| | | while (true)
|
| | | {
|
| | | if (PathFinder.WalkAble(_hero.Pos, _moveToPos))
|
| | | {
|
| | | break;
|
| | | }
|
| | | var _nextPos = ClientSceneManager.Instance.GetTransPoint(_hero.Pos, _moveToPos);
|
| | | // 如果找到的下一个点
|
| | | if (!PathFinder.WalkAble(_hero.Pos, _nextPos)
|
| | | || _nextPos == Vector3.zero)
|
| | | {
|
| | | Debug.LogErrorFormat("移动至NPC: {0} 时找不到任何跳跃点", NpcID);
|
| | | break;
|
| | | }
|
| | | float _dis = MathUtility.DistanceSqrtXZ(_hero.Pos, _nextPos);
|
| | | while (_dis > 0.01f)
|
| | | {
|
| | | _dis = MathUtility.DistanceSqrtXZ(_hero.Pos, _nextPos);
|
| | | _hero.MoveToPosition(_nextPos);
|
| | | yield return null;
|
| | | }
|
| | | while (!GA_Hero.s_Flying)
|
| | | {
|
| | | yield return null;
|
| | | }
|
| | | while (GA_Hero.s_Flying)
|
| | | {
|
| | | yield return null;
|
| | | }
|
| | | }
|
| | | _hero.MoveToPosition(_moveToPos);
|
| | | yield break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | _MoveToNPC(NpcID, sid);
|
| | | yield break;
|
| | | }
|
| | | _destPostion = new Vector3(_npcLocation.position.x, 0, _npcLocation.position.y);
|
| | | }
|
| | |
|
| | | if (_destPostion == Vector3.zero)
|
| | | {
|
| | | Debug.LogErrorFormat("移动至NPC: {0} 时找不到一个可以到达的点.", npcID);
|
| | | Debug.LogErrorFormat("移动至NPC: {0} 时找不到一个可以到达的点.", NpcID);
|
| | | yield break;
|
| | | }
|
| | | float _dist = 0.01f;
|
| | | var _config = NPCConfig.Get(npcID);
|
| | | var _config = NPCConfig.Get(NpcID);
|
| | | if (_config != null)
|
| | | {
|
| | | _dist = Mathf.Max(GeneralDefine.CloseNpcDist + _config.ModelRadius - 0.3f, 0);
|
| | | }
|
| | | if (PathFinder.WalkAble(_hero.Pos, _destPostion, _dist) || npcID == 32504001)
|
| | | if (PathFinder.WalkAble(_hero.Pos, _destPostion, _dist) || NpcID == 32504001)
|
| | | {
|
| | | _MoveToNPC(npcID, sid);
|
| | | _MoveToNPC(NpcID, sid);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | if (!PathFinder.WalkAble(_hero.Pos, _nextPos)
|
| | | || _nextPos == Vector3.zero)
|
| | | {
|
| | | Debug.LogErrorFormat("移动至NPC: {0} 时找不到任何跳跃点", npcID);
|
| | | Debug.LogErrorFormat("移动至NPC: {0} 时找不到任何跳跃点", NpcID);
|
| | | break;
|
| | | }
|
| | | float _dis = MathUtility.DistanceSqrtXZ(_hero.Pos, _nextPos);
|
| | |
| | | yield return null;
|
| | | }
|
| | | }
|
| | | _MoveToNPC(npcID, sid);
|
| | | _MoveToNPC(NpcID, sid);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | Debug.LogFormat("想要切换至目标npc: {0}", npcID);
|
| | | #endif
|
| | |
|
| | | m_DelayMoveToNPC = false;
|
| | | m_TempNpcID = 0;
|
| | |
| | | _hero.Behaviour.StartHandupAI();
|
| | | Clear();
|
| | | }
|
| | | else
|
| | | {
|
| | | Debug.LogFormat("_npc == null : {0}, _chkDistSqrt < Mathf.Pow(_fightConfigDist, 2): {1}", _npc == null, _chkDistSqrt < Mathf.Pow(_fightConfigDist, 2));
|
| | | }
|
| | | }
|
| | | else if (_npcConfig.NPCType == (int)E_NpcType.Collect
|
| | | || _npcConfig.NPCType == (int)E_NpcType.Flag)
|
| | |
| | |
|
| | | public void Clear()
|
| | | {
|
| | | StopCoroutine("CoMoveToNPC");
|
| | | if (m_SwitchMapFinished)
|
| | | {
|
| | | StopCoroutine("CoMoveToNPC");
|
| | | NpcID = 0;
|
| | | MapTransferDoType = E_MapTransferDoType.None;
|
| | | m_DelayMoveToNPC = false;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | {
|
| | | public static Dictionary<MapArea.E_Type, List<MapArea>> s_MapAreaDict;
|
| | | public static MapType CurrentMapType;
|
| | | private static Dictionary<int, MapTransfer> s_MapTransferDict = new Dictionary<int, MapTransfer>();
|
| | |
|
| | | public override void Initialize()
|
| | | {
|
| | |
| | | base.UnInitialize();
|
| | |
|
| | | StopAllCoroutines();
|
| | |
|
| | | s_MapTransferDict.Clear();
|
| | | if (s_MapAreaDict != null)
|
| | | {
|
| | | foreach (var _list in s_MapAreaDict.Values)
|
| | |
| | |
|
| | | private void CreateMapTransfer()
|
| | | {
|
| | | s_MapTransferDict.Clear();
|
| | | // 创建传送点
|
| | | var _dict = maptransportConfig.GetValues();
|
| | | foreach (var _item in _dict)
|
| | |
| | | MapTransfer _maptransfer = _transport.AddMissingComponent<MapTransfer>();
|
| | | _maptransfer.transportModel = _item;
|
| | | _maptransfer.TransportID = _item.TransportID;
|
| | | s_MapTransferDict[_item.TransportID] = _maptransfer;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetTransportPosition(int id, out Vector3 pos)
|
| | | {
|
| | | if (s_MapTransferDict.ContainsKey(id))
|
| | | {
|
| | | pos = s_MapTransferDict[id].transform.position;
|
| | | return true;
|
| | | }
|
| | | pos = Vector3.zero;
|
| | | return false;
|
| | | }
|
| | |
|
| | | private IEnumerator CreateMapArea()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS200;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | MapTransferUtility.Instance.Clear();
|
| | | // MapTransferUtility.Instance.Clear();
|
| | | _hero.IdleImmediate();
|
| | | _hero.Behaviour.StopHandupAI();
|
| | | _hero.Behaviour.StopKillUntilDieAI();
|
| | |
| | | description = description,
|
| | | itemType = itemType,
|
| | | shopId = shopDict.ContainsKey(i) ? shopDict[i] : 0,
|
| | | composeCount = composeCount
|
| | | composeCount = composeCount,
|
| | | filterParams = new SinglePack.FilterParams()
|
| | | {
|
| | | itemTypes = new List<int>() { itemType },
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | return m_EquipGemRedpoints.TryGetValue(packIndex, out redpoint);
|
| | | }
|
| | |
|
| | | public bool TryGetRedpoint(int level,out Redpoint redpoint)
|
| | | public bool TryGetRedpoint(int level, out Redpoint redpoint)
|
| | | {
|
| | | return m_EquipSetRedpoints.TryGetValue(level, out redpoint);
|
| | | }
|
| | |
|
| | | public bool IsEquipGemHoleOpen(int level, int place, int hole)
|
| | | {
|
| | | var equipPosition = new Int2( level ,place);
|
| | | var equipPosition = new Int2(level, place);
|
| | | var equipGuid = equipModel.GetEquip(equipPosition);
|
| | | if (string.IsNullOrEmpty(equipGuid))
|
| | | {
|
| | |
| | | foreach (var type in types)
|
| | | {
|
| | | var gemType = m_GemTypes[type];
|
| | | var itemModels = packModel.GetItemsByType(PackType.Item, gemType.itemType);
|
| | | var itemModels = packModel.GetItems(PackType.Item, gemType.filterParams);
|
| | | if (itemModels != null)
|
| | | {
|
| | | foreach (var itemModel in itemModels)
|
| | |
| | | GemType gemType;
|
| | | TryGetGemType(type, out gemType);
|
| | | var count = 0;
|
| | | var items = packModel.GetItemsByType(PackType.Item, gemType.itemType);
|
| | | var items = packModel.GetItems(PackType.Item, gemType.filterParams);
|
| | | if (items == null)
|
| | | {
|
| | | return 0;
|
| | |
| | | GemType gemType;
|
| | | TryGetGemType(type, out gemType);
|
| | | var count = 0;
|
| | | var items = packModel.GetItemsByType(PackType.Item, gemType.itemType);
|
| | | var items = packModel.GetItems(PackType.Item, gemType.filterParams);
|
| | | if (items == null)
|
| | | {
|
| | | return 0;
|
| | |
| | | GemType gemType;
|
| | | TryGetGemType(type, out gemType);
|
| | | var count = 0;
|
| | | var items = packModel.GetItemsByType(PackType.Item, gemType.itemType);
|
| | | var items = packModel.GetItems(PackType.Item, gemType.filterParams);
|
| | | if (items == null)
|
| | | {
|
| | | return 0;
|
| | |
| | | public int itemType;
|
| | | public int shopId;
|
| | | public int composeCount;
|
| | | public SinglePack.FilterParams filterParams;
|
| | | }
|
| | |
|
| | | public class EquipGemRedpoint
|
| | |
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | RoleParticularModel roleParticularModel { get { return ModelCenter.Instance.GetModel<RoleParticularModel>(); } }
|
| | | FairyFeastModel model { get { return ModelCenter.Instance.GetModel<FairyFeastModel>(); } }
|
| | | EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
|
| | |
|
| | | public event Action<ulong> popUpExpEvent;
|
| | | public event Action onComplete;
|
| | |
| | |
|
| | | void DisplayPlayer()
|
| | | {
|
| | | var clothes = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Clothes);
|
| | | var clothesId = clothes == null ? 0 : (int)clothes.itemId;
|
| | | var appearance = equipModel.GetAppearance();
|
| | |
|
| | | var wings = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing);
|
| | | var wingsId = wings == null ? 0 : (int)wings.itemId;
|
| | |
|
| | | var secondary = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Weapon2);
|
| | | var secondaryId = secondary == null ? 0 : (int)secondary.itemId;
|
| | |
|
| | | var fashionClothes = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.FashionClothes);
|
| | | var fashionClothesId = fashionClothes == null ? 0 : (int)fashionClothes.itemId;
|
| | |
|
| | | var fashionSecondary = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.FashionWeapon2);
|
| | | var fashionSecondaryId = fashionSecondary == null ? 0 : (int)fashionSecondary.itemId;
|
| | | var clothesId = appearance.clothes;
|
| | | var wingsId = appearance.wings;
|
| | | var secondaryId = appearance.secondary;
|
| | | var fashionClothesId = appearance.fashionClothes;
|
| | | var fashionSecondaryId = appearance.fashionSecondary;
|
| | |
|
| | | var data = new UI3DPlayerExhibitionData
|
| | | {
|
| | |
| | | if (fashionTypeMapPlaceDict.ContainsKey(type)
|
| | | && fashionDressTypeDict.ContainsKey(type))
|
| | | {
|
| | | var equipPlace = fashionTypeMapPlaceDict[type];
|
| | | var equipType = fashionTypeMapPlaceDict[type];
|
| | | var equipPlace = EquipPlaceMapConfig.GetServerPlace(0, equipType);
|
| | | var itemModel = packModel.GetItemByIndex(PackType.Equip, (int)equipPlace);
|
| | | var list = fashionDressTypeDict[type];
|
| | | if (itemModel != null)
|
| | |
| | |
|
| | | var playerPack = ModelCenter.Instance.GetModel<PackModel>();
|
| | |
|
| | | var clothes = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Clothes);
|
| | | var clothesId = clothes == null ? 0 : (int)clothes.itemId;
|
| | | var appearance = ModelCenter.Instance.GetModel<EquipModel>().GetAppearance();
|
| | |
|
| | | var weapon = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Weapon);
|
| | | var weaponId = weapon == null ? 0 : (int)weapon.itemId;
|
| | |
|
| | | var wings = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing);
|
| | | var wingsId = wings == null ? 0 : (int)wings.itemId;
|
| | |
|
| | | var secondary = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Weapon2);
|
| | | var secondaryId = secondary == null ? 0 : (int)secondary.itemId;
|
| | | var clothesId = appearance.clothes;
|
| | | var wingsId = appearance.wings;
|
| | | var secondaryId = appearance.secondary;
|
| | | var weaponId = appearance.weapon;
|
| | |
|
| | | var fashionDressClothesId = 0;
|
| | | var fashionDressWeaponId = 0;
|
| | |
| | | private void CheckFairyLandGuard()
|
| | | {
|
| | | fairyLandGuard = false;
|
| | | var itemModel = pack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Guard1);
|
| | | var equipPlace = EquipPlaceMapConfig.GetServerPlace(0, (int)RoleEquipType.Guard1);
|
| | | var itemModel = pack.GetItemByIndex(PackType.Equip, equipPlace);
|
| | | if (itemModel == null || !fairyLandGuardItems.Contains(itemModel.itemId))
|
| | | {
|
| | | for (int i = 0; i < fairyLandGuardItems.Count; i++)
|
| | |
| | | {
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | |
|
| | | var clothes = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Clothes);
|
| | | var clothesId = clothes == null ? 0 : (int)clothes.itemId;
|
| | | var appearance = ModelCenter.Instance.GetModel<EquipModel>().GetAppearance();
|
| | |
|
| | | var weapon = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Weapon);
|
| | | var weaponId = weapon == null ? 0 : (int)weapon.itemId;
|
| | | var clothesId = appearance.clothes;
|
| | | var weaponId = appearance.weapon;
|
| | | var wingsId = appearance.wings;
|
| | | var secondaryId = appearance.secondary;
|
| | |
|
| | | var wings = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing);
|
| | | var wingsId = wings == null ? 0 : (int)wings.itemId;
|
| | |
|
| | | var secondary = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Weapon2);
|
| | | var secondaryId = secondary == null ? 0 : (int)secondary.itemId;
|
| | |
|
| | | var fashionClothes = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.FashionClothes);
|
| | | var fashionClothesId = fashionClothes == null ? 0 : (int)fashionClothes.itemId;
|
| | |
|
| | | var fashionWeapon = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.FashionWeapon);
|
| | | var fashionWeaponId = fashionWeapon == null ? 0 : (int)fashionWeapon.itemId;
|
| | |
|
| | | var fashionSecondary = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.FashionWeapon2);
|
| | | var fashionSecondaryId = fashionSecondary == null ? 0 : (int)fashionSecondary.itemId;
|
| | | var fashionClothesId = appearance.fashionClothes;
|
| | | var fashionWeaponId = appearance.fashionWeapon;
|
| | | var fashionSecondaryId = appearance.fashionWeapon;
|
| | |
|
| | | int _suitLevel = 0;
|
| | | UI3DPlayerExhibitionData data = new UI3DPlayerExhibitionData()
|
| | |
| | | } |
| | | } |
| | | |
| | | public List<ItemModel> GetItemsByType(PackType packType, int itemType) |
| | | { |
| | | if (playerPackDict.ContainsKey(packType)) |
| | | { |
| | | var singlePack = playerPackDict[packType]; |
| | | return singlePack.GetItemsByType(itemType); |
| | | } |
| | | else |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public List<ItemModel> GetItems(PackType packType, SinglePack.FilterParams param) |
| | | { |
| | | if (playerPackDict.ContainsKey(packType)) |
| | |
| | | {
|
| | | WindowCenter.Instance.Get<MainInterfaceWin>().IsShowButtonGroup();
|
| | | }
|
| | | //-----是否在自动强化中
|
| | | public bool StrengthegingBool = false;//是否再自动强化中
|
| | | public int StrengthegingAddFight = 0;//存取需要添加的战斗力值
|
| | | // --用于任务仙玉不足购买飞鞋
|
| | | public bool IsFlyShoseBool = false;
|
| | | public int FlyShoseTaskID = 0;
|
| | |
| | |
|
| | | //---------记录主界面Top面板是否在可见位置
|
| | | public bool MainTopPanelShow = true;
|
| | |
|
| | | public event Func<bool> customDisplayPower;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | {
|
| | | FlyShoseTaskID = 0;
|
| | | IsFlyShoseBool = false;
|
| | | StrengthegingAddFight = 0;
|
| | | StrengthegingBool = false;
|
| | | IsTipBool = true;
|
| | | prowNum = 0;
|
| | | ProwNumAdd = 0;
|
| | |
| | | if (power > prowNum)
|
| | | {
|
| | | ProwNumAdd = power - prowNum;
|
| | | if (StrengthegingBool || StrengthegingAddFight != 0)
|
| | | {
|
| | | StrengthegingAddFight += ProwNumAdd;
|
| | | }
|
| | | prowNum = power;
|
| | | if (!StrengthegingBool && StrengthegingAddFight == 0)
|
| | | if (customDisplayPower != null && customDisplayPower())
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<PowerAddWin>())
|
| | | {
|
| | | WindowCenter.Instance.Close<PowerAddWin>();
|
| | | }
|
| | | WindowCenter.Instance.Open<PowerAddWin>();
|
| | | return;
|
| | | }
|
| | |
|
| | | if (WindowCenter.Instance.IsOpen<PowerAddWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately("PowerAddWin");
|
| | | }
|
| | | WindowCenter.Instance.Open<PowerAddWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator LoadingIE()
|
| | | public void CustomPowerUp(int power)
|
| | | {
|
| | | yield return new WaitForSeconds(0.5f);
|
| | | ProwNumAdd = StrengthegingAddFight;
|
| | | StrengthegingAddFight = 0;
|
| | | ProwNumAdd = power;
|
| | | if (WindowCenter.Instance.IsOpen<PowerAddWin>())
|
| | | {
|
| | | WindowCenter.Instance.Close<PowerAddWin>();
|
| | |
| | | WindowCenter.Instance.Open<PowerAddWin>();
|
| | | }
|
| | |
|
| | | public void FabaoPowerAdd(int power)
|
| | | {
|
| | | ProwNumAdd = power;
|
| | | if (WindowCenter.Instance.IsOpen<PowerAddWin>())
|
| | | {
|
| | | WindowCenter.Instance.Close<PowerAddWin>();
|
| | | |
| | | }
|
| | | if (prowNum != 0)
|
| | | {
|
| | | prowNum += power;
|
| | | }
|
| | | WindowCenter.Instance.Open<PowerAddWin>();
|
| | | }
|
| | | public void KissMonsterExperience(int _source, int _ExpPoint, int _Exp)//(1.单位经验亿点,2.经验单位点)
|
| | | {
|
| | | if (Event_Experience != null)
|
| | |
| | | {
|
| | | type = WindowType.TreasureLevelUp;
|
| | | }
|
| | | else if (WindowCenter.Instance.IsOpen<RealmWin>())
|
| | | {
|
| | | type = WindowType.Realm;
|
| | | }
|
| | | var _index = powerUpPositions.FindIndex((x)=>
|
| | | {
|
| | | return x.windowType == type;
|
| | |
| | | {
|
| | | None,
|
| | | TreasureLevelUp,
|
| | | Realm,
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | [SerializeField, Header("小境界升级特效时长")] float m_NormalLevelUpEffectTime = 1.5f;
|
| | | [SerializeField, Header("大境界升级特效时长")] float m_SpecialLevelUpEffectTime = 4.5f;
|
| | | [SerializeField, Header("Boss特效时长")] float m_BossEffectTime = 2f;
|
| | |
|
| | | Coroutine m_RotateCoroutine = null;
|
| | |
|
| | | float m_DeltaAngle { get { return 360f / 8; } }
|
| | |
|
| | | public bool rotating { get; private set; }
|
| | | public bool isPlayingAnimation { get; private set; }
|
| | |
|
| | | public event Action onRotateComplete;
|
| | | public event Action onLevelUpComplete;
|
| | | public event Action onBossAppearComplete;
|
| | |
|
| | | RealmModel model { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
|
| | |
|
| | | public void SetDefault()
|
| | | {
|
| | | rotating = false;
|
| | | isPlayingAnimation = false;
|
| | | m_ContainerLine.gameObject.SetActive(false);
|
| | | for (int i = 0; i < m_RealmStages.Length; i++)
|
| | | {
|
| | |
| | | yield break;
|
| | | }
|
| | |
|
| | | isPlayingAnimation = true;
|
| | |
|
| | | if (m_EffectBoss.IsPlaying)
|
| | | {
|
| | | if (m_EffectBase.target != null)
|
| | |
| | | obj.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(m_BossEffectTime);
|
| | | if (onBossAppearComplete != null)
|
| | | {
|
| | | onBossAppearComplete();
|
| | | }
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(Mathf.Max(0f, 3.1f - m_BossEffectTime));
|
| | | }
|
| | |
|
| | | isPlayingAnimation = false;
|
| | |
|
| | | if (onLevelUpComplete != null)
|
| | | {
|
| | |
| | | public void Dispose()
|
| | | {
|
| | | rotating = false;
|
| | | isPlayingAnimation = false;
|
| | | StopAllCoroutines();
|
| | | if (m_RotateCoroutine != null)
|
| | | {
|
| | |
| | | {
|
| | | var _job = PlayerDatas.Instance.baseData.Job;
|
| | | #region 装备
|
| | | var clothes = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Clothes);
|
| | | var _clothesId = clothes == null ? 0 : (int)clothes.itemId;
|
| | | var appearance = ModelCenter.Instance.GetModel<EquipModel>().GetAppearance();
|
| | |
|
| | | var secondary = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Weapon2);
|
| | | var _secondaryId = secondary == null ? 0 : (int)secondary.itemId;
|
| | | var _clothesId = appearance.clothes;
|
| | | var _secondaryId = appearance.secondary;
|
| | |
|
| | | var fashionClothes = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.FashionClothes);
|
| | | var fashionClothesId = fashionClothes == null ? 0 : (int)fashionClothes.itemId;
|
| | |
|
| | | var fashionSecondary = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.FashionWeapon2);
|
| | | var fashionSecondaryId = fashionSecondary == null ? 0 : (int)fashionSecondary.itemId;
|
| | | var fashionClothesId = appearance.fashionClothes;
|
| | | var fashionSecondaryId = appearance.fashionSecondary;
|
| | | #endregion
|
| | |
|
| | | showPoint = m_HeroStage;
|
| | |
| | | [SerializeField] UIEffect m_EffectBase;
|
| | |
|
| | | int cacheRealmLevel = 0;
|
| | | long cacheFightPower = 0;
|
| | | long customUpPower = 0;
|
| | |
|
| | | const int REALM_STAGE_COUNT = 5;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | PlayerMainDate mainDateModel { get { return ModelCenter.Instance.GetModel<PlayerMainDate>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | |
| | | model.selectRealmRefresh += SelectRealmRefresh;
|
| | | m_RealmAnimation.onRotateComplete += OnRotateComplete;
|
| | | m_RealmAnimation.onLevelUpComplete += OnLevelUpComplete;
|
| | | m_RealmAnimation.onBossAppearComplete += OnBossAppearComplete;
|
| | | mainDateModel.customDisplayPower += CustomDisplayPower;
|
| | |
|
| | | cacheRealmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | cacheFightPower = PlayerDatas.Instance.baseData.FightPoint;
|
| | | customUpPower = 0;
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | |
| | | model.selectRealmRefresh -= SelectRealmRefresh;
|
| | | m_RealmAnimation.onRotateComplete -= OnRotateComplete;
|
| | | m_RealmAnimation.onLevelUpComplete -= OnLevelUpComplete;
|
| | | m_RealmAnimation.onBossAppearComplete -= OnBossAppearComplete;
|
| | | mainDateModel.customDisplayPower -= CustomDisplayPower;
|
| | |
|
| | | HideRealmUp();
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | else if (dataType == PlayerDataType.FightPower)
|
| | | {
|
| | | if (CustomDisplayPower())
|
| | | {
|
| | | customUpPower += (PlayerDatas.Instance.baseData.FightPoint - cacheFightPower);
|
| | | }
|
| | | cacheFightPower = PlayerDatas.Instance.baseData.FightPoint;
|
| | | }
|
| | | }
|
| | |
|
| | | private void TryStartAnimation()
|
| | |
| | | TryStartAnimation();
|
| | | }
|
| | | }
|
| | |
|
| | | if (customUpPower != 0)
|
| | | {
|
| | | mainDateModel.CustomPowerUp((int)customUpPower);
|
| | | customUpPower = 0;
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnBossAppearComplete()
|
| | | {
|
| | | m_GotoBoss.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | private bool CustomDisplayPower()
|
| | | {
|
| | | return m_RealmAnimation.isPlayingAnimation;
|
| | | }
|
| | |
|
| | | private void SelectRealmRefresh()
|
| | |
| | | {
|
| | | targetCompareTxt.text = string.Format(viewRoleFuncModel.compareTip, Language.Get("RoleParticularWin_7"));
|
| | | }
|
| | | ItemModel itemModel = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing);
|
| | | var equipPlace = EquipPlaceMapConfig.GetServerPlace(0, (int)RoleEquipType.Wing);
|
| | | var itemModel = playerPack.GetItemByIndex(PackType.Equip, equipPlace);
|
| | | if (itemModel != null)
|
| | | {
|
| | | ItemConfig _tagChinItemModel = ItemConfig.Get((int)itemModel.itemId);
|
| | |
| | | break;
|
| | | case TreasurePrivilege.Wing:
|
| | | var percentWing = (float)special.propertyDict[86] / 10000;
|
| | | var itemModel = pack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing);
|
| | | var equipPlace = EquipPlaceMapConfig.GetServerPlace(0, (int)RoleEquipType.Wing);
|
| | | var itemModel = pack.GetItemByIndex(PackType.Equip, equipPlace);
|
| | | m_ContainerHas.gameObject.SetActive(itemModel != null);
|
| | | m_ContainerNone.gameObject.SetActive(itemModel == null);
|
| | | if (itemModel != null)
|
| | |
| | | break;
|
| | | case TreasurePrivilege.Wing:
|
| | | var percentWing = (float)special.propertyDict[86] / 10000;
|
| | | var itemModel = pack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing);
|
| | | var equipPlace = EquipPlaceMapConfig.GetServerPlace(0, (int)RoleEquipType.Wing);
|
| | | var itemModel = pack.GetItemByIndex(PackType.Equip, equipPlace);
|
| | | m_ContainerPreview.gameObject.SetActive(itemModel != null);
|
| | | if (itemModel != null)
|
| | | {
|
| | |
| | | var _job = PlayerDatas.Instance.baseData.Job;
|
| | |
|
| | | #region 装备
|
| | | var clothes = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Clothes);
|
| | | var _clothesId = clothes == null ? 0 : (int)clothes.itemId;
|
| | | var appearance = ModelCenter.Instance.GetModel<EquipModel>().GetAppearance();
|
| | |
|
| | | var weapon = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Weapon);
|
| | | var _weaponId = weapon == null ? 0 : (int)weapon.itemId;
|
| | |
|
| | | var wings = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing);
|
| | | var _wingsId = wings == null ? 0 : (int)wings.itemId;
|
| | |
|
| | | var secondary = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Weapon2);
|
| | | var _secondaryId = secondary == null ? 0 : (int)secondary.itemId;
|
| | |
|
| | | var fashionClothes = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.FashionClothes);
|
| | | var fashionClothesId = fashionClothes == null ? 0 : (int)fashionClothes.itemId;
|
| | |
|
| | | var fashionWeapon = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.FashionWeapon);
|
| | | var fashionWeaponId = fashionWeapon == null ? 0 : (int)fashionWeapon.itemId;
|
| | |
|
| | | var fashionSecondary = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.FashionWeapon2);
|
| | | var fashionSecondaryId = fashionSecondary == null ? 0 : (int)fashionSecondary.itemId;
|
| | | var _clothesId = appearance.clothes;
|
| | | var _wingsId = appearance.wings;
|
| | | var _secondaryId = appearance.secondary;
|
| | | var _weaponId = appearance.weapon;
|
| | | var fashionClothesId = appearance.fashionClothes;
|
| | | var fashionWeaponId = appearance.fashionWeapon;
|
| | | var fashionSecondaryId = appearance.fashionSecondary;
|
| | |
|
| | | int _suitLevel = 0;
|
| | | #endregion
|