Merge remote-tracking branch 'origin/master' into DownLoad
| | |
| | | public static void Init()
|
| | | {
|
| | | // 登记相应的数据体及对应的数据转逻辑类
|
| | | Register(typeof(HB913_tagGCEnterTeamFBFailReason), typeof(DTCB913_tagGCEnterTeamFBFailReason));
|
| | | Register(typeof(H0311_tagDeleteSkill), typeof(DTC0311_tagDeleteSkill));
|
| | | Register(typeof(HB106_tagMCNotifyPlayerMove), typeof(DTCB106_tagMCNotifyPlayerMove));
|
| | | Register(typeof(H0132_tagCreateRoleSucess), typeof(DTC0132_tagCreateRoleSucess));
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, August 20, 2018
|
| | | // [ Date ]: Thursday, November 01, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using UnityEngine;
|
| | |
| | | public int NPCEffect { get ; private set ; }
|
| | | public int NPCSpeakID { get ; private set ; }
|
| | | public int ClientRealm { get ; private set ; }
|
| | | public string Equips { get ; private set; } |
| | |
|
| | | public override string getKey()
|
| | | {
|
| | |
| | | NPCSpeakID=IsNumeric(rawContents[56]) ? int.Parse(rawContents[56]):0;
|
| | |
|
| | | ClientRealm=IsNumeric(rawContents[57]) ? int.Parse(rawContents[57]):0;
|
| | | |
| | | Equips = rawContents[58].Trim();
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Saturday, January 06, 2018 |
| | | // [ Date ]: Thursday, November 01, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | |
| | | public partial class PetClassCostConfig : ConfigBase { |
| | | |
| | | public int ID { get ; private set ; } |
| | | public int PetID { get ; private set ; } |
| | | public int Rank { get ; private set ; } |
| | | public int UpNeedExp { get ; private set ; } |
| | | public int AtkAdd { get ; private set ; } |
| | | public int ID { get ; private set ; }
|
| | | public int PetID { get ; private set ; }
|
| | | public int Rank { get ; private set ; }
|
| | | public int UpNeedExp { get ; private set ; }
|
| | | public int AtkAdd { get ; private set ; }
|
| | | public int NeedExpTotal { get ; private set ; } |
| | | |
| | | public override string getKey() |
| | | { |
| | |
| | | public override void Parse() { |
| | | try |
| | | { |
| | | ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | PetID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; |
| | | |
| | | Rank=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | |
| | | UpNeedExp=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | |
| | | AtkAdd=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | PetID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; |
| | | |
| | | Rank=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | |
| | | UpNeedExp=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | |
| | | AtkAdd=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | |
| | | NeedExpTotal=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a58409c48a307e24eb39a8c2e933c8e8 |
| | | timeCreated: 1515213576 |
| | | licenseType: Pro |
| | | timeCreated: 1541079969 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | |
| | | OpenServerRealm = 15,
|
| | | OpenServerFightPower = 16,
|
| | | Def_BT_FCCostGold = 17, //消费排行榜(仙界盛典)
|
| | | OpenServerRune = 18,
|
| | | }
|
| | |
|
| | | public class RankData
|
| | |
| | | private static Dictionary<int, List<StoreConfig>> storeConfigs = new Dictionary<int, List<StoreConfig>>();
|
| | | public void OnConfigParseCompleted()
|
| | | {
|
| | | if (ShopType == 0) return;
|
| | |
|
| | | if (!s_storeModelDict.ContainsKey(ShopType))
|
| | | {
|
| | | List<StoreConfig> modellist = new List<StoreConfig>();
|
| | |
| | | public class CA704_tagCMPetClassUP : GameNetPackBasic {
|
| | | public byte PetItemIndex; //宠物数据背包索引
|
| | | public ushort UseItemCnt; //消耗材料个数
|
| | | public byte IsAutoBuy; //是否自动购买
|
| | |
|
| | | public CA704_tagCMPetClassUP () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | |
| | | public override void WriteToBytes () {
|
| | | WriteBytes (PetItemIndex, NetDataType.BYTE);
|
| | | WriteBytes (UseItemCnt, NetDataType.WORD);
|
| | | WriteBytes (IsAutoBuy, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | if (vNetData.HurtCount > 0)
|
| | | {
|
| | | if (_skill.id != _attacker.SkillMgr.CurCastSkill.id)
|
| | | if (_attacker.SkillMgr.CurCastSkill != null
|
| | | && _skill.id != _attacker.SkillMgr.CurCastSkill.id)
|
| | | {
|
| | | _skill.ClearServerHurtList();
|
| | | }
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, November 01, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using Snxxz.UI;
|
| | | public class DTCB913_tagGCEnterTeamFBFailReason : DtcBasic {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HB913_tagGCEnterTeamFBFailReason;
|
| | | TeamFailEnterDungeonHandle.Instance.ReceiveReason(package);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 97a0a264acd98384886c8277d4a2ebf7 |
| | | timeCreated: 1541057447 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B9 13 进入组队副本失败原因 #tagGCEnterTeamFBFailReason
|
| | |
|
| | | public class HB913_tagGCEnterTeamFBFailReason : GameNetPackBasic {
|
| | | public uint MapID; // 请求进入的地图ID
|
| | | public byte AskType; // 请求类型: 0-匹配请求;1-进入请求
|
| | | public byte Reason; // 失败原因:2-次数不足;3-进入CD中;6-门票不足
|
| | |
|
| | | public HB913_tagGCEnterTeamFBFailReason () {
|
| | | _cmd = (ushort)0xB913;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out MapID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out AskType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out Reason, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a57b7f9855954f1458d169cd9cb7459c |
| | | timeCreated: 1541057414 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | |
|
| | | public class StatusMgr : SingletonMonobehaviour<StatusMgr>
|
| | | {
|
| | | public static event UnityAction<string> OnGainStatus;
|
| | | public static event UnityAction<int> OnGainStatus;
|
| | |
|
| | | private Dictionary<uint, List<Status_Base>> m_StatusDict = null;
|
| | | private List<Status_Base> m_AllStatus = null;
|
| | |
| | | {
|
| | | if (OnGainStatus != null)
|
| | | {
|
| | | SkillConfig _skillConfig = Config.Instance.Get<SkillConfig>(h0605.SkillID);
|
| | | if (_skillConfig != null)
|
| | | {
|
| | | OnGainStatus(_skillConfig.SkillName);
|
| | | }
|
| | | OnGainStatus(h0605.SkillID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | currentEquipGuid = string.Empty;
|
| | | }
|
| | |
|
| | | #region 解析本地表
|
| | | public int autoEquipLvLimit { get; private set; }
|
| | | public int autoEquipCoolTime { get; private set; }
|
| | |
|
| | | public void ParseConfig()
|
| | | {
|
| | | FuncConfigConfig equipAutoEquip = Config.Instance.Get<FuncConfigConfig>("EquipAutoEquip");
|
| | | autoEquipLvLimit = int.Parse(equipAutoEquip.Numerical1);
|
| | | autoEquipCoolTime = int.Parse(equipAutoEquip.Numerical2);
|
| | |
|
| | | }
|
| | | #endregion
|
| | | public bool TryGetBetterEquip(string _guid, out ItemModel _equip)
|
| | | {
|
| | | return betterEquipModels.TryGetValue(_guid, out _equip);
|
| | |
| | | {
|
| | | showEquipRefreshEvent();
|
| | | }
|
| | | if(betterModel.chinItemModel.ItemColor < 3)
|
| | | {
|
| | | |
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | IEnumerator Co_DelayRefreshBetterEquip(string _guid)
|
| | |
| | | public const string RUNE_SPECIAL_HOLE = "RuneSpecialHole";
|
| | | public const string LEAGUE_NOTICE_REDPOINT = "LeagueNoticeRedpoint";
|
| | | public const string FAIRYGRABBOSS_NOTICE_REDPOINT = "FairyGrabBossRedpoint";
|
| | | public const string TEAM_TICKET_FAIRYLAND = "TeamTicketFairyLand";
|
| | | public Dictionary<string, int[]> dayRemindDic = new Dictionary<string, int[]>();
|
| | |
|
| | | public bool GetDayRemind(string _remindKey)
|
| | |
| | | SetDayRemind(RUNE_SPECIAL_HOLE);
|
| | | SetDayRemind(LEAGUE_NOTICE_REDPOINT);
|
| | | SetDayRemind(FAIRYGRABBOSS_NOTICE_REDPOINT);
|
| | | SetDayRemind(TEAM_TICKET_FAIRYLAND);
|
| | | }
|
| | |
|
| | | private void SetDayRemind(string _key)
|
| | |
| | | {
|
| | | assistEffect.Play();
|
| | | assistTextEffect.Play();
|
| | | model.SendChangeDogzAssist(1);
|
| | | model.SendChangeDogzAssist(1,model.presentSelectDogz);
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("AssistDogzReachMax");
|
| | | int minAssistDogzId = model.GetMinAssistDogzId();
|
| | | if(model.presentSelectDogz > minAssistDogzId)
|
| | | {
|
| | | model.SendChangeDogzAssist(0,minAssistDogzId);
|
| | | model.SendChangeDogzAssist(1,model.presentSelectDogz);
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("AssistDogzReachMax");
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | model.SendChangeDogzAssist(0);
|
| | | model.SendChangeDogzAssist(0,model.presentSelectDogz);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | itemBaisc.gameObject.SetActive(true);
|
| | | itemBaisc.Init(model,true);
|
| | | itemBaisc.stateIcon.gameObject.SetActive(dogzModel.IsReachPutlimit(dogzModel.presentSelectDogz, model.itemId));
|
| | | itemBaisc.bindIcon.gameObject.SetActive(false);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | |
| | | return state == 0 ? false : true;
|
| | | }
|
| | |
|
| | | public int GetMinAssistDogzId()
|
| | | {
|
| | | int minAssistId = 0;
|
| | | foreach (var dogzId in dogzAssistStateDict.Keys)
|
| | | {
|
| | | if (TryGetAssistDogzState(dogzId)
|
| | | && ((minAssistId > dogzId && minAssistId != 0) || minAssistId == 0))
|
| | | {
|
| | | minAssistId = dogzId;
|
| | | }
|
| | | }
|
| | | return minAssistId;
|
| | | }
|
| | |
|
| | | public void SetDogzEquipInfo()
|
| | | {
|
| | | m_DogzEquipDict.Clear();
|
| | |
| | | return (index % 5) + 101;
|
| | | }
|
| | |
|
| | | public int GetDogzIndexByPlace(int place)
|
| | | {
|
| | | return (place / 100) - 1;
|
| | | }
|
| | |
|
| | | public int GetDogzIDByIndex(int index)
|
| | | {
|
| | | return (index / 5) + 1;
|
| | |
| | | GameNetSystem.Instance.SendInfo(dogzPutOff);
|
| | | }
|
| | |
|
| | | public void SendChangeDogzAssist(int assistState)
|
| | | public void SendChangeDogzAssist(int assistState,int dogzId)
|
| | | {
|
| | | CA5C2_tagCMDogzBattleStateChange stateChange = new CA5C2_tagCMDogzBattleStateChange();
|
| | | stateChange.DogzID = (byte)presentSelectDogz;
|
| | | stateChange.DogzID = (byte)dogzId;
|
| | | stateChange.BatteState = (byte)assistState;
|
| | | GameNetSystem.Instance.SendInfo(stateChange);
|
| | | }
|
| | |
| | | return selectEquipPlacelist;
|
| | | }
|
| | |
|
| | | public bool IsReachPutlimit(int dogzId,int itemId)
|
| | | {
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(itemId);
|
| | | if (itemConfig == null) return true;
|
| | |
|
| | | var index = GetDogzIndexByPlace(itemConfig.EquipPlace);
|
| | | var _itemColor = GetDogzEquipLimitByIndex(dogzId, index);
|
| | | return itemConfig.ItemColor >= _itemColor ? true : false;
|
| | | }
|
| | |
|
| | | private int CompareByDogzItem(ItemModel start,ItemModel end)
|
| | | {
|
| | | int x = start.chinItemModel.ItemColor;
|
| | |
| | | }
|
| | |
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= curSumAssistNum ? true : false;
|
| | | int minAlreadyAssistId = 0;
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | if (TryGetAssistDogzState(dogzId)
|
| | | && ((minAlreadyAssistId > dogzId && minAlreadyAssistId != 0) || minAlreadyAssistId == 0))
|
| | | {
|
| | | minAlreadyAssistId = dogzId;
|
| | | }
|
| | | }
|
| | | int minAlreadyAssistId = GetMinAssistDogzId();
|
| | |
|
| | | if (!isMaxAssistNum)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public event Action UpdateDogzPutRedEvent;
|
| | | public int dogzPutRedId { get;set; }
|
| | |
|
| | | public void UpdateDogzEquipPlaceRed()
|
| | | {
|
| | | dogzPutRedId = 0;
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Dogz)) return;
|
| | |
|
| | | foreach (var value in dogzEquipPlaceRedDict.Values)
|
| | |
| | | {
|
| | | if(value.state == RedPointState.Simple)
|
| | | {
|
| | | if (UpdateDogzPutRedEvent != null)
|
| | | {
|
| | | UpdateDogzPutRedEvent();
|
| | | }
|
| | | return;
|
| | | }
|
| | | }
|
| | | int minAssistDogzId = GetMinAssistDogzId();
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= curSumAssistNum ? true : false;
|
| | | List<int> dogzIdlist = GetDogzIdByOrder();
|
| | | if (!isMaxAssistNum)
|
| | | {
|
| | | int maxEquipNum = 0;
|
| | | int spaceDogzId = 0;
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | for(int i = 0; i < dogzIdlist.Count; i++)
|
| | | {
|
| | | int dogzId = dogzIdlist[i];
|
| | | var equips = GetDogzEquips(dogzId);
|
| | | int equipNum = equips == null ? 0 : equips.Count;
|
| | | if (equipNum < 5)
|
| | |
| | | Redpoint equipPlaceRedpoint = GetDogzEquipPlaceRedpointById(spaceDogzId,i);
|
| | | if(equipPlaceRedpoint.state == RedPointState.None)
|
| | | {
|
| | | dogzPutRedId = spaceDogzId;
|
| | | equipPlaceRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | break;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | int minAlreadyAssistId = 0;
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | if(TryGetAssistDogzState(dogzId)
|
| | | && ((minAlreadyAssistId > dogzId && minAlreadyAssistId != 0) || minAlreadyAssistId == 0))
|
| | | {
|
| | | minAlreadyAssistId = dogzId;
|
| | | }
|
| | | }
|
| | |
|
| | | int minAlreadyAssistId = GetMinAssistDogzId();
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | var equips = GetDogzEquips(dogzId);
|
| | |
| | | Redpoint equipPlaceRedpoint = GetDogzEquipPlaceRedpointById(dogzId, i);
|
| | | if (equipPlaceRedpoint.state == RedPointState.None)
|
| | | {
|
| | | dogzPutRedId = dogzId;
|
| | | equipPlaceRedpoint.state = RedPointState.Simple;
|
| | | break;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if(UpdateDogzPutRedEvent != null)
|
| | | {
|
| | | UpdateDogzPutRedEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | public List<int> GetDogzIdByOrder()
|
| | | {
|
| | | List<int> dogzIdlist = m_DogzEquipLimit.Keys.ToList();
|
| | | int minAssistDogzId = GetMinAssistDogzId();
|
| | | if (minAssistDogzId == 0) return dogzIdlist;
|
| | |
|
| | | List<int> orderlist = new List<int>();
|
| | | for(int i = 0; i < dogzIdlist.Count; i++)
|
| | | {
|
| | | int dogzId = dogzIdlist[i];
|
| | | if(dogzId > minAssistDogzId)
|
| | | {
|
| | | orderlist.Add(dogzId);
|
| | | }
|
| | | }
|
| | |
|
| | | for (int i = dogzIdlist.Count - 1; i > -1; i--)
|
| | | {
|
| | | int dogzId = dogzIdlist[i];
|
| | | if(!orderlist.Contains(dogzId))
|
| | | {
|
| | | orderlist.Add(dogzId);
|
| | | }
|
| | | }
|
| | | return orderlist;
|
| | | }
|
| | |
|
| | | public void UpdateAssistNumRed()
|
| | |
| | | addAssistDogzRedpoint.state = RedPointState.None;
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
| | | [SerializeField]
|
| | | List<Text> targetTextList;
|
| | |
|
| | | [SerializeField] RectTransform m_FairyLandUpperBehaviour;
|
| | | [SerializeField] Text m_FairyLandUpperTip;
|
| | | [SerializeField] PositionTween m_PositionTween;
|
| | | [SerializeField] ScaleTween m_ScaleTween;
|
| | | [SerializeField] RectTransform[] m_MoveRects;
|
| | |
|
| | | DungeonModel m_Model;
|
| | | DungeonModel model
|
| | | {
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | m_FairyLandUpperBehaviour.gameObject.SetActive(false);
|
| | | SetTween(m_PositionTween, m_ScaleTween, 0);
|
| | |
|
| | | StageChangeEvent();
|
| | | MyTeamRefreshEvent();
|
| | | DungeonEncourageEvent();
|
| | | UpdateBuf();
|
| | | model.dungeonFairyLandChangeEvent += StageChangeEvent;
|
| | | model.dungeonInspireLvEvent += DungeonEncourageEvent;
|
| | | PlayerBuffDatas.Even_ObjAddBuf += UpdateBuf;
|
| | | PlayerBuffDatas.Even_ObjDelBuff += UpdateBuf;
|
| | | PlayerBuffDatas.Even_ObjAddBuf += AddBuff;
|
| | | PlayerBuffDatas.Even_ObjDelBuff += DeleteBuff;
|
| | | teamModel.myTeamRefreshEvent += MyTeamRefreshEvent;
|
| | | }
|
| | |
|
| | |
| | | _teamOnlineCnt == 0 ? "<color=#ff2828>" : "<color=#00ff00>", Mathf.Max(0, _teamOnlineCnt - 1) * 10, "%</color>");
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | DisplayBuff();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
| | | {
|
| | | model.dungeonFairyLandChangeEvent -= StageChangeEvent;
|
| | | model.dungeonInspireLvEvent -= DungeonEncourageEvent;
|
| | | PlayerBuffDatas.Even_ObjAddBuf -= UpdateBuf;
|
| | | PlayerBuffDatas.Even_ObjDelBuff -= UpdateBuf;
|
| | | PlayerBuffDatas.Even_ObjAddBuf -= AddBuff;
|
| | | PlayerBuffDatas.Even_ObjDelBuff -= DeleteBuff;
|
| | | teamModel.myTeamRefreshEvent -= MyTeamRefreshEvent;
|
| | | }
|
| | |
|
| | |
| | | var level = model.GetDungeonInspireLevel();
|
| | | targetTextList[3].text = level == 0 ? StringUtility.Contact(Language.Get("FairyLand_Func3"), ":", Language.Get("FairyLand_Func4"))
|
| | | : StringUtility.Contact(Language.Get("FairyLand_Func3"), ":<color=#00ff00>", level * model.GetDungeonInspireUpper(31080), "%</color>");
|
| | | }
|
| | |
|
| | | private void AddBuff()
|
| | | {
|
| | | UpdateBuf();
|
| | | DisplayBuff();
|
| | | }
|
| | |
|
| | | private void DeleteBuff()
|
| | | {
|
| | | UpdateBuf();
|
| | | DisplayBuff();
|
| | | }
|
| | |
|
| | | private void UpdateBuf()
|
| | |
| | | }
|
| | | targetTextList[4].text = StringUtility.Contact(Language.Get("FairyLand_Func1"), ":", Language.Get("FairyLand_Func2"));
|
| | | }
|
| | |
|
| | | private void DisplayBuff()
|
| | | {
|
| | | var gainBuff = Buffmodel._BuffDic.ContainsKey(GeneralDefine.fairyLandBuffId);
|
| | | var config = Config.Instance.Get<SkillConfig>(GeneralDefine.fairyLandBuffId);
|
| | | if (config != null)
|
| | | {
|
| | | m_FairyLandUpperTip.text = UIHelper.ReplaceNewLine(Language.Get("XjmjAddHarm2",
|
| | | GeneralDefine.fairyLandBuffCondition, config.EffectValue11 / 10000 + 1));
|
| | | }
|
| | | if (!gainBuff)
|
| | | {
|
| | | if (m_FairyLandUpperBehaviour.gameObject.activeSelf)
|
| | | {
|
| | | m_FairyLandUpperBehaviour.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!m_FairyLandUpperBehaviour.gameObject.activeSelf)
|
| | | {
|
| | | SetTween(m_PositionTween, m_ScaleTween, 0);
|
| | | m_FairyLandUpperBehaviour.gameObject.SetActive(true);
|
| | | m_PositionTween.Play(OnPositionTweenComplete);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnPositionTweenComplete()
|
| | | {
|
| | | SetTween(m_PositionTween, m_ScaleTween, 1);
|
| | | m_PositionTween.Play();
|
| | | m_ScaleTween.Play();
|
| | | }
|
| | |
|
| | | private void SetTween(PositionTween _posTween, ScaleTween _scaleTween, int index)
|
| | | {
|
| | | _posTween.from = m_MoveRects[index].localPosition;
|
| | | _posTween.to = m_MoveRects[index + 1].localPosition;
|
| | | _posTween.duration = index == 0 ? 2f : 1f;
|
| | | _posTween.delay = index == 0 ? 0 : 1.0f;
|
| | | _posTween.SetStartState();
|
| | | if (index == 0)
|
| | | {
|
| | | _scaleTween.SetStartState();
|
| | | }
|
| | | else
|
| | | {
|
| | | _scaleTween.delay = 1.0f;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | SetTween(m_PositionTween, m_ScaleTween, 1);
|
| | | m_PositionTween.SetEndState();
|
| | | m_ScaleTween.SetEndState();
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | [ContextMenu("Test")]
|
| | | void Test()
|
| | | {
|
| | | SetTween(m_PositionTween, m_ScaleTween, 0);
|
| | | m_FairyLandUpperBehaviour.gameObject.SetActive(true);
|
| | | m_PositionTween.Play(OnPositionTweenComplete);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | [SerializeField] RectTransform m_ContainerGroup;
|
| | |
|
| | | [SerializeField] RectTransform m_FairyLandTipBehaviour;
|
| | | [SerializeField] Text m_FairyLandTip;
|
| | |
|
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | TeamModel teamModel { get { return ModelCenter.Instance.GetModel<TeamModel>(); } }
|
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
| | | DrawDungeonBaseInfo();
|
| | | DrawSweepInfo();
|
| | | DrawDungeonTicketInfo();
|
| | | DisplayFairyLandTip();
|
| | | m_BreifInfo.SetDungeonInfo(model.currentDungeon);
|
| | | }
|
| | |
|
| | |
| | | playerPack.RefreshItemCountAct += OnPackageItemChange;
|
| | | model.updateDungeonEnterCD += UpdateDungeonEnterCD;
|
| | | m_EnterCdContainer.OnCdComplete += UpdateDungeonEnterCD;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | PlayerDatas.Instance.OnRoleAttrRefresh += OnWorldLevelRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | |
| | | playerPack.RefreshItemCountAct -= OnPackageItemChange;
|
| | | model.updateDungeonEnterCD -= UpdateDungeonEnterCD;
|
| | | m_EnterCdContainer.OnCdComplete -= UpdateDungeonEnterCD;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
|
| | | PlayerDatas.Instance.OnRoleAttrRefresh -= OnWorldLevelRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | bool _cd = model.HasEnterCD(dungeonConfig.DataMapID) && model.IsEnterCountDowning(dungeonConfig.DataMapID);
|
| | | m_EnterCdContainer.gameObject.SetActive(_cd);
|
| | | m_ContainerBtns.gameObject.SetActive(!_cd);
|
| | | DisplayFairyLandTip();
|
| | | }
|
| | |
|
| | | private void DrawDungeonBaseInfo()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
|
| | | {
|
| | | if (refreshType == PlayerDataRefresh.LV)
|
| | | {
|
| | | DisplayFairyLandTip();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnWorldLevelRefresh()
|
| | | {
|
| | | DisplayFairyLandTip();
|
| | | }
|
| | |
|
| | | private void DisplayFairyLandTip()
|
| | | {
|
| | | var dungeonId = model.GetDungeonId(model.currentDungeon);
|
| | | var dungeonConfig = Config.Instance.Get<DungeonConfig>(dungeonId);
|
| | | bool cd = model.HasEnterCD(dungeonConfig.DataMapID) && model.IsEnterCountDowning(dungeonConfig.DataMapID);
|
| | | var satisfy = (PlayerDatas.Instance.baseData.LV + GeneralDefine.fairyLandBuffCondition) <= PlayerDatas.Instance.worldLv && !cd;
|
| | | m_FairyLandTipBehaviour.gameObject.SetActive(satisfy);
|
| | | var config = Config.Instance.Get<SkillConfig>(GeneralDefine.fairyLandBuffId);
|
| | | if (config != null)
|
| | | {
|
| | | m_FairyLandTip.text = UIHelper.ReplaceNewLine(Language.Get("XjmjAddHarm1",
|
| | | GeneralDefine.fairyLandBuffCondition, config.EffectValue11 / 10000 + 1));
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public static int medQualityCount { get; private set; } |
| | | public static int highQualityCount { get; private set; } |
| | | |
| | | public static int fairyLandBuffCondition { get; private set; } |
| | | public static int fairyLandBuffId { get; private set; } |
| | | |
| | | public static void Init() |
| | | { |
| | | try |
| | |
| | | lowQualityCount = int.Parse(func.Numerical1); |
| | | medQualityCount = int.Parse(func.Numerical2); |
| | | highQualityCount = int.Parse(func.Numerical3); |
| | | |
| | | fairyLandBuffCondition = GetInt("XjmjAddHarm", 1); |
| | | fairyLandBuffId = GetInt("XjmjAddHarm", 2); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| New file |
| | |
| | | using System;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class DogzNotifyBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Text titleText;
|
| | | [SerializeField] Image dogzImg;
|
| | | [SerializeField] Button gotoBtn;
|
| | | [SerializeField] Button closeBtn;
|
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | closeBtn.AddListener(CloseNotify);
|
| | | gotoBtn.AddListener(ClickGoto);
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | closeBtn.RemoveAllListeners();
|
| | | gotoBtn.RemoveAllListeners();
|
| | | }
|
| | |
|
| | | public void SetDisplay()
|
| | | {
|
| | | DogzConfig dogzConfig = Config.Instance.Get<DogzConfig>(dogzModel.dogzPutRedId);
|
| | | if(dogzConfig == null)
|
| | | {
|
| | | CloseNotify();
|
| | | }
|
| | | else
|
| | | {
|
| | | this.gameObject.SetActive(true);
|
| | | dogzImg.SetSprite(dogzConfig.HeadIcon);
|
| | | }
|
| | | }
|
| | |
|
| | | private void ClickGoto()
|
| | | {
|
| | | WindowCenter.Instance.Open<DogzWin>();
|
| | | CloseNotify();
|
| | | }
|
| | |
|
| | | public void CloseNotify()
|
| | | {
|
| | | dogzModel.dogzPutRedId = 0;
|
| | | this.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 02dfbf58d32aa544aa139b28100aa5d2 |
| | | timeCreated: 1541055844 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | }
|
| | |
|
| | | int dungeonID = playerPack.GetDungeonIDByDrugID(useItemModel.itemInfo.ItemID);
|
| | | if (dungeonID != 0 && useItemModel.chinItemModel.Type == (int)ItemType.Buff)
|
| | | if (dungeonID != 0)
|
| | | {
|
| | | MapConfig tagMapModel = Config.Instance.Get<MapConfig>(PlayerDatas.Instance.baseData.MapID);
|
| | | if (tagMapModel.MapFBType == 0)
|
| | |
| | | public int wingsRedpointLvlimt { get; private set; }
|
| | | public int fairyGetPathId { get; private set; }
|
| | | public Dictionary<int, int> wingsGetPathIdDict { get; private set;}
|
| | | public Dictionary<int, List<int>> dungeonUseDict { get; private set; }
|
| | | public void ParseConfig()
|
| | | {
|
| | | FuncConfigConfig funcConfig = Config.Instance.Get<FuncConfigConfig>("WingYuPeiHQTJ");
|
| | |
| | | wingsRedpointLvlimt = int.Parse(funcConfig.Numerical2);
|
| | | fairyGetPathId = int.Parse(funcConfig.Numerical3);
|
| | | wingsGetPathIdDict = ConfigParse.GetDic<int, int>(funcConfig.Numerical4);
|
| | | FuncConfigConfig copyItemBulletWindow = Config.Instance.Get<FuncConfigConfig>("CopyItemBulletWindow");
|
| | | JsonData copyWinData = JsonMapper.ToObject(copyItemBulletWindow.Numerical1);
|
| | | dungeonUseDict = new Dictionary<int, List<int>>();
|
| | | foreach (var dungeonId in copyWinData.Keys)
|
| | | {
|
| | | List<int> idlist = new List<int>();
|
| | | dungeonUseDict.Add(int.Parse(dungeonId),idlist);
|
| | | if(copyWinData[dungeonId].IsArray)
|
| | | {
|
| | | JsonData useData = copyWinData[dungeonId];
|
| | | for(int i = 0; i < useData.Count; i++)
|
| | | {
|
| | | idlist.Add(int.Parse(useData[i].ToString()));
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetRoleEquipPathId(int equipPlace)
|
| | |
| | | }
|
| | |
|
| | | cacheMapId = PlayerDatas.Instance.baseData.MapID;
|
| | | int[] useDrugs = GetDrugIDListByDungeonID(cacheMapId);
|
| | | if (useDrugs == null) return;
|
| | |
|
| | | UpdateDungeonDanUse();
|
| | | UpdateDungeonUse();
|
| | | SinglePackModel singlePack = GetSinglePackModel(PackType.rptItem);
|
| | | for(int i = 0; i < useDrugs.Length; i++)
|
| | | {
|
| | | SkillConfig skillConfig = GetSkillConfig(useDrugs[i]);
|
| | | if(skillConfig != null)
|
| | | {
|
| | | if(!itemUseTypeDict.ContainsKey(skillConfig.SkillTypeID))
|
| | | {
|
| | | itemUseTypeDict.Add(skillConfig.SkillTypeID,useDrugs[i]);
|
| | | }
|
| | | else
|
| | | {
|
| | | SkillConfig preSkillConfig = GetSkillConfig(itemUseTypeDict[skillConfig.SkillTypeID]);
|
| | | if(skillConfig.SkillLV > preSkillConfig.SkillLV)
|
| | | {
|
| | | itemUseTypeDict[skillConfig.SkillTypeID] = useDrugs[i];
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | foreach(int itemId in itemUseTypeDict.Values)
|
| | | foreach (int itemId in itemUseTypeDict.Values)
|
| | | {
|
| | | List<ItemModel> modellist = null;
|
| | | singlePack.GetItemCountByID(itemId, out modellist);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void AddItemUseTypeDict(int id)
|
| | | {
|
| | | SkillConfig skillConfig = GetSkillConfig(id);
|
| | | int itemCount = GetItemCountByID(PackType.rptItem, id);
|
| | | if (skillConfig != null && itemCount > 0)
|
| | | {
|
| | | if (!itemUseTypeDict.ContainsKey(skillConfig.SkillTypeID))
|
| | | {
|
| | | itemUseTypeDict.Add(skillConfig.SkillTypeID,id);
|
| | | }
|
| | | else
|
| | | {
|
| | | SkillConfig preSkillConfig = GetSkillConfig(itemUseTypeDict[skillConfig.SkillTypeID]);
|
| | | if (skillConfig.SkillLV > preSkillConfig.SkillLV)
|
| | | {
|
| | | itemUseTypeDict[skillConfig.SkillTypeID] = id;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateDungeonDanUse()
|
| | | {
|
| | | int mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | int[] useDrugs = GetDrugIDListByDungeonID(mapId);
|
| | | if (useDrugs == null) return;
|
| | |
|
| | | for (int i = 0; i < useDrugs.Length; i++)
|
| | | {
|
| | | int id = useDrugs[i];
|
| | | AddItemUseTypeDict(id);
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateDungeonUse()
|
| | | {
|
| | | int mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (!dungeonUseDict.ContainsKey(mapId)) return;
|
| | |
|
| | | List<int> useIdlist = dungeonUseDict[mapId];
|
| | | for(int i = 0; i < useIdlist.Count; i++)
|
| | | {
|
| | | int id = useIdlist[i];
|
| | | AddItemUseTypeDict(id);
|
| | | }
|
| | | }
|
| | |
|
| | | public SkillConfig GetSkillConfig(int itemId)
|
| | | {
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(itemId);
|
| | |
| | | private void OnSwitchAttackMode(E_AttackMode obj)//PK状态切换
|
| | | {
|
| | | TextSwitch((int)obj);
|
| | | |
| | |
|
| | | }
|
| | | void PatternButton(GameObject obj)
|
| | | {
|
| | |
| | | }
|
| | | var activityline = 0;
|
| | | fairyGrabBossModel.TryGetFairyGrabBossLine(out activityline);
|
| | | if (onMainModel.ActivityList.Contains(PlayerDatas.Instance.baseData.MapID) && activityline!=PlayerDatas.Instance.baseData.FBID)//再前四章新手地图且不在活动区域
|
| | | if (mapID == 10010)//Boss争夺战第一只boss道士鼠修改为只能是和平模式
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Map_AtkType");
|
| | | return;
|
| | | }
|
| | | if (onMainModel.ActivityList.Contains(PlayerDatas.Instance.baseData.MapID) && activityline != PlayerDatas.Instance.baseData.FBID)//再前四章新手地图且不在活动区域
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Map_AtkType");
|
| | | return;
|
| | |
| | | {
|
| | | GetLv = PlayerDatas.Instance.baseData.LV;
|
| | | WindowCenter.Instance.Open<UpgradeWin>();
|
| | | } |
| | | }
|
| | | break;
|
| | | case PlayerDataRefresh.MaxHP://最大血量的刷新28
|
| | | _maxHp = (int)PlayerDatas.Instance.extersion.MaxHP;
|
| | |
| | | [SerializeField] DungeonGuardCheckBehaviour m_DungeonGuardBehaviour;
|
| | | [SerializeField] FirstChargeTrialBehaviour m_FirstChargeTrialBehaviour;
|
| | | [SerializeField] FairyGrabBossHelpBehaviour m_FairyGrabBossHelpBehaviour;
|
| | | [SerializeField] DogzNotifyBehaviour m_DogzNotifyBehaviour;
|
| | |
|
| | | WorldBossModel worldBossModel { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } }
|
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | |
| | | GuardModel guardModel { get { return ModelCenter.Instance.GetModel<GuardModel>(); } }
|
| | | FirstTimeRechargeModel firstTimeRechargeModel { get { return ModelCenter.Instance.GetModel<FirstTimeRechargeModel>(); } }
|
| | | FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
| | |
|
| | | public void Init()
|
| | | {
|
| | | CheckBetterEquip();
|
| | |
| | | CheckDungeonGuard();
|
| | | FirstChargeTrialShow();
|
| | | CheckFairyGrabBossHelp();
|
| | | CheckDogzNotify();
|
| | | playerPack.RefreshDecomAttrAct += CheckEquipDecompose;
|
| | | betterEquipGetModel.showEquipRefreshEvent += CheckBetterEquip;
|
| | | realmEquipModel.showEquipRefreshEvent += CheckRealmBetterEquip;
|
| | |
| | | guardModel.onDungeonEquipGuardEvent += CheckDungeonGuard;
|
| | | firstTimeRechargeModel.IsTipShowEvent += FirstChargeTrialShow;
|
| | | fairyGrabBossModel.fairyGrabBossHelpUpdate += CheckFairyGrabBossHelp;
|
| | | dogzModel.UpdateDogzPutRedEvent += CheckDogzNotify;
|
| | | }
|
| | |
|
| | | public void UnInit()
|
| | |
| | | firstTimeRechargeModel.IsTipShowEvent -= FirstChargeTrialShow;
|
| | | realmEquipModel.showEquipRefreshEvent -= CheckRealmBetterEquip;
|
| | | fairyGrabBossModel.fairyGrabBossHelpUpdate -= CheckFairyGrabBossHelp;
|
| | | dogzModel.UpdateDogzPutRedEvent -= CheckDogzNotify;
|
| | | }
|
| | |
|
| | | private void CheckRealmBetterEquip()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void CheckDogzNotify()
|
| | | {
|
| | | m_DogzNotifyBehaviour.SetDisplay();
|
| | | }
|
| | |
|
| | | private void CheckPreciousItem()
|
| | | {
|
| | | if (preciousItemGetModel.currentShowItem == default(PreciousItemGetModel.PreciousItem))
|
| | |
| | | {
|
| | | Event_Duplicates(true, CopyOfThePanelSpeed);
|
| | | }
|
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) < 2)
|
| | | {
|
| | | CopyOfThePositionBool = true;
|
| | | m_ContainerBossList.localPosition = CopyOfThePosition2.localPosition;
|
| | | }
|
| | | m_FunctionForecastTip.gameObject.SetActive(true);
|
| | | }
|
| | | mapId = PlayerDatas.Instance.baseData.MapID;
|
| | |
| | | _ExpSlider.delay = _Delaytime;
|
| | | }
|
| | | ExpValueFloat = ((float)nowVlaue / (float)maxValue);
|
| | | if (ExpValueFloat != _ExpSlider.value)
|
| | | int MapID = PlayerDatas.Instance.baseData.MapID;
|
| | | if (ExpValueFloat != _ExpSlider.value && MapID== 31080)
|
| | | {
|
| | | m_UIEffect_A.Play();
|
| | | if (m_UIEffect_A.IsPlaying)
|
| | |
| | | {
|
| | | foreach (var _type in m_Redpoints.Keys)
|
| | | {
|
| | | if (!IsMissImpactRank(_type) && IsActivityClose(_type))
|
| | | if (!IsMissImpactRank(_type) && IsActivityClose(_type) && ContainsActivity(_type))
|
| | | {
|
| | | C1001_tagCWatchBillboard _pak = new C1001_tagCWatchBillboard();
|
| | | _pak.Type = (byte)GetRankType(_type);
|
| | |
| | | private void OnRefreshRank(int type)
|
| | | {
|
| | | if (type >= (int)PlayerRankData.RankType.OpenServerStrengthen
|
| | | && type <= (int)PlayerRankData.RankType.OpenServerFightPower)
|
| | | && type <= (int)PlayerRankData.RankType.OpenServerRune)
|
| | | {
|
| | | foreach (var _type in m_Redpoints.Keys)
|
| | | {
|
| | |
| | | return GetSurplusDay(_type) <= 0;
|
| | | }
|
| | |
|
| | | public bool ContainsActivity(int _type)
|
| | | {
|
| | | return impactRankTypeOpenDict.ContainsKey(_type);
|
| | | }
|
| | |
|
| | | public PlayerRankData.RankType GetRankType(int _type)
|
| | | {
|
| | | switch (_type)
|
| | |
| | | return PlayerRankData.RankType.OpenServerRealm;
|
| | | case 6:
|
| | | return PlayerRankData.RankType.OpenServerFightPower;
|
| | | case 7:
|
| | | return PlayerRankData.RankType.OpenServerRune;
|
| | | }
|
| | | return PlayerRankData.RankType.OpenServerMount;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private PlayerRankData.RankType m_PresentBillRankType = PlayerRankData.RankType.OpenServerStrengthen;
|
| | | private PlayerRankData.RankType m_PresentBillRankType = PlayerRankData.RankType.OpenServerMount;
|
| | | public PlayerRankData.RankType presentBillRankType {
|
| | | get { return m_PresentBillRankType; }
|
| | | set {
|
| | |
| | | var _condition = model.impactRankTypeOpenDict[model.presentSelectType];
|
| | | switch (model.presentSelectType)
|
| | | {
|
| | | case 1:
|
| | | case 2:
|
| | | case 3:
|
| | | case 6:
|
| | | if (_cfg is OSCBillRankAwardConfig)
|
| | | {
|
| | | OSCBillRankAwardConfig _billRankCfg = _cfg as OSCBillRankAwardConfig;
|
| | | if (_billRankCfg.RankA == _billRankCfg.RankB)
|
| | | {
|
| | | _tip = Language.Get(StringUtility.Contact("ImpactRankCellType_Single_", model.presentSelectType),
|
| | | _billRankCfg.RankA, _condition.limit);
|
| | | }
|
| | | else
|
| | | {
|
| | | _tip = Language.Get(StringUtility.Contact("ImpactRankCellType_Double_", model.presentSelectType),
|
| | | _billRankCfg.RankA, _billRankCfg.RankB, _condition.limit);
|
| | | }
|
| | | }
|
| | | else if (_cfg is OSCBillTagAwardConfig)
|
| | | {
|
| | | OSCBillTagAwardConfig _billTagCfg = _cfg as OSCBillTagAwardConfig;
|
| | | _tip = Language.Get(StringUtility.Contact("ImpactRankCellType_Target_", model.presentSelectType),
|
| | | _billTagCfg.Condition);
|
| | | }
|
| | | break;
|
| | | case 5:
|
| | | if (_cfg is OSCBillRankAwardConfig)
|
| | | {
|
| | |
| | | _realmCfg != null ? _realmCfg.Name : string.Empty);
|
| | | }
|
| | | break;
|
| | | case 4:
|
| | | default:
|
| | | if (_cfg is OSCBillRankAwardConfig)
|
| | | {
|
| | | OSCBillRankAwardConfig _billRankCfg = _cfg as OSCBillRankAwardConfig;
|
| | | if (_billRankCfg.RankA == _billRankCfg.RankB)
|
| | | {
|
| | | _tip = Language.Get(StringUtility.Contact("ImpactRankCellType_Single_", 4), _billRankCfg.RankA, _condition.limit);
|
| | | _tip = Language.Get(StringUtility.Contact("ImpactRankCellType_Single_", model.presentSelectType),
|
| | | _billRankCfg.RankA, _condition.limit);
|
| | | }
|
| | | else
|
| | | {
|
| | | _tip = Language.Get(StringUtility.Contact("ImpactRankCellType_Double_", 4),
|
| | | _tip = Language.Get(StringUtility.Contact("ImpactRankCellType_Double_", model.presentSelectType),
|
| | | _billRankCfg.RankA, _billRankCfg.RankB, _condition.limit);
|
| | | }
|
| | | }
|
| | | else if (_cfg is OSCBillTagAwardConfig)
|
| | | {
|
| | | OSCBillTagAwardConfig _billTagCfg = _cfg as OSCBillTagAwardConfig;
|
| | | _tip = Language.Get(StringUtility.Contact("ImpactRankCellType_Target_", 4), _billTagCfg.Condition);
|
| | | _tip = Language.Get(StringUtility.Contact("ImpactRankCellType_Target_", model.presentSelectType),
|
| | | _billTagCfg.Condition);
|
| | | }
|
| | | break;
|
| | | }
|
| | |
| | | return 17;
|
| | | case 6:
|
| | | return 18;
|
| | | case 7:
|
| | | return 31;
|
| | | }
|
| | | return 13;
|
| | | }
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, November 01, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI
|
| | | { |
| | | public class SkillClass
|
| | | {
|
| | | public int PetID;
|
| | | public int SkillID;
|
| | | public int Lv;
|
| | |
|
| | | } |
| | | |
| | | public class AutoTrainTipsPWin : Window |
| | | {
|
| | |
|
| | | #region Built-in |
| | | [SerializeField] Button m_CloseBtn;//关闭
|
| | | [SerializeField] Button m_CancelBtn;//取消
|
| | | [SerializeField] Button m_ConfirmBtn;//确定
|
| | | [SerializeField] Button m_BtnReduce;//减
|
| | | [SerializeField] Button m_BtnPlus;//加
|
| | |
|
| | | [SerializeField] Button _DotText1Btn;//计算器按钮
|
| | | [SerializeField] Button _NumKeyBoardBGM;//计算机面板按钮
|
| | | [SerializeField] NumKeyBoard _NumKeyBoard;//计算机
|
| | |
|
| | | [SerializeField] Text NextToLvText;//需要驯养等级
|
| | | [SerializeField] Text NeedNumberText;//所需购买的颗数
|
| | | [SerializeField] Text m_NowLevelTxt;//当前等级 |
| | | private int PetID = 0;
|
| | | public static int _Lvnumber = 0;//标记需要升到所需的阶数
|
| | | public static int DomesticateNumber = 0;//驯养次数
|
| | | private PetAttributeWin PetWin = new PetAttributeWin();
|
| | | private bool isBool = true;
|
| | | public static bool IsFairy = false;
|
| | | List<SkillClass> PetSkills = new List<SkillClass>();
|
| | | PlayerPetDatas m_petModel;
|
| | | PlayerPetDatas PetModel { get { return m_petModel ?? (m_petModel = ModelCenter.Instance.GetModel<PlayerPetDatas>()); } } |
| | | protected override void BindController() |
| | | {
|
| | | PetWin = WindowCenter.Instance.Get<PetAttributeWin>(); |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | {
|
| | | m_CloseBtn.AddListener(OnClickCloseButton);
|
| | | m_CancelBtn.AddListener(OnClickCancelButton);
|
| | | m_ConfirmBtn.AddListener(OnClickConfirmButton);
|
| | | m_BtnReduce.AddListener(OnClickReduceButton);
|
| | | m_BtnPlus.AddListener(OnClickPlusButton);
|
| | | _DotText1Btn.AddListener(OnClickDotText1);
|
| | | _NumKeyBoardBGM.AddListener(OnClickNumKeyBoardBGM);
|
| | | _NumKeyBoard.onValueChange.AddListener(OnClickNumKeyBoardValueChange);
|
| | | _NumKeyBoard.onConfirm.AddListener(onConfirm); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | {
|
| | | IsFairy = false;
|
| | | _NumKeyBoardBGM.gameObject.SetActive(false);
|
| | | isBool = true;
|
| | | PetID = PetModel.SigPetId;
|
| | | m_NowLevelTxt.text = string.Format(Language.Get("PetZ1031"), PetModel._DicPetBack[PetID].PetClass);
|
| | | GetMountSkills(PetID);
|
| | | PropertyEntries(PetID);//默认自动选择 |
| | | int GetLvNow = PetModel._DicPetBack[PetID].PetClass;
|
| | | int MaxLv = Config.Instance.Get<PetInfoConfig>(PetID).MaxRank;
|
| | | _NumKeyBoard.min = (uint)(GetLvNow + 1);
|
| | | _NumKeyBoard.max = (uint)MaxLv; |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | }
|
| | | private void GetMountSkills(int petId)//获取坐骑的技能
|
| | | {
|
| | | PetSkills.Clear();
|
| | | var PetInfo = Config.Instance.Get<PetInfoConfig>(petId);
|
| | | int[] SKillID = ConfigParse.GetMultipleStr<int>(PetInfo.SkillID);
|
| | | int[] SkillUnLock = ConfigParse.GetMultipleStr<int>(PetInfo.SkillUnLock);
|
| | | for (int i = 0; i < SKillID.Length; i++)
|
| | | {
|
| | | SkillClass skillClass = new SkillClass();
|
| | | skillClass.PetID = petId;
|
| | | skillClass.SkillID = SKillID[i];
|
| | | skillClass.Lv = SkillUnLock[i];
|
| | | PetSkills.Add(skillClass);
|
| | | }
|
| | | }
|
| | | private void PropertyEntries(int _petID)//默认自动选择
|
| | | {
|
| | | int NextMountLv = 0;
|
| | | int getLv = PetModel._DicPetBack[_petID].PetClass;
|
| | | var PetInfo = Config.Instance.Get<PetInfoConfig>(_petID);
|
| | | bool IsBool = true;
|
| | | for (int i = 0; i < PetSkills.Count; i++)
|
| | | {
|
| | | if (PetSkills[i].Lv > getLv && IsBool)
|
| | | {
|
| | | NextMountLv = PetSkills[i].Lv;
|
| | | IsBool = false;
|
| | | }
|
| | | }
|
| | | if (IsBool)
|
| | | {
|
| | | NextMountLv = PetInfo.MaxRank;
|
| | | }
|
| | | _Lvnumber = NextMountLv;
|
| | | int NowHorseExp = PetClassCostConfig.GetPetIdAndRank(_petID, getLv).NeedExpTotal + PetModel._DicPetBack[_petID].petExp;//当前等级的经验 |
| | | int NeedNumber = Mathf.CeilToInt((float)(PetClassCostConfig.GetPetIdAndRank(_petID, NextMountLv).NeedExpTotal - NowHorseExp) / 100);//所需要的颗数
|
| | | DomesticateNumber = NeedNumber;
|
| | | NeedNumberText.text = NeedNumber.ToString();
|
| | | NextToLvText.text = NextMountLv + Language.Get("Z1041");
|
| | | }
|
| | | private void SetMountSelectionInformation(int _PetID, int LV)
|
| | | {
|
| | | int getLv = PetModel._DicPetBack[_PetID].PetClass;
|
| | | int NowHorseExp = PetClassCostConfig.GetPetIdAndRank(_PetID, getLv).NeedExpTotal + PetModel._DicPetBack[_PetID].petExp;//当前等级的经验
|
| | |
|
| | | int NeedNumber = Mathf.CeilToInt((float)(PetClassCostConfig.GetPetIdAndRank(_PetID, LV).NeedExpTotal - NowHorseExp) / 100);//所需要的颗数
|
| | | DomesticateNumber = NeedNumber;
|
| | | NextToLvText.text = LV + Language.Get("Z1041");
|
| | | NeedNumberText.text = NeedNumber.ToString();
|
| | | }
|
| | |
|
| | | private void OnClickCloseButton()
|
| | | {
|
| | | Close();
|
| | | }
|
| | | private void OnClickCancelButton()
|
| | | {
|
| | | Close();
|
| | | }
|
| | | private void OnClickConfirmButton()//确定
|
| | | {
|
| | | int NeedFairyJade = DomesticateNumber * 10;
|
| | |
|
| | | int gold = (int)UIHelper.GetMoneyCnt(1);
|
| | | if (NeedFairyJade > 0 && gold >= NeedFairyJade)
|
| | | {
|
| | | IsFairy = true;
|
| | | PetWin.FairyJadeDomesticate();
|
| | | Close();
|
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | |
|
| | | }
|
| | | private void OnClickReduceButton()//减
|
| | | {
|
| | | int getLvNow = PetModel._DicPetBack[PetID].PetClass;
|
| | | if (_Lvnumber - 1 < getLvNow + 1)
|
| | | {
|
| | | ScrollTip.ShowTip(Language.Get("PetBelowCultureLevel_"));
|
| | | }
|
| | | else
|
| | | {
|
| | | _Lvnumber -= 1;
|
| | | SetMountSelectionInformation(PetID, _Lvnumber);
|
| | | }
|
| | |
|
| | | }
|
| | | private void OnClickPlusButton()//加
|
| | | {
|
| | | int MaxLv = Config.Instance.Get<PetInfoConfig>(PetID).MaxRank;
|
| | | if (_Lvnumber + 1 <= MaxLv)
|
| | | {
|
| | | _Lvnumber += 1;
|
| | | SetMountSelectionInformation(PetID, _Lvnumber);
|
| | | }
|
| | | else
|
| | | {
|
| | | ScrollTip.ShowTip(Language.Get("PetMoreThanDomestication_Z"));
|
| | | }
|
| | | }
|
| | | private void OnClickDotText1()//中间点击
|
| | | {
|
| | | if (!_NumKeyBoardBGM.gameObject.activeSelf)
|
| | | {
|
| | | _NumKeyBoardBGM.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | | private void OnClickNumKeyBoardBGM()//关闭面板
|
| | | {
|
| | | if (_NumKeyBoardBGM.gameObject.activeSelf)
|
| | | {
|
| | | _NumKeyBoardBGM.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickNumKeyBoardValueChange()
|
| | | {
|
| | | if (int.Parse(_NumKeyBoard.Value) > 999)
|
| | | {
|
| | | NextToLvText.text = 999 + Language.Get("Z1041");
|
| | | }
|
| | | else
|
| | | {
|
| | | NextToLvText.text = int.Parse(_NumKeyBoard.Value) + Language.Get("Z1041");
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | private void NumKeyBoardValueChange()
|
| | | {
|
| | | int GetLvNow = PetModel._DicPetBack[PetID].PetClass;
|
| | | int MaxLv = Config.Instance.Get<PetInfoConfig>(PetID).MaxRank;
|
| | | if (int.Parse(_NumKeyBoard.Value) < GetLvNow + 1)
|
| | | {
|
| | | _Lvnumber = GetLvNow + 1;
|
| | | SetMountSelectionInformation(PetID, _Lvnumber);
|
| | | ScrollTip.ShowTip(Language.Get("LessThanTheDomesticated_Z"));
|
| | | }
|
| | | else if (int.Parse(_NumKeyBoard.Value) > MaxLv)
|
| | | {
|
| | | _Lvnumber = MaxLv;
|
| | | SetMountSelectionInformation(PetID, _Lvnumber);
|
| | | ScrollTip.ShowTip(Language.Get("MoreThanDomestication_Z"));
|
| | | }
|
| | | else if (int.Parse(_NumKeyBoard.Value) >= GetLvNow + 1 && int.Parse(_NumKeyBoard.Value) <= MaxLv)
|
| | | {
|
| | | _Lvnumber = int.Parse(_NumKeyBoard.Value);
|
| | | SetMountSelectionInformation(PetID, _Lvnumber);
|
| | | }
|
| | |
|
| | | }
|
| | | private void onConfirm(bool _bool)
|
| | | {
|
| | | if (_bool)
|
| | | {
|
| | | NumKeyBoardValueChange();
|
| | | _NumKeyBoardBGM.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | #endregion |
| | |
|
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d659e84f62ab04c4280d8089523fde59 |
| | | timeCreated: 1541073534 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | PetInfoConfig petInfoConfig;
|
| | | bool isAutoTrain = false;
|
| | | List<GameObject> Skillimage = new List<GameObject>();
|
| | | private bool IsZidong = false;
|
| | | private void OnEnable()
|
| | | {
|
| | | IsZidong = false;
|
| | | timePlay = 0;
|
| | | Skillimage.Clear();
|
| | | Skillimage.Add(Skillimage1);
|
| | |
| | | {
|
| | | if (petmodel._DicPetBack.ContainsKey(petInfoConfig.ID))
|
| | | {
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, 1);
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, 1,0);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(petmodel.petUpgradeToolId);
|
| | | }
|
| | |
|
| | |
|
| | | // petTrainBtn.RemoveAllListeners();
|
| | | }
|
| | |
|
| | | private void ClickPetAutoTrainBtn()
|
| | |
| | | int haveCnt = playerPack.GetItemCountByID(PackType.rptItem, petmodel.petUpgradeToolId);
|
| | | if (haveCnt < costNum)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(petmodel.petUpgradeToolId);
|
| | | if (!isAutoTrain)
|
| | | {
|
| | | WindowCenter.Instance.Open<AutoTrainTipsPWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | AutoTrainTipsPWin.IsFairy = false;
|
| | | isAutoTrain = false;
|
| | | IsZidong = false;
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
|
| | | StopCoroutine("FairyJadeD");
|
| | |
|
| | | }
|
| | | |
| | | return;
|
| | | }
|
| | | isAutoTrain = !isAutoTrain;
|
| | |
| | | if (petmodel.Wait)
|
| | | {
|
| | | petmodel.Wait = false;
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, NeedNum);
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, NeedNum,0);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | if (petmodel.Wait)
|
| | | {
|
| | | petmodel.Wait = false;
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, haveCnt);
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, haveCnt,0);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
|
| | | isAutoTrain = false;
|
| | |
|
| | | if (!IsZidong)
|
| | | {
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
|
| | | isAutoTrain = false;
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | | #endregion
|
| | |
| | | ridingModel.property = PropertyTip.Pet;
|
| | | ridingModel.RidingId = PetID;
|
| | | WindowCenter.Instance.Open<TargetPetAttrWin>();
|
| | | // WindowCenter.Instance.Get<TargetPetAttrWin>().PropertyMountAndPet(PropertyTip.Pet, PetID);
|
| | |
|
| | | });
|
| | | if (petmodel._DicPetBack[PetID].PetClass >= PetModel.MaxRank)//满阶
|
| | | {
|
| | |
| | | FragmentUnlockTip.SetActive(false);
|
| | | FullAttTip.SetActive(true);
|
| | | }
|
| | |
|
| | | public void FairyJadeDomesticate()//仙玉驯养
|
| | | {
|
| | | int NumberLv = AutoTrainTipsPWin._Lvnumber;//等级所需的等级
|
| | | if (NumberLv > petmodel._DicPetBack[typePetID].PetClass && !WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>() && AutoTrainTipsPWin.IsFairy)
|
| | | {
|
| | | isAutoTrain = true;
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_7");
|
| | | IsZidong = true;
|
| | | StartCoroutine("FairyJadeD");
|
| | | }
|
| | | }
|
| | | IEnumerator FairyJadeD()//仙玉驯养
|
| | | {
|
| | | int number = AutoTrainTipsPWin.DomesticateNumber;//所需的颗数
|
| | | int NumberLv = AutoTrainTipsPWin._Lvnumber;//等级所需的等级
|
| | | while (NumberLv > petmodel._DicPetBack[typePetID].PetClass)
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>())
|
| | | {
|
| | | isAutoTrain = false;
|
| | | IsZidong =false;
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6"); |
| | | StopCoroutine("FairyJadeD");
|
| | | yield break;
|
| | | }
|
| | | if (petmodel.Wait)
|
| | | {
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_7");
|
| | | int exp = PetClassCostConfig.GetPetIdAndRank(typePetID, petmodel._DicPetBack[typePetID].PetClass).NeedExpTotal;
|
| | | int NeedNum = ridingModel.PetAndHorseNeedDanNum(exp);
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[typePetID].ItemPlace, NeedNum, 1);//向服务端发包坐骑经验单
|
| | | petmodel.Wait = false;
|
| | | }
|
| | | yield return null;
|
| | | }
|
| | | if (isAutoTrain)
|
| | | {
|
| | | AutoTrainTipsPWin.IsFairy = false;
|
| | | isAutoTrain = false;
|
| | | IsZidong = false;
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
|
| | | StopCoroutine("FairyJadeD");
|
| | | yield break;
|
| | | }
|
| | | yield break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | | petmodel.SigPetId = petId;
|
| | | TypePetID = petId;
|
| | |
|
| | | _PetAttributeMethods.ModelShow(petId);
|
| | |
|
| | | }
|
| | |
| | | if (Pet != 0)
|
| | | {
|
| | | TypePetID = Pet;
|
| | | petmodel.SigPetId = Pet;
|
| | | return;
|
| | | }
|
| | | }
|
| | |
| | | if (Value.UnLockNeedItemID == ItemId)
|
| | | {
|
| | | TypePetID = Value.ID;
|
| | | petmodel.SigPetId = TypePetID;
|
| | | return;
|
| | | }
|
| | | }
|
| | |
| | | if (petmodel.DeblockingRedPoint[key].state == RedPointState.Simple)
|
| | | {
|
| | | TypePetID = key;
|
| | | petmodel.SigPetId = TypePetID;
|
| | | return;
|
| | | }
|
| | | }
|
| | |
| | | if (petmodel.CultivateRedPoint[key].state == RedPointState.Simple)
|
| | | {
|
| | | TypePetID = key;
|
| | | petmodel.SigPetId = TypePetID;
|
| | | return;
|
| | | }
|
| | | }
|
| | | if (petmodel.PetNow != 0)
|
| | | {
|
| | | TypePetID = petmodel.PetNow;
|
| | | petmodel.SigPetId = TypePetID;
|
| | | }
|
| | | else
|
| | | {
|
| | | TypePetID = sortlist[0].ID;
|
| | | petmodel.SigPetId = TypePetID;
|
| | | }
|
| | | }
|
| | | private int JunpIndex()
|
| | |
| | | if (value.ID == petID[0])
|
| | | {
|
| | | TypePetID = petID[0];
|
| | | petmodel.SigPetId = TypePetID;
|
| | | }
|
| | | }
|
| | | //m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | |
| | | }
|
| | | return Index;
|
| | | }
|
| | |
|
| | |
|
| | | public void FairyJadeDomesticate()
|
| | | {
|
| | | _PetAttributeMethods.FairyJadeDomesticate();
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public bool IsOk = false;
|
| | | private int PetDanExp = 0;//灵宠丹经验
|
| | | public int SigPetId = 0;//用来标记当前选中的坐骑ID
|
| | | public List<int> ListEffectSkill = new List<int>();
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void SendPetTrainQuest(int petIndex, int number)
|
| | | public void SendPetTrainQuest(int petIndex, int number,int _IsAutoBuy)
|
| | | {
|
| | | CA704_tagCMPetClassUP _tagCA704 = new CA704_tagCMPetClassUP();
|
| | | _tagCA704.PetItemIndex = (byte)petIndex;
|
| | | _tagCA704.UseItemCnt = (ushort)number;
|
| | | _tagCA704.IsAutoBuy = (byte)_IsAutoBuy;
|
| | | GameNetSystem.Instance.SendInfo(_tagCA704);
|
| | | }
|
| | | #endregion
|
| | |
| | | [SerializeField] Button m_GodBeastButton; |
| | | [SerializeField] RedpointBehaviour m_RedPoint; |
| | | [SerializeField] Image m_GodBeastIcon; |
| | | public float Magnification = 1f; |
| | | public Button GodBeastButton
|
| | | {
|
| | | get { return m_GodBeastButton; }
|
| | |
| | | if (DogZConfig != null)
|
| | | {
|
| | | m_GodBeastIcon.SetSprite(DogZConfig.HeadIcon);
|
| | | m_GodBeastIcon.SetNativeSize();
|
| | | m_GodBeastIcon.transform.localScale = Vector3.one * Magnification;
|
| | | }
|
| | | List<ItemModel> itemModel = dogz_model.GetDogzEquips(godBeastNumber);
|
| | | if (itemModel != null)
|
| | |
| | | var realmModel = ModelCenter.Instance.GetModel<RealmModel>();
|
| | | realmModel.GotoDungeon();
|
| | | break;
|
| | | default:
|
| | | int error = 0;
|
| | | var dungeon = new Dungeon(_mapId, _lineId);
|
| | | if (dungeonModel.TestChallange(dungeon, out error))
|
| | | case 31080:
|
| | | {
|
| | | dungeonModel.GroupChallenge(dungeon);
|
| | | int error = 0;
|
| | | var dungeon = new Dungeon(_mapId, _lineId);
|
| | | if (dungeonModel.TestChallange(dungeon, out error))
|
| | | {
|
| | | dungeonModel.GroupChallenge(dungeon);
|
| | | }
|
| | | else
|
| | | {
|
| | | ProcessEnterDungeonError(error);
|
| | | if (error == 5)
|
| | | {
|
| | | TeamFailEnterDungeonHandle.Instance.HandleFairyLand(1, 6);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | break;
|
| | | default:
|
| | | {
|
| | | ProcessEnterDungeonError(error);
|
| | | int error = 0;
|
| | | var dungeon = new Dungeon(_mapId, _lineId);
|
| | | if (dungeonModel.TestChallange(dungeon, out error))
|
| | | {
|
| | | dungeonModel.GroupChallenge(dungeon);
|
| | | }
|
| | | else
|
| | | {
|
| | | ProcessEnterDungeonError(error);
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | |
| | | {
|
| | | if (_isAutoMatch)
|
| | | {
|
| | | var dungeon = new Dungeon(GeneralDefine.ruinsTranscriptMapId, main.LayerNumberNow);
|
| | | dungeonModel.GroupChallenge(dungeon);
|
| | | bool iamCaptainer = ModelCenter.Instance.GetModel<TeamModel>().myTeam.iamCaptainer;
|
| | | if (iamCaptainer)
|
| | | {
|
| | | dungeonModel.RequestChallangeDungeon(GeneralDefine.ruinsTranscriptMapId, main.LayerNumberNow);
|
| | | }
|
| | | |
| | | //var dungeon = new Dungeon(GeneralDefine.ruinsTranscriptMapId, main.LayerNumberNow);
|
| | | //dungeonModel.GroupChallenge(dungeon);
|
| | | }
|
| | | else
|
| | | {
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, November 01, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class TeamDungeonTicketLackWin : Window
|
| | | {
|
| | | public static LackType lackType = LackType.FairyLand;
|
| | |
|
| | | [SerializeField] ItemBehaviour m_Item;
|
| | | [SerializeField] TextEx m_TicketOwn;
|
| | | [SerializeField] TextEx m_TicketNeed;
|
| | | [SerializeField] Text m_LackContentTip;
|
| | | [SerializeField] Text m_LackMoneyTip;
|
| | | [SerializeField] Button m_Buy;
|
| | | [SerializeField] Button m_Close;
|
| | | [SerializeField] Button m_TicketCompose;
|
| | | [SerializeField] Toggle m_RemindToggle;
|
| | |
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | PlayerPackModel packModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
|
| | | StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Buy.onClick.AddListener(Buy);
|
| | | m_Close.onClick.AddListener(CloseClick);
|
| | | m_TicketCompose.onClick.AddListener(TicketCompose);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | var lackItem = GetLackItem(lackType);
|
| | | m_Item.showCount = false;
|
| | | m_Item.SetItem(lackItem);
|
| | |
|
| | | var own = packModel.GetItemCountByID(PackType.rptItem, lackItem.id);
|
| | | m_TicketOwn.text = own.ToString();
|
| | | m_TicketNeed.text = StringUtility.Contact("/", lackItem.count);
|
| | | m_TicketOwn.colorType = own >= lackItem.count ? TextColType.White : TextColType.Red;
|
| | | m_TicketCompose.gameObject.SetActive(own < lackItem.count && SatisfyComposeTicket(lackItem));
|
| | |
|
| | | m_LackContentTip.text = GetLackContentTip(lackType);
|
| | | m_LackMoneyTip.gameObject.SetActive(own < lackItem.count);
|
| | |
|
| | | if (own < lackItem.count)
|
| | | {
|
| | | var moneyNeed = GetUnitPrice(lackType) * (lackItem.count - own);
|
| | | m_LackMoneyTip.text = GetLackMoneyTip(lackType, moneyNeed);
|
| | | }
|
| | |
|
| | | m_RemindToggle.isOn = false;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | DayRemind.Instance.SetDayRemind(GetDayRemindKey(lackType), m_RemindToggle.isOn);
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private Item GetLackItem(LackType _lackType)
|
| | | {
|
| | | switch (_lackType)
|
| | | {
|
| | | case LackType.FairyLand:
|
| | | return dungeonModel.GetLackItem(DungeonSuppliesLackWin.LackType.FairyLand);
|
| | | default:
|
| | | return default(Item);
|
| | | }
|
| | | }
|
| | |
|
| | | private string GetLackContentTip(LackType _lackType)
|
| | | {
|
| | | switch (_lackType)
|
| | | {
|
| | | case LackType.FairyLand:
|
| | | return Language.Get("TeamLostItem1");
|
| | | default:
|
| | | return string.Empty;
|
| | | }
|
| | | }
|
| | |
|
| | | private bool SatisfyComposeTicket(Item lackItem)
|
| | | {
|
| | | List<ItemCompoundConfig> list;
|
| | | if (ItemCompoundConfig.TryGetTicketCompose(lackItem.id, out list))
|
| | | {
|
| | | return composeModel.IsComposeTicketByType(list[0].secondType);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | private int GetUnitPrice(LackType _lackType)
|
| | | {
|
| | | switch (_lackType)
|
| | | {
|
| | | case LackType.FairyLand:
|
| | | var dungeonId3 = dungeonModel.GetDungeonId(31080, 0);
|
| | | var config3 = Config.Instance.Get<DungeonConfig>(dungeonId3);
|
| | | return config3.TicketPrice;
|
| | | default:
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | private void TicketCompose()
|
| | | {
|
| | | switch (lackType)
|
| | | {
|
| | | case LackType.FairyLand:
|
| | | CloseImmediately();
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.ComposeTicketFairy);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private string GetLackMoneyTip(LackType _lackType, int _moneyLack)
|
| | | {
|
| | | switch (_lackType)
|
| | | {
|
| | | case LackType.FairyLand:
|
| | | return Language.Get("W_TicketJade", _moneyLack);
|
| | | default:
|
| | | return string.Empty;
|
| | | }
|
| | | }
|
| | |
|
| | | private string GetBindJadeLackTip(LackType _lackType, int _moneyNeed, int _moneyOwn)
|
| | | {
|
| | | switch (_lackType)
|
| | | {
|
| | | case LackType.FairyLand:
|
| | | return Language.Get("JadeChargeAgainst", _moneyNeed, _moneyOwn);
|
| | | default:
|
| | | return string.Empty;
|
| | | }
|
| | | }
|
| | |
|
| | | private StoreConfig GetStoreConfig(Item lackItem, int moneyType)
|
| | | {
|
| | | var config = StoreConfig.GetStoreCfg(lackItem.id, moneyType);
|
| | | return config;
|
| | | }
|
| | |
|
| | | private void Buy()
|
| | | {
|
| | | var lackItem = GetLackItem(lackType);
|
| | | var own = packModel.GetItemCountByID(PackType.rptItem, lackItem.id);
|
| | | if (own < lackItem.count)
|
| | | {
|
| | | var moneyNeed = GetUnitPrice(lackType) * (lackItem.count - own);
|
| | | if (PlayerDatas.Instance.baseData.Gold < moneyNeed
|
| | | && PlayerDatas.Instance.baseData.GoldPaper < moneyNeed)
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | var moneyType = PlayerDatas.Instance.baseData.Gold < moneyNeed ? 2 : 1;
|
| | | ConfirmTodo(lackType, moneyType);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void ConfirmTodo(LackType _lackType,int moneyType)
|
| | | {
|
| | | switch (_lackType)
|
| | | {
|
| | | case LackType.FairyLand:
|
| | | var lackItem = GetLackItem(_lackType);
|
| | | var config = GetStoreConfig(lackItem, moneyType);
|
| | | if (config != null)
|
| | | {
|
| | | var own = packModel.GetItemCountByID(PackType.rptItem, lackItem.id);
|
| | | if (moneyType == 1)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), GetConfirmLabel(_lackType), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | storeModel.SendBuyShopItem(config, lackItem.count - own);
|
| | | CloseImmediately();
|
| | | }
|
| | | });
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | storeModel.SendBuyShopItem(config, lackItem.count - own);
|
| | | }
|
| | | }
|
| | | CloseImmediately();
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | string GetConfirmLabel(LackType _lackType)
|
| | | {
|
| | | switch (_lackType)
|
| | | {
|
| | | case LackType.FairyLand:
|
| | | return Language.Get("TeamLostItem2", GetUnitPrice(_lackType));
|
| | | default:
|
| | | return string.Empty;
|
| | | }
|
| | | }
|
| | |
|
| | | public static string GetDayRemindKey(LackType _lackType)
|
| | | {
|
| | | switch (_lackType)
|
| | | {
|
| | | case LackType.FairyLand:
|
| | | return DayRemind.TEAM_TICKET_FAIRYLAND;
|
| | | default:
|
| | | return string.Empty;
|
| | | }
|
| | | }
|
| | |
|
| | | public enum LackType
|
| | | {
|
| | | FairyLand,
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d8473a9cd91c64045b40b0627cf98599 |
| | | timeCreated: 1541051627 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class TeamFailEnterDungeonHandle : Singleton<TeamFailEnterDungeonHandle>
|
| | | {
|
| | | Dictionary<int, Action> tasks = new Dictionary<int, Action>();
|
| | | public TeamFailEnterDungeonHandle()
|
| | | {
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | foreach (var action in tasks.Values)
|
| | | {
|
| | | try
|
| | | {
|
| | | action();
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | DebugEx.Log(e.StackTrace);
|
| | | }
|
| | | }
|
| | | tasks.Clear();
|
| | | }
|
| | |
|
| | | public void ReceiveReason(HB913_tagGCEnterTeamFBFailReason package)
|
| | | {
|
| | | switch (package.MapID)
|
| | | {
|
| | | case 31080:
|
| | | HandleFairyLand(package.AskType, package.Reason);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | public void HandleFairyLand(int type, int reason)
|
| | | {
|
| | | if (reason == 6)
|
| | | {
|
| | | HandleFairyLandLackTicket();
|
| | | }
|
| | | }
|
| | |
|
| | | void HandleFairyLandLackTicket()
|
| | | {
|
| | | var dayRemindKey = TeamDungeonTicketLackWin.GetDayRemindKey(TeamDungeonTicketLackWin.LackType.FairyLand);
|
| | | if (DayRemind.Instance.GetDayRemind(dayRemindKey))//设置了今日不再提醒
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (NewBieCenter.Instance.inGuiding)//引导中不弹
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (WindowCenter.Instance.IsOpen<TeamDungeonTicketLackWin>()
|
| | | || WindowCenter.Instance.IsOpen<ComposeWin>())
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (!(StageManager.Instance.CurrentStage is DungeonStage))
|
| | | {
|
| | | return;
|
| | | }
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var mapConfig = Config.Instance.Get<MapConfig>(mapId);
|
| | | if (mapConfig == null || mapConfig.MapFBType != (int)MapType.OpenCountry)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (StageManager.Instance.isLoading)
|
| | | {
|
| | | if (!tasks.ContainsKey(31080))
|
| | | {
|
| | | tasks.Add(31080, RecheckFairyLandTicket);
|
| | | }
|
| | | return;
|
| | | }
|
| | | TeamDungeonTicketLackWin.lackType = TeamDungeonTicketLackWin.LackType.FairyLand;
|
| | | WindowCenter.Instance.Open<TeamDungeonTicketLackWin>();
|
| | | }
|
| | |
|
| | | void RecheckFairyLandTicket()
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_Load());
|
| | | }
|
| | |
|
| | | IEnumerator Co_Load()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS500;
|
| | | HandleFairyLandLackTicket();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: dab437b52403b874a932e1c0d7d39f78 |
| | | timeCreated: 1541057241 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | |
| | | private float m_TopLimit;
|
| | |
|
| | | bool inited = false;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerSpecialBuff;
|
| | | [SerializeField] PositionTween m_SpeicalBuffTween;
|
| | | [SerializeField] UIAlphaTween m_SpecialBuffAlplaTween;
|
| | | [SerializeField] int m_SpecialBuffId;
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | m_FreeList.Push(m_TipList[i]);
|
| | | }
|
| | | m_TipList.Clear();
|
| | | m_ContainerSpecialBuff.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | private void OnGainStatus(string buffName)
|
| | | private void OnGainStatus(int skillId)
|
| | | {
|
| | | var skillConfig = Config.Instance.Get<SkillConfig>(skillId);
|
| | | if (skillConfig != null)
|
| | | {
|
| | | if (skillConfig.SkillTypeID == m_SpecialBuffId)
|
| | | {
|
| | | DisplaySpecialTip();
|
| | | }
|
| | | else
|
| | | {
|
| | | DisplayLabelTip(skillConfig.SkillName);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayLabelTip(string buffName)
|
| | | {
|
| | | TipController _newController = null;
|
| | | if (m_FreeList.Count > 0)
|
| | |
| | | m_MoveTime += moveDuration;
|
| | | }
|
| | |
|
| | | void DisplaySpecialTip()
|
| | | {
|
| | | transform.SetAsLastSibling();
|
| | | m_SpeicalBuffTween.SetStartState();
|
| | | m_SpecialBuffAlplaTween.SetStartState();
|
| | | m_SpeicalBuffTween.enabled = false;
|
| | | m_SpecialBuffAlplaTween.enabled = false;
|
| | | m_ContainerSpecialBuff.gameObject.SetActive(true);
|
| | | m_SpeicalBuffTween.enabled = true;
|
| | | m_SpeicalBuffTween.Play(OnSpecialBuffComplete);
|
| | | }
|
| | |
|
| | | private void OnSpecialBuffComplete()
|
| | | {
|
| | | m_SpecialBuffAlplaTween.enabled = true;
|
| | | m_SpecialBuffAlplaTween.Play(OnSpecialBuffAlphaComplete);
|
| | | }
|
| | |
|
| | | private void OnSpecialBuffAlphaComplete()
|
| | | {
|
| | | m_ContainerSpecialBuff.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | using UnityEngine.UI; |
| | | using Snxxz.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | namespace Snxxz.UI
|
| | | { |
| | | |
| | | public class VipExperienceWin : Window |
| | | { |
| | | [SerializeField] Button m_CloseBtn; |
| | | [SerializeField] Button m_ExperienceBtn; |
| | | [SerializeField] Text m_ContentTxt; |
| | | [SerializeField] Button m_Known; |
| | | [SerializeField] Text m_KnownTxt; |
| | | [SerializeField] Text m_Content; |
| | | [SerializeField] float m_ViewDuration = 15f; |
| | | [SerializeField] float m_CountDownSeconds = 5f; |
| | | |
| | | ItemTipsModel _itemTipsModel; |
| | | ItemTipsModel itemTipsModel |
| | | { |
| | | get |
| | | { |
| | | return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>()); |
| | | } |
| | | } |
| | | |
| | | PlayerPackModel _playerPack; |
| | | PlayerPackModel playerPack |
| | | { |
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } |
| | | } |
| | | float viewTime = 0f; |
| | | float countDownTime = 0f; |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_CloseBtn.onClick.AddListener(CloseClick); |
| | | m_ExperienceBtn.onClick.AddListener(OnExperienceBtn); |
| | | m_Known.onClick.AddListener(CloseClick); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | m_ContentTxt.text = Language.Get("VipExperience3"); |
| | | } |
| | | |
| | | m_Content.text = Language.Get("VipExperience3"); |
| | | m_KnownTxt.text = Language.Get("VipCard4"); |
| | | viewTime = Time.time + m_ViewDuration; |
| | | countDownTime = viewTime + m_CountDownSeconds; |
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent; |
| | | }
|
| | |
|
| | | protected override void OnAfterOpen() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent; |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | private void OnExperienceBtn() |
| | | { |
| | | if (PackSendQuestMgr.Instance.useItemModel != null) |
| | | { |
| | | PackSendQuestMgr.Instance.CheckUseCondition(PackSendQuestMgr.Instance.useItemModel); |
| | | } |
| | | |
| | | CloseImmediately(); |
| | | protected override void LateUpdate()
|
| | | {
|
| | | base.LateUpdate();
|
| | | if (Time.time >= countDownTime)
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<VipExperienceWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<VipExperienceWin>();
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | private void SecondEvent()
|
| | | {
|
| | | var seconds = Mathf.CeilToInt(countDownTime - Time.time);
|
| | | if (seconds <= m_CountDownSeconds)
|
| | | {
|
| | | m_KnownTxt.text = StringUtility.Contact(Language.Get("VipCard4"), "\n(", seconds, ")");
|
| | | }
|
| | | } |
| | | } |
| | | |
| | |
| | | private bool waitingJump = false;
|
| | |
|
| | | PlayerDeadModel deadModel { get { return ModelCenter.Instance.GetModel<PlayerDeadModel>(); } }
|
| | | PlayerPackModel packModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | WindowCenter.Instance.windowAfterOpenEvent += WindowAfterOpenEvent;
|
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | TreasureNewGotWin.CloseTreasureNewGotWinEvent += CloseTreasureNewGotWinEvent;
|
| | | NewBieCenter.Instance.guideCompletedEvent += GuideCompletedEvent;
|
| | | packModel.RefreshItemCountAct += RefreshItemCountAct;
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | |
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
|
| | | SDKUtility.Instance.onFreePlatformPayCancel -= OnChargeFail;
|
| | | SDKUtility.Instance.onFreePlatformPayFail -= OnChargeFail;
|
| | | SDKUtility.Instance.onFreePlatformPayOk -= OnChargeComplete;
|
| | | WindowCenter.Instance.windowAfterOpenEvent -= WindowAfterOpenEvent;
|
| | | TimeUtility.OnServerOpenDayRefresh -= OnServerOpenDayRefresh;
|
| | | TreasureNewGotWin.CloseTreasureNewGotWinEvent -= CloseTreasureNewGotWinEvent;
|
| | | NewBieCenter.Instance.guideCompletedEvent -= GuideCompletedEvent;
|
| | | packModel.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | StageManager.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | get; private set;
|
| | | }
|
| | |
|
| | | public int vipExperienceItemId { get; private set; }
|
| | |
|
| | | public int gotoVipLv { get; set; }
|
| | |
|
| | | private bool m_ChargeReset = true;
|
| | |
| | | m_VipExperienceDic = ConfigParse.GetDic<int, int>(cfg.Numerical1);
|
| | | cfg = Config.Instance.Get<FuncConfigConfig>("PayRMB");
|
| | | vipExpMoney = int.Parse(cfg.Numerical1);
|
| | | cfg = Config.Instance.Get<FuncConfigConfig>("VIPExperienceCard");
|
| | | vipExperienceItemId = int.Parse(cfg.Numerical1);
|
| | | }
|
| | |
|
| | | private void ParseVipGift()
|
| | |
| | | if (_experienceTime > 0)
|
| | | {
|
| | | TimeMgr.Instance.Register(TimeMgr.SyntonyType.VipExperirnceOverdue, _experienceTime);
|
| | | if (serverInited)
|
| | | {
|
| | | popExperienceWindow = true;
|
| | | CheckAutoPopExperienceWin();
|
| | | }
|
| | | }
|
| | | if (OnVipTimeEvent != null) OnVipTimeEvent();
|
| | | if (OnVipTimeEvent != null)
|
| | | {
|
| | | OnVipTimeEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsVipActive()
|
| | |
| | | int surplusTime = Mathf.Max(0, (int)(vipExperienceOverdue - TimeUtility.ServerNow).TotalSeconds);
|
| | | return surplusTime > 0;
|
| | | }
|
| | |
|
| | | #region 自动弹出Vip体验界面
|
| | | bool popExperienceWindow = false;
|
| | | public void CheckAutoPopExperienceWin()
|
| | | {
|
| | | if (!popExperienceWindow)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (!(StageManager.Instance.CurrentStage is DungeonStage))
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (!WindowCenter.Instance.IsOpen<MainInterfaceWin>()
|
| | | || WindowCenter.Instance.ExitAnyFullScreenOrMaskWin()
|
| | | || NewBieCenter.Instance.inGuiding
|
| | | || WindowCenter.Instance.IsOpen<VipExperienceWin>())
|
| | | {
|
| | | return;
|
| | | }
|
| | | popExperienceWindow = false;
|
| | | WindowCenter.Instance.Open<VipExperienceWin>();
|
| | | }
|
| | |
|
| | | private void RefreshItemCountAct(PackType packType, int _index, int itemId)
|
| | | {
|
| | | if (serverInited && itemId == vipExperienceItemId)
|
| | | {
|
| | | CheckUseVipExperienceCard();
|
| | | }
|
| | | }
|
| | |
|
| | | private void CheckUseVipExperienceCard()
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.VIPLv > 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (IsVipExperience())
|
| | | {
|
| | | return;
|
| | | }
|
| | | var singlepack = packModel.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlepack != null)
|
| | | {
|
| | | List<ItemModel> list = null;
|
| | | var count = singlepack.GetItemCountByID(vipExperienceItemId, out list);
|
| | | if (count > 0 && list != null && list.Count > 0)
|
| | | {
|
| | | var itemModel = list[0];
|
| | | CA323_tagCMUseItems pak = new CA323_tagCMUseItems();
|
| | | pak.ItemIndex = (byte)itemModel.itemInfo.ItemPlace;
|
| | | pak.UseCnt = 1;
|
| | | pak.ExData = 0;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 打开Vip界面
|
| | | public void OpenVipPayUI(VipWinType type)
|
| | | {
|
| | |
| | | }
|
| | | return -1;
|
| | | }
|
| | |
|
| | | #region 充值
|
| | | public Dictionary<int, int> firstRechargeWeapon { get; private set; }
|
| | | public Dictionary<int, List<AwardItem>> m_RechargeGainItemDict { get; private set; }
|
| | |
| | | {
|
| | | if (_win is MainInterfaceWin)
|
| | | {
|
| | | if (!firstChargeRewardGet)
|
| | | if (!firstChargeRewardGet || popExperienceWindow)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_Load());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | if (!(StageManager.Instance.CurrentStage is DungeonStage))
|
| | | {
|
| | | popExperienceWindow = false;
|
| | | }
|
| | | }
|
| | |
|
| | | private void GuideCompletedEvent(int _id)
|
| | | {
|
| | | if (popExperienceWindow)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_CheckPopExperienceWin());
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | IEnumerator Co_Load()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS500;
|
| | | CheckOpenFirstRechargeWin();
|
| | | if (!firstChargeRewardGet)
|
| | | {
|
| | | CheckOpenFirstRechargeWin();
|
| | | }
|
| | | if (popExperienceWindow)
|
| | | {
|
| | | CheckAutoPopExperienceWin();
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator Co_CheckPopExperienceWin()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS500;
|
| | | if (popExperienceWindow)
|
| | | {
|
| | | CheckAutoPopExperienceWin();
|
| | | }
|
| | | }
|
| | |
|
| | | private void CheckOpenFirstRechargeWin()
|
| | |
| | | ResetGiftRedpoint = true;
|
| | | }
|
| | | UpdateGiftRedpoint();
|
| | | CheckUseVipExperienceCard();
|
| | | }
|
| | | #endregion
|
| | | }
|
| | |
| | | List<string> closeAllIgnoreWindows = new List<string>() {
|
| | | "MessageWin", "NewBieWin", "NewItemGetWin", "AttributePromoteShowWin" ,"DungeonBeginCoolDownWin","DungeonFightWin","StatusTipWin"
|
| | | ,"ScrollTipWin","MarqueeWin","ExperienceOpenWin","TrumpetWin","BattlePrepareCoolDownWin","DungeonGradeWin","BattleHintWin",
|
| | | "TreasureDungeonMissionHintWin","FairyGrabBossHintWin","DungeonFairyFeastHintWin","PetAndMountPushWin","UpgradeWin",
|
| | | "TreasureDungeonMissionHintWin","FairyGrabBossHintWin","DungeonFairyFeastHintWin","PetAndMountPushWin","UpgradeWin","DungeonFairyLandWin"
|
| | | };
|
| | |
|
| | | UIRoot m_UIRoot;
|