Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Tuesday, December 25, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | namespace TableConfig { |
| | | |
| | | |
| | | public partial class KingTreasureConfig : ConfigBase { |
| | | |
| | | public int ID { get ; private set ; }
|
| | | public int MWID { get ; private set ; }
|
| | | public int LV { get ; private set ; }
|
| | | public string AddAttr { get ; private set; } |
| | | |
| | | public override string getKey() |
| | | { |
| | | return ID.ToString(); |
| | | } |
| | | |
| | | public override void Parse() { |
| | | try |
| | | { |
| | | ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | MWID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; |
| | | |
| | | LV=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | |
| | | AddAttr = rawContents[3].Trim(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 69a1de784b915e14b98e3e9276d76115 |
| | | timeCreated: 1545706375 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | AddAsyncTask<GatherSoulConfig>();
|
| | | AddAsyncTask<GatherSoulPropertyConfig>();
|
| | | AddAsyncTask<GatherSoulComposeConfig>();
|
| | | AddAsyncTask<KingTreasureConfig>();
|
| | |
|
| | | while (!AllCompleted())
|
| | | {
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A5 1D 法宝佩戴 #tagCMWearMagicWeapon
|
| | |
|
| | | public class CA51D_tagCMWearMagicWeapon : GameNetPackBasic {
|
| | | public uint MWID; //法宝ID
|
| | | public byte State; //0-卸下 1-佩戴
|
| | |
|
| | | public CA51D_tagCMWearMagicWeapon () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA51D;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (MWID, NetDataType.DWORD);
|
| | | WriteBytes (State, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c0cb54d8f83ee704390655a70712d24b |
| | | timeCreated: 1545809562 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using Snxxz.UI;
|
| | |
|
| | | //04 31 倒计时#tagTimeTick
|
| | | public class DTC0431_tagTimeTick : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | public class DTC0431_tagTimeTick : DtcBasic
|
| | | {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | H0431_tagTimeTick vNetData = vNetPack as H0431_tagTimeTick;
|
| | | var dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>();
|
| | | dungeonModel.UpdateCoolDown((DungeonCoolDownType)vNetData.Type,vNetData.Tick);
|
| | | if((DungeonCoolDownType)vNetData.Type == DungeonCoolDownType.WaitStart)
|
| | | dungeonModel.UpdateCoolDown((DungeonCoolDownType)vNetData.Type, vNetData.Tick);
|
| | | var mapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | |
| | | if ((DungeonCoolDownType)vNetData.Type == DungeonCoolDownType.WaitStart)
|
| | | {
|
| | | var mapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | switch (mapId)
|
| | | {
|
| | | case HeavenBattleModel.HEAVEBATTLE_MAPID:
|
| | |
| | | }
|
| | | break;
|
| | | case CrossServerOneVsOneModel.CrossServerDataMapId:
|
| | | WindowCenter.Instance.CloseImmediately<DungeonBeginCoolDownWin>();
|
| | | WindowCenter.Instance.CloseImmediately<DungeonEndCoolDownWin>();
|
| | | if (!WindowCenter.Instance.IsOpen<BattlePrepareCoolDownWin>())
|
| | | {
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | | switch (mapId)
|
| | | {
|
| | | case CrossServerOneVsOneModel.CrossServerDataMapId:
|
| | | WindowCenter.Instance.CloseImmediately<DungeonBeginCoolDownWin>();
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, May 03, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using Snxxz.UI; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | |
| | | public class DTCA352_tagMCMagicWeaponLVInfo : DtcBasic { |
| | | |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | var package = vNetPack as HA352_tagMCMagicWeaponLVInfo; |
| | | ModelCenter.Instance.GetModel<TreasureModel>().UpdateTreasureLevelInfo(package); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, May 03, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | public class DTCA352_tagMCMagicWeaponLVInfo : DtcBasic {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HA352_tagMCMagicWeaponLVInfo;
|
| | | ModelCenter.Instance.GetModel<TreasureModel>().UpdateTreasureLevelInfo(package);
|
| | | ModelCenter.Instance.GetModel<KingTreasureModel>().OnReceivePackage(package);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C0 04 跨服PK赛季信息 #tagGCCrossRealmPKSeason
|
| | |
|
| | | public class DTCC004_tagGCCrossRealmPKSeason : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HC004_tagGCCrossRealmPKSeason vNetData = vNetPack as HC004_tagGCCrossRealmPKSeason;
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: caa8b080f4218d74dbadca1f9f9bac29 |
| | | timeCreated: 1545270558 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | TransBytes (out InfoList[i].Exp, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out InfoList[i].State, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out InfoList[i].FBPassLV, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out InfoList[i].IsWear, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public uint Exp;
|
| | | public byte State; //是否点击法宝认主
|
| | | public byte FBPassLV; //副本关卡
|
| | | public byte IsWear; //是否佩戴(仅适用王者法宝)
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C0 04 跨服PK赛季信息 #tagGCCrossRealmPKSeason
|
| | |
|
| | | public class HC004_tagGCCrossRealmPKSeason : GameNetPackBasic {
|
| | | public byte ZoneCount; // 所有赛区个数
|
| | | public byte[] ZoneIDList; // 所有赛区列表
|
| | | public byte ZoneID; // 所属赛区ID
|
| | | public ushort SeasonID; // 当前赛季ID
|
| | | public string StartDate; // 开始日期 yyyy-MM-dd
|
| | | public string EndDate; // 结束日期 yyyy-MM-dd
|
| | | public string EndTime; // 赛季结算时间,赛季奖励该时间后才可领取 hh:mm
|
| | | public string NextStartDate; // 下赛季开始日期 yyyy-MM-dd
|
| | | public string NextEndDate; // 下赛季结束日期 yyyy-MM-dd
|
| | |
|
| | | public HC004_tagGCCrossRealmPKSeason () {
|
| | | _cmd = (ushort)0xC004;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ZoneCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ZoneIDList, vBytes, NetDataType.BYTE, ZoneCount);
|
| | | TransBytes (out ZoneID, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out SeasonID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out StartDate, vBytes, NetDataType.Chars, 10);
|
| | | TransBytes (out EndDate, vBytes, NetDataType.Chars, 10);
|
| | | TransBytes (out EndTime, vBytes, NetDataType.Chars, 5);
|
| | | TransBytes (out NextStartDate, vBytes, NetDataType.Chars, 10);
|
| | | TransBytes (out NextEndDate, vBytes, NetDataType.Chars, 10);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5dde8bcae1e094b4ca6f1b79a42c600c |
| | | timeCreated: 1545270557 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | }
|
| | | }
|
| | |
|
| | | RequestLifeBar();
|
| | | if (PlayerDatas.Instance.baseData.MapID == 31340)
|
| | | {
|
| | | RequestLifeBar();
|
| | | }
|
| | | }
|
| | |
|
| | | public override void RequestShadow()
|
| | |
| | | }
|
| | | }
|
| | | break;
|
| | | case DailyQuestType.CrossServerPk:
|
| | | {
|
| | | if(TimeUtility.OpenDay < ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>().afterOpenDayOpenCross)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | if (config.UnLockFuncID != 0)
|
| | | {
|
| | |
| | | [SerializeField] Text winStreakText;
|
| | | [SerializeField] Button buyTimesBtn;
|
| | | [SerializeField] Button matchRecordBtn;
|
| | | [SerializeField] RedpointBehaviour matchRedPointBeh;
|
| | | [SerializeField] GameObject inSeasonTimeObj;
|
| | | [SerializeField] GameObject outSeasonTimeObj;
|
| | | [SerializeField] GameObject lookPlayerObj;
|
| | |
| | |
|
| | | private void OnStartMatch()
|
| | | {
|
| | | matchRedPointBeh.gameObject.SetActive(false);
|
| | | lookPlayerObj.SetActive(true);
|
| | | crossServerModel.matchStartTime = DateTime.Now;
|
| | | UpdateLookPlayerTime();
|
| | |
| | | if(type == 0)
|
| | | {
|
| | | crossServerModel.IsMatching = false;
|
| | | matchRedPointBeh.gameObject.SetActive(true);
|
| | | lookPlayerObj.SetActive(false);
|
| | | UpdateActivityState();
|
| | | }
|
| | |
| | | {
|
| | | SendCrossMatch(1);
|
| | | }
|
| | |
|
| | | UpdateCrossArenaRedpoint();
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | {
|
| | | UpdateDayAwardsEvent();
|
| | | }
|
| | |
|
| | | UpdateCrossArenaRedpoint();
|
| | | }
|
| | |
|
| | | private void UpdateFBHelp()
|
| | |
| | | WindowCenter.Instance.Open<CrossServerOneVsOneRoundWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | if(mission.isStart == 1)
|
| | | DebugEx.LogFormat("副本帮助信息回合是否开始::{0}",mission.isStart);
|
| | | if (mission.isStart == 1)
|
| | | {
|
| | | if(WindowCenter.Instance.IsOpen<CrossServerOneVsOneRoundWin>())
|
| | | {
|
| | |
| | | public string priceFormula { get;private set;} //购买匹配次数需要价格公式
|
| | | public string winStreakScoreFormula { get; private set; } //连胜积分公式
|
| | | public List<AwardType> dayAwardTypelist { get; private set; }
|
| | | public int afterOpenDayOpenCross { get; private set;}
|
| | | private void ParseFuncConfig()
|
| | | {
|
| | | var CrossRealmPKAward = Config.Instance.Get<FuncConfigConfig>("CrossRealmPKAward");
|
| | |
| | |
|
| | | var CrossRealmPKScore = Config.Instance.Get<FuncConfigConfig>("CrossRealmPKScore");
|
| | | winStreakScoreFormula = CrossRealmPKScore.Numerical3;
|
| | |
|
| | | var CrossRealmCfg = Config.Instance.Get<FuncConfigConfig>("CrossRealmCfg");
|
| | | afterOpenDayOpenCross = int.Parse(CrossRealmCfg.Numerical1);
|
| | | }
|
| | |
|
| | | public class AwardType
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | var teamModel = ModelCenter.Instance.GetModel<TeamModel>();
|
| | | bool isTeamMatch = teamModel.isMatching;
|
| | | if(isTeamMatch)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CrossMatching6");
|
| | | return true;
|
| | | }
|
| | |
|
| | | bool isDungeonPrepare = teamModel.teamPrepare.isPreparing;
|
| | | if(isDungeonPrepare)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CrossMatching7");
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | |
|
| | | }
|
| | |
| | | #endregion
|
| | |
|
| | | #region 红点
|
| | | public const int CrossOneVsOneRedKey = 21301;
|
| | | public Redpoint crossOneVsOneRedpoint = new Redpoint(CrossOneVsOneRedKey);
|
| | | public const int CrossArenaRedKey = 2130101;
|
| | | public Redpoint crossArenaRedpoint = new Redpoint(CrossArenaRedKey);
|
| | | public Redpoint crossArenaRedpoint = new Redpoint(CrossOneVsOneRedKey, CrossArenaRedKey);
|
| | | public const int CrossDayAwardsRedKey = 21301011;
|
| | | public Redpoint crossDayAwardsRedpoint = new Redpoint(CrossArenaRedKey,CrossDayAwardsRedKey);
|
| | | public const int CrossMatchRedKey = 21301012;
|
| | |
| | |
|
| | | public bool InOpenTime()
|
| | | {
|
| | | DailyQuestOpenTime _openTime = null;
|
| | | dailyQuestModel.TryGetOpenTime((int)DailyQuestType.CrossServerPk, out _openTime);
|
| | | return _openTime != null && _openTime.InOpenTime() && MatchState == 1;
|
| | | List<HourMinute> hourMinutes = GetActivityTimes();
|
| | | if (hourMinutes != null && MatchState == 1)
|
| | | {
|
| | | for (int i = 0; i < hourMinutes.Count; i++)
|
| | | {
|
| | | if (hourMinutes[i].InOpenTime())
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return false;
|
| | | }
|
| | |
|
| | | public List<HourMinute> GetActivityTimes()
|
| | |
| | | DailyQuestOpenTime _openTime = null;
|
| | | dailyQuestModel.TryGetOpenTime((int)DailyQuestType.CrossServerPk, out _openTime);
|
| | | var dayOfWeek = (int)TimeUtility.ServerNow.DayOfWeek;
|
| | | return _openTime != null ? _openTime.GetHourMinuteByWeek(dayOfWeek) : null;
|
| | | Dictionary<int, List<HourMinute>> keyValues = null;
|
| | | if(_openTime != null)
|
| | | {
|
| | | keyValues = _openTime.NormalOpenTimes;
|
| | | if(keyValues.ContainsKey(dayOfWeek))
|
| | | {
|
| | | return keyValues[dayOfWeek];
|
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | public int IndexOfDays(DateTime time)
|
| | |
| | | this.DayPKCount = playerInfo.DayPKCount;
|
| | | this.DayBuyCount = playerInfo.DayBuyCount;
|
| | | this.DayWinCount = playerInfo.DayWinCount;
|
| | | if(UpdatePlayerInfoEvent != null)
|
| | | crossServerModel.UpdateCrossArenaRedpoint();
|
| | | if (UpdatePlayerInfoEvent != null)
|
| | | {
|
| | | UpdatePlayerInfoEvent();
|
| | | }
|
| | |
| | | public string DisplayWinningRate()
|
| | | {
|
| | | float rate = PKCount != 0 ? (float)WinCount / PKCount : 0;
|
| | | return StringUtility.Contact((float)Math.Round(rate,1)*100,"%");
|
| | | return StringUtility.Contact((float)Math.Round(rate*100,1),"%");
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public class CrossServerRewardModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | CrossServerOneVsOneModel crossServerModel { get { return ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>(); } }
|
| | | public Dictionary<int, SeasonAwardClass> SegmentRewardDic = new Dictionary<int, SeasonAwardClass>();
|
| | | public ImpactRankModel.RankAwardItem SeasonRewardDic = new ImpactRankModel.RankAwardItem();
|
| | | public Dictionary<int, List<Item_Class>> SeasonRewardConfigDic = new Dictionary<int, List<Item_Class>>(); |
| | | public Dictionary<int, SeasonAwardClass> SegmentRewardDic = new Dictionary<int, SeasonAwardClass>();//段位奖励
|
| | | public ImpactRankModel.RankAwardItem SeasonRewardDic = new ImpactRankModel.RankAwardItem();//赛季奖励
|
| | | public Dictionary<int, List<Item_Class>> SeasonRewardConfigDic = new Dictionary<int, List<Item_Class>>(); //赛季奖励
|
| | | public Dictionary<ZoneRankingStruct, Dictionary<int, RankingInformationClass>> ZoneRankingDic = new Dictionary<ZoneRankingStruct, Dictionary<int, RankingInformationClass>>();
|
| | | public Action CrossRealmPKAwardStateUpdate;//领取奖励刷新
|
| | | public Action RankInformationUpdate;//排行榜刷新
|
| | |
| | | private int SeasonAwardState; // 赛季结算奖励是否已领取
|
| | | public int ZoneID = 0;//赛区ID
|
| | | public int SeasonID = 0;//赛季ID
|
| | | public int MyRank = 0;//我的排名
|
| | | public int MyRank = -1;//我的排名
|
| | | public override void Init()
|
| | | {
|
| | | GetSeasonAward();
|
| | |
| | | seasonAwardClass.DanLv = _config.DanLV;
|
| | | seasonAwardClass.Name = _config.Name;
|
| | | seasonAwardClass.Score = _config.LVUpScore;
|
| | | var _jsonData = LitJson.JsonMapper.ToObject(_config.SeasonAwardList);
|
| | | var _jsonData = LitJson.JsonMapper.ToObject(_config.DanLVAwardList);
|
| | | List<Item_Class> itemClassList = new List<Item_Class>();
|
| | | for (int j = 0; j < _jsonData.Count; j++)
|
| | | {
|
| | |
| | | m_SegmentTxt2.text = config2.Name;
|
| | |
|
| | | }
|
| | | m_SorceText.text = crossServerModel.pkResultInfo.CurScore + "(" + crossServerModel.pkResultInfo.AddScore + ")";
|
| | | m_SorceText.text = crossServerModel.pkResultInfo.CurScore + "(+" + crossServerModel.pkResultInfo.AddScore + ")";
|
| | | } |
| | | |
| | | private void SetBrokenLine()
|
| | |
| | | m_Segment_Txt1.text = config1.Name;
|
| | | var config2 = Config.Instance.Get<CrossServerArenaConfig>(crossServerModel.pkResultInfo.DanLV);
|
| | | m_Segment_Txt2.text = config2.Name;
|
| | | m_SorceText.text = crossServerModel.pkResultInfo.CurScore + "(" + crossServerModel.pkResultInfo.AddScore + ")";
|
| | | m_SorceText.text = crossServerModel.pkResultInfo.CurScore + "(+" + crossServerModel.pkResultInfo.AddScore + ")";
|
| | | }
|
| | | else
|
| | | {
|
| | | m_SegmentObj1.SetActive(false);
|
| | | }
|
| | | m_Sorce_Txt.text = crossServerModel.pkResultInfo.CurScore + "(" + crossServerModel.pkResultInfo.AddScore + ")";
|
| | | m_Sorce_Txt.text = crossServerModel.pkResultInfo.CurScore + "(+" + crossServerModel.pkResultInfo.AddScore + ")";
|
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | positionType = (int)PlayerDatas.Instance.baseData.faction; |
| | | CrossServerRewardModel.PkDanLvNow = CrossServerOneVsOnePlayerInfo.Instance.DanLV;
|
| | | PlaceOfBirth(positionType);//从出生位置设置信息 |
| | | _MyBuffSortList.Clear(); |
| | |
| | | {
|
| | | if (PlayerDatas.Instance.hero.aiHandler.IsAuto())
|
| | | {
|
| | | m_AutoImg.SetActive(false);
|
| | | m_AutoImg.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | private void OnHeroHandupAIStopPassive()
|
| | | {
|
| | | if (!m_AutoImg.activeSelf)
|
| | | {
|
| | | m_AutoImg.SetActive(true);
|
| | | }
|
| | | //if (!m_AutoImg.activeSelf)
|
| | | //{
|
| | | // m_AutoImg.SetActive(true);
|
| | | //}
|
| | | }
|
| | | void OnHeroHandupAIStarted()
|
| | | {
|
| | | if (m_AutoImg.activeSelf)
|
| | | {
|
| | | m_AutoImg.SetActive(false);
|
| | | }
|
| | | //if (m_AutoImg.activeSelf)
|
| | | //{
|
| | | // m_AutoImg.SetActive(false);
|
| | | //}
|
| | | } |
| | | private void AutoButton()
|
| | | {
|
| | |
| | | [SerializeField] Button m_PullButton2;//拉选按钮 |
| | | [SerializeField] GameObject m_ClickScreenOtherSpace2; |
| | | [SerializeField] ScrollerController m_ScrollerController2;
|
| | | [SerializeField] Text m_Text_A;
|
| | | CrossServerRewardModel m_CrossServerRewardModel;
|
| | | CrossServerRewardModel crossServerRewardModel { get { return m_CrossServerRewardModel ?? (m_CrossServerRewardModel = ModelCenter.Instance.GetModel<CrossServerRewardModel>()); } } |
| | | CrossServerRewardModel crossServerRewardModel { get { return m_CrossServerRewardModel ?? (m_CrossServerRewardModel = ModelCenter.Instance.GetModel<CrossServerRewardModel>()); } }
|
| | | private int NeedDanLv = 0; |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | m_ScrollerController.OnRefreshCell += OnRefreshGridCell; |
| | | m_ScrollerController1.OnRefreshCell += OnRefreshGridCell_Z;//赛区
|
| | | m_ScrollerController2.OnRefreshCell += OnRefreshGridCell_S;//赛区 |
| | | var configNum1 = Config.Instance.Get<FuncConfigConfig>("CrossRealmPKCfg").Numerical1;
|
| | | var _jsonDataC = LitJson.JsonMapper.ToObject(configNum1); |
| | | if (_jsonDataC.Count > 0)
|
| | | {
|
| | | NeedDanLv = int.Parse(_jsonDataC[1].ToString());
|
| | | }
|
| | | var config = Config.Instance.Get<CrossServerArenaConfig>(NeedDanLv); |
| | | if (config != null)
|
| | | {
|
| | | m_Text_A.text = "到达"+ config.Name+ "段位才可上榜";
|
| | | } |
| | | |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | {
|
| | | |
| | | SetZoneIDAndSeasonID(); |
| | | ZoneAndSeasonpanel(); |
| | | m_NumberText.text = CrossServerOneVsOnePKSeason.Instance.SeasonID.ToString(); |
| | |
| | | {
|
| | | SetZoneAndSeasonNum();
|
| | | OnCreateGridLineCell(m_ScrollerController);
|
| | | SetTextMyRank();
|
| | | m_ScrollerController.JumpIndex(0);
|
| | |
|
| | | } |
| | |
| | | {
|
| | | int danlv = CrossServerOneVsOnePlayerInfo.Instance.DanLV;
|
| | | var config = Config.Instance.Get<CrossServerArenaConfig>(danlv);
|
| | | if (config != null && danlv >= 6)
|
| | | if (crossServerRewardModel.MyRank > -1 && crossServerRewardModel.MyRank < 100)
|
| | | {
|
| | | m_TextMyRank.text = config.Name;
|
| | | m_TextMyRank.text = (crossServerRewardModel.MyRank + 1).ToString();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (IsOnTheList())
|
| | | {
|
| | | if (ListIndex(crossServerRewardModel.MyRank) == Index)
|
| | | {
|
| | | bool isbool = crossServerRewardModel.IsAwardState(CrossRealmPKAwardStateEnum.SeasonAwardState, -1);
|
| | | if (isbool)
|
| | | {
|
| | | m_IsReachImage.SetActive(false);
|
| | | m_ReceiveBtn.gameObject.SetActive(false);
|
| | | m_IsDrawImage.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ReceiveBtn.gameObject.SetActive(true);
|
| | | m_IsReachImage.SetActive(false);
|
| | | m_IsDrawImage.SetActive(false);
|
| | | m_ReceiveBtn.SetListener(() =>
|
| | | {
|
| | | crossServerRewardModel.CrossRealmPKGetAward(CrossRealmPKAwardStateEnum.SeasonAwardState, 0);
|
| | | });
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | m_IsReachImage.SetActive(true);
|
| | | m_ReceiveBtn.gameObject.SetActive(false);
|
| | | m_IsDrawImage.SetActive(false);
|
| | | }
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | m_IsReachImage.SetActive(true);
|
| | | m_ReceiveBtn.gameObject.SetActive(false);
|
| | | m_IsDrawImage.SetActive(false);
|
| | | }
|
| | | }
|
| | | ReceiveItemH(id);
|
| | | } |
| | |
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | if (!IsOnTheList())
|
| | | {
|
| | | if (CrossServerOneVsOnePlayerInfo.Instance.DanLV == Id)
|
| | | {
|
| | | bool isbool = crossServerRewardModel.IsAwardState(CrossRealmPKAwardStateEnum.SeasonAwardState, -1);
|
| | | if (isbool)
|
| | | {
|
| | | m_IsReachImage.SetActive(false);
|
| | | m_ReceiveBtn.gameObject.SetActive(false);
|
| | | m_IsDrawImage.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ReceiveBtn.gameObject.SetActive(true);
|
| | | m_IsReachImage.SetActive(false);
|
| | | m_IsDrawImage.SetActive(false);
|
| | | m_ReceiveBtn.SetListener(()=> |
| | | {
|
| | | crossServerRewardModel.CrossRealmPKGetAward(CrossRealmPKAwardStateEnum.SeasonAwardState,0);
|
| | | });
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | m_IsReachImage.SetActive(true);
|
| | | m_ReceiveBtn.gameObject.SetActive(false);
|
| | | m_IsDrawImage.SetActive(false);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | m_IsReachImage.SetActive(true);
|
| | | m_ReceiveBtn.gameObject.SetActive(false);
|
| | | m_IsDrawImage.SetActive(false);
|
| | | }
|
| | | }
|
| | | ReceiveItemN(Id);
|
| | | }
|
| | |
| | | ObjChild.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | private bool IsOnTheList()
|
| | | {
|
| | | bool Isbool = false;
|
| | | if (crossServerRewardModel.MyRank > -1 && crossServerRewardModel.MyRank < 100)
|
| | | {
|
| | | Isbool = true;
|
| | | }
|
| | | return Isbool;
|
| | | }
|
| | |
|
| | | private int ListIndex(int myRank)
|
| | | {
|
| | | int type = 0;
|
| | | var keyList = crossServerRewardModel.SeasonRewardDic.AwardDic.Keys.ToList();
|
| | | for (int i = 0; i < keyList.Count; i++)
|
| | | {
|
| | | if (myRank <= keyList[i])
|
| | | {
|
| | | type= i;
|
| | | }
|
| | | }
|
| | | return type;
|
| | | } |
| | | } |
| | | |
| | |
| | |
|
| | | //常规的活动时间,key是星期x
|
| | | Dictionary<int, List<HourMinute>> openTimes = new Dictionary<int, List<HourMinute>>();
|
| | | public Dictionary<int, List<HourMinute>> NormalOpenTimes { get { return openTimes; }}
|
| | | //开服前2周的活动时间,key1是开服日的星期,key2是开服第几天
|
| | | Dictionary<int, Dictionary<int, List<HourMinute>>> specialOpenTimes = new Dictionary<int, Dictionary<int, List<HourMinute>>>();
|
| | |
|
| | |
| | |
|
| | | private void UpdateFBEnd()
|
| | | {
|
| | | CloseImmediately();
|
| | | CloseWin();
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | |
| | | private void CloseWin()
|
| | | {
|
| | | CloseImmediately();
|
| | | if (!WindowCenter.Instance.IsOpen<DungeonEndCoolDownWin>())
|
| | | int mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | int dataMapId = model.GetDataMapIdByMapId(mapId);
|
| | | switch(dataMapId)
|
| | | {
|
| | | WindowCenter.Instance.Open<DungeonEndCoolDownWin>();
|
| | | case CrossServerOneVsOneModel.CrossServerDataMapId:
|
| | | break;
|
| | | default:
|
| | | if (!WindowCenter.Instance.IsOpen<DungeonEndCoolDownWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<DungeonEndCoolDownWin>();
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | private void MailCountChange()
|
| | | {
|
| | | if (GameNetSystem.Instance.crossServerConnected_Loigc)
|
| | | {
|
| | | _MailBtn.gameObject.SetActive(false);
|
| | | return;
|
| | | }
|
| | | List<MailInfo> maillist = MailAllModel.Instance.GetTimeOrderMaillist();
|
| | | bool isShowMail = false;
|
| | |
|
| | | if (maillist != null && PreFightMission.Instance.IsFinished())
|
| | | {
|
| | | for (int i = 0; i < maillist.Count; i++)
|
| | |
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | | void OneKeyButton()//地图挂机按钮
|
| | | {
|
| | | |
| | |
|
| | | if (OneKeyList.Contains(PlayerDatas.Instance.baseData.MapID))
|
| | | {
|
| | | var dataMapId = modelD.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | |
| | | private void IsShowTaskPanel()//是否显示任务面板
|
| | | {
|
| | | var inDungeon = IsDungeon();
|
| | | if (inDungeon || fairyGrabBossModel.grabBossHintOpen)
|
| | | var IsCrossServerOneVsOne = GameNetSystem.Instance.crossServerConnected_Loigc;
|
| | | if (inDungeon || fairyGrabBossModel.grabBossHintOpen || IsCrossServerOneVsOne)
|
| | | {
|
| | | m_TaskAndTeamTip.SetActive(false);
|
| | | m_TaskSwithButton.gameObject.SetActive(false);
|
| | |
| | |
|
| | | private void IsCrossServerOneVsOne()
|
| | | {
|
| | | if (CrossServerRewardModel.IsCrossServerOneVsOne())//是否再跨服副本中
|
| | | if (GameNetSystem.Instance.crossServerConnected_Loigc)//是否再跨服副本中
|
| | | {
|
| | | if (!WindowCenter.Instance.IsOpen("FightingPKWin"))
|
| | | {
|
| | |
| | | m_TaskSwithButton.gameObject.SetActive(false);
|
| | | m_InGamePusher.gameObject.SetActive(false);
|
| | | m_RedBag.gameObject.SetActive(false);
|
| | | m_MailObj.SetActive(false);
|
| | | m_TaskAndTeamTip.SetActive(false);
|
| | | if (Vector3.Distance(m_CastSkillTip.localPosition, m_position2_S.localPosition) <= 1)//技能面板收起状态
|
| | | {
|
| | | ShowCastSkill();//显示技能组,隐藏按钮组(强制切换)
|
| | |
| | | m_TaskSwithButton.gameObject.SetActive(true);
|
| | | m_InGamePusher.gameObject.SetActive(true);
|
| | | OnRedBagGet();
|
| | | m_MailObj.SetActive(true);
|
| | | m_TaskAndTeamTip.SetActive(true);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | gmClose.gameObject.SetActive(!hasOnFrom);
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | if (Input.GetKeyDown(KeyCode.F3))
|
| | | {
|
| | | OnGMOpen();
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
| | | using System.Collections.Generic;
|
| | | using System.Text.RegularExpressions;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | |
| | | var instance = BattleHint.Instance;
|
| | | }
|
| | |
|
| | | private void LateUpdate()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | if (Input.GetKeyDown(KeyCode.F3))
|
| | | {
|
| | | MessageWin.Inst.OnGMOpen();
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | protected override void OnDestroy()
|
| | | {
|
| | | base.OnDestroy();
|
| | |
| | | isOpenPrompting = true;
|
| | | this.deadCD = 0;
|
| | | localBossState = false;
|
| | | playerIsDie = false;
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | |
| | | public bool isBossKill = false;
|
| | | public float duplicatesRebornTime = 0;
|
| | | private Dictionary<int, int> duplicatesRebornDict;
|
| | | public bool playerIsDie { get; private set; }
|
| | | public bool playerIsDie
|
| | | {
|
| | | get {
|
| | |
|
| | | if(PlayerDatas.Instance.hero != null)
|
| | | {
|
| | | return PlayerDatas.Instance.hero.ActorInfo.serverDie;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | DungeonModel _dungeonModel;
|
| | | DungeonModel dungeonModel {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | playerIsDie = true;
|
| | | _tagMapModel = Config.Instance.Get<MapConfig>(PlayerDatas.Instance.baseData.MapID);
|
| | | if (_tagMapModel.MapFBType == 0)
|
| | | {
|
| | |
| | | localBossState = false;
|
| | | this.deadCD = 0;
|
| | | isKillByPlayer = false;
|
| | | playerIsDie = false;
|
| | | TimeDownMgr.Instance.Stop(TimeDownMgr.CoolTimeType.DeadCD);
|
| | | TimeDownMgr.Instance.Stop(TimeDownMgr.CoolTimeType.BossAutoReborn);
|
| | | TimeDownMgr.Instance.Stop(TimeDownMgr.CoolTimeType.DuplicatesReborn);
|
| | |
| | | onReached();
|
| | | onReached = null;
|
| | | }
|
| | |
|
| | | StopTreasureShow();
|
| | |
|
| | | GameObject.Destroy(this.gameObject);
|
| | | return;
|
| | | }
|
| | |
| | | functionUnLockShowEndEvent(m_UnLockType);
|
| | | }
|
| | |
|
| | | switch (m_UnLockType)
|
| | | {
|
| | | case FunctionUnlockType.Treasure:
|
| | | case FunctionUnlockType.TreasureSkill:
|
| | | case FunctionUnlockType.TreasureFunc:
|
| | | UI3DTreasureExhibition.Instance.StopShow();
|
| | | break;
|
| | | case FunctionUnlockType.Normal:
|
| | | break;
|
| | | }
|
| | | StopTreasureShow();
|
| | |
|
| | | GameObject.Destroy(this.gameObject);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
|
| | | DebugEx.Log(ex.Message);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | void StopTreasureShow()
|
| | | {
|
| | | switch (m_UnLockType)
|
| | | {
|
| | | case FunctionUnlockType.Treasure:
|
| | | case FunctionUnlockType.TreasureSkill:
|
| | | case FunctionUnlockType.TreasureFunc:
|
| | | UI3DTreasureExhibition.Instance.StopShow();
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | using System;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | [XLua.Hotfix]
|
| | | public class KingThreeDimensionsBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] RectTransform m_ContainerSeasonNotStart;
|
| | | [SerializeField] RectTransform m_ContainerSeasonStartOrEnd;
|
| | | [SerializeField] Text m_Season;
|
| | | [SerializeField] Image m_EndState;
|
| | | [SerializeField] Image m_OnGoingState;
|
| | | [SerializeField] Text m_Division;
|
| | | [SerializeField] Text m_Score;
|
| | | [SerializeField] RectTransform m_ContainerWearToggle;
|
| | | [SerializeField] Image m_WearCheck;
|
| | | [SerializeField] TreasureUIEvent m_Wear;
|
| | |
|
| | | KingTreasureModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<KingTreasureModel>(); }
|
| | | }
|
| | |
|
| | | TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
|
| | |
|
| | | CrossServerOneVsOneModel oneVsOneModel
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>(); }
|
| | | }
|
| | |
|
| | | int displayTreasureId = 0;
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_Wear.onClick += OnWear;
|
| | | }
|
| | |
|
| | | public void Display(int treasureId)
|
| | | {
|
| | | displayTreasureId = treasureId;
|
| | |
|
| | | var season = 0;
|
| | | if (model.TryGetSeason(treasureId, out season))
|
| | | {
|
| | | var seasonNotStart = season > CrossServerOneVsOnePKSeason.Instance.SeasonID;
|
| | | m_ContainerSeasonNotStart.gameObject.SetActive(seasonNotStart);
|
| | | m_ContainerSeasonStartOrEnd.gameObject.SetActive(!seasonNotStart);
|
| | |
|
| | | bool seasonEnd = season < CrossServerOneVsOnePKSeason.Instance.SeasonID;
|
| | | if (!seasonNotStart)
|
| | | {
|
| | | m_EndState.gameObject.SetActive(seasonEnd);
|
| | | m_OnGoingState.gameObject.SetActive(!seasonEnd);
|
| | | m_Season.text = season.ToString();
|
| | | m_Division.gameObject.SetActive(seasonEnd);
|
| | | CrossServerOneVsOneModel.CrossServerOneVsOneHistory history;
|
| | | if (oneVsOneModel.TryGetOneVsOneHistory(season, out history))
|
| | | {
|
| | | var divisionConfig = Config.Instance.Get<CrossServerArenaConfig>(history.division);
|
| | | m_Division.gameObject.SetActive(divisionConfig != null);
|
| | | if (divisionConfig != null)
|
| | | {
|
| | | m_Division.text = divisionConfig.Name;
|
| | | }
|
| | | m_Score.gameObject.SetActive(true);
|
| | | m_Score.text = Language.Get("KingTreasureScore", model.GetSeasonScore(treasureId));
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Division.gameObject.SetActive(false);
|
| | | m_Score.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | DisplayWear();
|
| | |
|
| | | model.treasureWearRefresh -= TreasureWearRefresh;
|
| | | model.treasureWearRefresh += TreasureWearRefresh;
|
| | | }
|
| | |
|
| | | void DisplayWear()
|
| | | {
|
| | | Treasure treasure;
|
| | | if (treasureModel.TryGetTreasure(displayTreasureId, out treasure))
|
| | | {
|
| | | m_ContainerWearToggle.gameObject.SetActive(treasure.state == TreasureState.Collected);
|
| | | m_WearCheck.gameObject.SetActive(model.IsWear(displayTreasureId));
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContainerWearToggle.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnWear()
|
| | | {
|
| | | if (displayTreasureId != 0)
|
| | | {
|
| | | model.TryWearTreasure(displayTreasureId);
|
| | | }
|
| | | }
|
| | |
|
| | | private void TreasureWearRefresh()
|
| | | {
|
| | | DisplayWear();
|
| | | }
|
| | |
|
| | | public void Dispose()
|
| | | {
|
| | | model.treasureWearRefresh -= TreasureWearRefresh;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: cc8974057d676b64e971f6c9c47acc19 |
| | | timeCreated: 1545721558 |
| | | 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 KingTreasureModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, bool> treasureWearDict = new Dictionary<int, bool>();
|
| | | Dictionary<int, Dictionary<int, Division>> treasureDivisionDict = new Dictionary<int, Dictionary<int, Division>>();
|
| | | Dictionary<int, int> treasureSeasonDict = new Dictionary<int, int>();
|
| | |
|
| | | public event Action treasureWearRefresh;
|
| | |
|
| | | public int wearCountLimit { get; private set; }
|
| | | public string scoreFormula { get; private set; }
|
| | |
|
| | | TreasureModel treasureModel
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<TreasureModel>(); }
|
| | | }
|
| | |
|
| | | CrossServerOneVsOneModel oneVsOneModel
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>(); }
|
| | | }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | treasureWearDict.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | if (treasureWearRefresh != null)
|
| | | {
|
| | | treasureWearRefresh();
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | var config = Config.Instance.Get<FuncConfigConfig>("MagicWeaponOfKing");
|
| | | if (config != null)
|
| | | {
|
| | | treasureSeasonDict = ConfigParse.GetDic<int, int>(config.Numerical1);
|
| | | wearCountLimit = int.Parse(config.Numerical2);
|
| | | }
|
| | |
|
| | | config = Config.Instance.Get<FuncConfigConfig>("KingTreasureScore");
|
| | | if (config != null)
|
| | | {
|
| | | scoreFormula = config.Numerical1;
|
| | | }
|
| | |
|
| | | var configs = Config.Instance.GetAllValues<KingTreasureConfig>();
|
| | | for (int i = 0; i < configs.Count; i++)
|
| | | {
|
| | | Dictionary<int, Division> dict;
|
| | | if (!treasureDivisionDict.TryGetValue(configs[i].MWID, out dict))
|
| | | {
|
| | | dict = new Dictionary<int, Division>();
|
| | | treasureDivisionDict.Add(configs[i].MWID, dict);
|
| | | }
|
| | | dict.Add(configs[i].LV, new Division()
|
| | | {
|
| | | division = configs[i].LV,
|
| | | propertys = ConfigParse.GetDic<int, int>(configs[i].AddAttr),
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetDivision(int treasureId, int divisionLevel, out Division division)
|
| | | {
|
| | | Dictionary<int, Division> dict;
|
| | | division = default(Division);
|
| | | return treasureDivisionDict.TryGetValue(treasureId, out dict)
|
| | | && dict.TryGetValue(divisionLevel, out division);
|
| | | }
|
| | |
|
| | | public bool IsWear(int treasureId)
|
| | | {
|
| | | if (treasureWearDict.ContainsKey(treasureId))
|
| | | {
|
| | | return treasureWearDict[treasureId];
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetSeason(int treasureId, out int season)
|
| | | {
|
| | | return treasureSeasonDict.TryGetValue(treasureId, out season);
|
| | | }
|
| | |
|
| | | public List<int> GetDisplayList()
|
| | | {
|
| | | var displays = new List<int>();
|
| | | var list = treasureModel.GetTreasureCategory(TreasureCategory.King);
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | var season = 0;
|
| | | if (TryGetSeason(list[i], out season))
|
| | | {
|
| | | if (season <= CrossServerOneVsOnePKSeason.Instance.SeasonID
|
| | | || season == CrossServerOneVsOnePKSeason.Instance.SeasonID + 1)
|
| | | {
|
| | | displays.Add(list[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | | return displays;
|
| | | }
|
| | |
|
| | | public void TryWearTreasure(int treasureId)
|
| | | {
|
| | | var config = Config.Instance.Get<TreasureConfig>(treasureId);
|
| | | if (config == null || (TreasureCategory)config.Category != TreasureCategory.King)
|
| | | {
|
| | | return;
|
| | | }
|
| | | Treasure treasure;
|
| | | if (treasureModel.TryGetTreasure(treasureId, out treasure))
|
| | | {
|
| | | if (treasure.state == TreasureState.Collected)
|
| | | {
|
| | | if (IsWear(treasureId))
|
| | | {
|
| | | CA51D_tagCMWearMagicWeapon pak = new CA51D_tagCMWearMagicWeapon();
|
| | | pak.MWID = (uint)treasureId;
|
| | | pak.State = 0;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (GetWearTreasureCount() >= wearCountLimit)
|
| | | {
|
| | | var countDisplay = string.Empty;
|
| | | if (wearCountLimit == 2)
|
| | | {
|
| | | countDisplay = Language.Get("Num_CHS_Two");
|
| | | }
|
| | | else
|
| | | {
|
| | | countDisplay = Language.Get(StringUtility.Contact("Num_CHS_", wearCountLimit));
|
| | | }
|
| | | SysNotifyMgr.Instance.ShowTip("KingTreasureWearLimit", countDisplay);
|
| | | return;
|
| | | }
|
| | | CA51D_tagCMWearMagicWeapon pak = new CA51D_tagCMWearMagicWeapon();
|
| | | pak.MWID = (uint)treasureId;
|
| | | pak.State = 1;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetWearTreasureCount()
|
| | | {
|
| | | var count = 0;
|
| | | var list = treasureModel.GetTreasureCategory(TreasureCategory.King);
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | if (IsWear(list[i]))
|
| | | {
|
| | | count++;
|
| | | }
|
| | | }
|
| | | return count;
|
| | | }
|
| | |
|
| | | public int GetSeasonScore(int treasureId)
|
| | | {
|
| | | var score = 0;
|
| | | if (scoreFormula != null)
|
| | | {
|
| | | var season = 0;
|
| | | if (TryGetSeason(treasureId, out season))
|
| | | {
|
| | | CrossServerOneVsOneModel.CrossServerOneVsOneHistory history;
|
| | | if (oneVsOneModel.TryGetOneVsOneHistory(season, out history))
|
| | | {
|
| | | Division division;
|
| | | if (TryGetDivision(treasureId, history.rewardLevel, out division)
|
| | | && division.propertys != null)
|
| | | {
|
| | | Equation.Instance.Clear();
|
| | | foreach (var key in division.propertys.Keys)
|
| | | {
|
| | | var config = Config.Instance.Get<PlayerPropertyConfig>(key);
|
| | | if (config != null)
|
| | | {
|
| | | Equation.Instance.AddKeyValue(config.Parameter, division.propertys[key]);
|
| | | }
|
| | | }
|
| | | score = Equation.Instance.Eval<int>(scoreFormula);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return score;
|
| | | }
|
| | |
|
| | |
|
| | | public void OnReceivePackage(HA352_tagMCMagicWeaponLVInfo package)
|
| | | {
|
| | | for (int i = 0; i < package.Count; i++)
|
| | | {
|
| | | var data = package.InfoList[i];
|
| | | var config = Config.Instance.Get<TreasureConfig>((int)data.MWID);
|
| | | if (config == null || config.Category != (int)TreasureCategory.King)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | treasureWearDict[(int)data.MWID] = data.IsWear == 1;
|
| | | }
|
| | | if (treasureWearRefresh != null)
|
| | | {
|
| | | treasureWearRefresh();
|
| | | }
|
| | | }
|
| | |
|
| | | public struct Division
|
| | | {
|
| | | public int division;
|
| | | public Dictionary<int, int> propertys;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 82bdcc464a4a975409f3766d8c73fd67 |
| | | timeCreated: 1545703511 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, December 24, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | [XLua.Hotfix]
|
| | | public class KingTreasureWin : Window
|
| | | {
|
| | | [SerializeField] PositionTween m_PositionTween;
|
| | | [SerializeField] Image m_TreasureNameIcon;
|
| | | [SerializeField] RectTransform m_ContainerOnGoing;
|
| | | [SerializeField] Text m_SeasonOnGoingRemind;
|
| | | [SerializeField] RectTransform m_ContainerEnd;
|
| | | [SerializeField] Text m_SeasonEndRemind;
|
| | | [SerializeField] RectTransform m_ContainerGot;
|
| | | [SerializeField] Image m_DivisionIcon;
|
| | | [SerializeField] Text m_Division;
|
| | | [SerializeField] Text m_Score;
|
| | | [SerializeField] RectTransform m_ContainerBaseProperty;
|
| | | [SerializeField] PropertyBehaviour[] m_BasePropertys;
|
| | | [SerializeField] RectTransform m_ContainerSpecialProperty;
|
| | | [SerializeField] PropertyBehaviour[] m_SpecialPropertys;
|
| | | [SerializeField] Text m_Remind;
|
| | | [SerializeField] Button m_Goto;
|
| | |
|
| | |
|
| | | TreasureModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<TreasureModel>(); }
|
| | | }
|
| | |
|
| | | KingTreasureModel kingTreasureModel
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<KingTreasureModel>(); }
|
| | | }
|
| | |
|
| | | CrossServerOneVsOneModel crossServerOneVsOneModel
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>(); }
|
| | | }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | m_Goto.onClick.AddListener(Goto);
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | UI3DTreasureSelectStage.Instance.SetStartState();
|
| | | model.treasureSelectedEvent += TreasureSelectedEvent;
|
| | | TreasureBaseWin.allowSelectTreasure += AllowSelectTreasure;
|
| | | Display();
|
| | |
|
| | | var countDisplay = string.Empty;
|
| | | if (kingTreasureModel.wearCountLimit == 2)
|
| | | {
|
| | | countDisplay = Language.Get("Num_CHS_Two");
|
| | | }
|
| | | else
|
| | | {
|
| | | countDisplay = Language.Get(StringUtility.Contact("Num_CHS_", kingTreasureModel.wearCountLimit));
|
| | | }
|
| | |
|
| | | m_Remind.text = Language.Get("KingTreasureLimitRemind", countDisplay);
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | DisplayTween();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.treasureSelectedEvent -= TreasureSelectedEvent;
|
| | | TreasureBaseWin.allowSelectTreasure -= AllowSelectTreasure;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public void Display()
|
| | | {
|
| | | DisplayBase();
|
| | | DisplayState();
|
| | | DisplayGoto();
|
| | | }
|
| | |
|
| | | void DisplayBase()
|
| | | {
|
| | | var config = Config.Instance.Get<TreasureConfig>(model.selectedTreasure);
|
| | | if (config != null)
|
| | | {
|
| | | m_TreasureNameIcon.SetSprite(config.NameIcon);
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayState()
|
| | | {
|
| | | Treasure treasure;
|
| | | m_ContainerEnd.gameObject.SetActive(false);
|
| | | m_ContainerGot.gameObject.SetActive(false);
|
| | | m_ContainerOnGoing.gameObject.SetActive(false);
|
| | | if (model.TryGetTreasure(model.selectedTreasure, out treasure))
|
| | | {
|
| | | var season = 0;
|
| | | kingTreasureModel.TryGetSeason(model.selectedTreasure, out season);
|
| | | if (treasure.state == TreasureState.Collected)
|
| | | {
|
| | | DisplayGot();
|
| | | }
|
| | | else if (season < CrossServerOneVsOnePKSeason.Instance.SeasonID)
|
| | | {
|
| | | DisplayEnd();
|
| | | }
|
| | | else
|
| | | {
|
| | | DisplayOnGoing();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayGot()
|
| | | {
|
| | | m_ContainerGot.gameObject.SetActive(true);
|
| | | CrossServerOneVsOneModel.CrossServerOneVsOneHistory history;
|
| | | List<int> basePropertys = new List<int>();
|
| | | List<int> specialPropertys = new List<int>();
|
| | | var session = 0;
|
| | | if (kingTreasureModel.TryGetSeason(model.selectedTreasure, out session)
|
| | | && crossServerOneVsOneModel.TryGetOneVsOneHistory(session, out history))
|
| | | {
|
| | | var divisionConfig = Config.Instance.Get<CrossServerArenaConfig>(history.division);
|
| | | if (divisionConfig != null)
|
| | | {
|
| | | m_DivisionIcon.SetSprite(divisionConfig.IconKey);
|
| | | m_Division.text = divisionConfig.Name;
|
| | | }
|
| | | KingTreasureModel.Division division;
|
| | | if (kingTreasureModel.TryGetDivision(model.selectedTreasure, history.rewardLevel, out division))
|
| | | {
|
| | | if (division.propertys != null)
|
| | | {
|
| | | foreach (var key in division.propertys.Keys)
|
| | | {
|
| | | var config = Config.Instance.Get<PlayerPropertyConfig>(key);
|
| | | if (config.type == 2)
|
| | | {
|
| | | specialPropertys.Add(key);
|
| | | }
|
| | | else
|
| | | {
|
| | | basePropertys.Add(key);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | m_ContainerBaseProperty.gameObject.SetActive(basePropertys.Count > 0);
|
| | | m_ContainerSpecialProperty.gameObject.SetActive(specialPropertys.Count > 0);
|
| | | if (basePropertys.Count > 0)
|
| | | {
|
| | | for (int i = 0; i < m_BasePropertys.Length; i++)
|
| | | {
|
| | | m_BasePropertys[i].gameObject.SetActive(i < basePropertys.Count);
|
| | | if (i < basePropertys.Count)
|
| | | {
|
| | | m_BasePropertys[i].DisplayUpper(basePropertys[i], division.propertys[basePropertys[i]]);
|
| | | }
|
| | | }
|
| | | }
|
| | | if (specialPropertys.Count > 0)
|
| | | {
|
| | | for (int i = 0; i < m_SpecialPropertys.Length; i++)
|
| | | {
|
| | | m_SpecialPropertys[i].gameObject.SetActive(i < specialPropertys.Count);
|
| | | if (i < specialPropertys.Count)
|
| | | {
|
| | | m_BasePropertys[i].DisplayUpper(basePropertys[i], division.propertys[basePropertys[i]]);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayEnd()
|
| | | {
|
| | | m_ContainerEnd.gameObject.SetActive(true);
|
| | | m_SeasonEndRemind.text = UIHelper.ReplaceNewLine(Language.Get("KingTreasureEndRemind"));
|
| | | }
|
| | |
|
| | | void DisplayOnGoing()
|
| | | {
|
| | | m_ContainerOnGoing.gameObject.SetActive(true);
|
| | | m_SeasonOnGoingRemind.text = UIHelper.ReplaceNewLine(Language.Get("KingTreasureOnGoingRemind"));
|
| | | }
|
| | |
|
| | | void DisplayGoto()
|
| | | {
|
| | | var season = 0;
|
| | | kingTreasureModel.TryGetSeason(model.selectedTreasure, out season);
|
| | | m_Goto.gameObject.SetActive(CrossServerOneVsOnePKSeason.Instance.SeasonID == season);
|
| | | }
|
| | |
|
| | | void DisplayTween()
|
| | | {
|
| | | m_PositionTween.Play();
|
| | | }
|
| | |
|
| | | private void TreasureSelectedEvent(int id)
|
| | | {
|
| | | m_PositionTween.SetEndState();
|
| | | Display();
|
| | | }
|
| | |
|
| | | private bool AllowSelectTreasure(int id)
|
| | | {
|
| | | var list = kingTreasureModel.GetDisplayList();
|
| | | var season = 0;
|
| | | if (kingTreasureModel.TryGetSeason(id, out season))
|
| | | {
|
| | | if (season == CrossServerOneVsOnePKSeason.Instance.SeasonID + 1)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("TreasureOneVsOneSeasonNotStart");
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return list.Contains(id);
|
| | | }
|
| | |
|
| | | private void Goto()
|
| | | {
|
| | | //--todo 跳转至赛季目标
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: cb43d91c7863116469cbad13ba3bf116 |
| | | timeCreated: 1545656062 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<TreasureModel>(); }
|
| | | }
|
| | |
|
| | | KingTreasureModel kingTreasureModel
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<KingTreasureModel>(); }
|
| | | }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | m_Right.image.SetSprite("XT_FB_34");
|
| | | WindowCenter.Instance.Open<FairyTreasureWin>();
|
| | | break;
|
| | | case TreasureCategory.King:
|
| | | m_TreasureTitle.SetSprite("KingTreasureTitle");
|
| | | m_Left.image.SetSprite("KingTreasureLeftSelect");
|
| | | m_Right.image.SetSprite("KingTreasureRightSelect");
|
| | | WindowCenter.Instance.Open<KingTreasureWin>();
|
| | | break;
|
| | | }
|
| | | DisplaySelects();
|
| | | }
|
| | |
|
| | | private void DisplaySelects()
|
| | | {
|
| | | var leftRifht = Config.Instance.Get<TreasureConfig>(model.selectedTreasure + 1);
|
| | | m_Right.gameObject.SetActive(leftRifht != null);
|
| | | leftRifht = Config.Instance.Get<TreasureConfig>(model.selectedTreasure - 1);
|
| | | m_Left.gameObject.SetActive(leftRifht != null);
|
| | | switch (model.currentCategory)
|
| | | {
|
| | | case TreasureCategory.King:
|
| | | {
|
| | | var list = kingTreasureModel.GetDisplayList();
|
| | | var leftRifht = list.Contains(model.selectedTreasure + 1);
|
| | | m_Right.gameObject.SetActive(leftRifht);
|
| | | leftRifht = list.Contains(model.selectedTreasure - 1);
|
| | | m_Left.gameObject.SetActive(leftRifht);
|
| | | }
|
| | | break;
|
| | | default:
|
| | | {
|
| | | var leftRifht = Config.Instance.Get<TreasureConfig>(model.selectedTreasure + 1);
|
| | | m_Right.gameObject.SetActive(leftRifht != null);
|
| | | leftRifht = Config.Instance.Get<TreasureConfig>(model.selectedTreasure - 1);
|
| | | m_Left.gameObject.SetActive(leftRifht != null);
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnCameraBackComplete()
|
| | |
| | | public Transform root;
|
| | | public Transform treasureRoot;
|
| | | public TreasureInteractProcessor interactProcessor;
|
| | | private Transform treasure;
|
| | | private SkinnedMeshRenderer treasureSkin;
|
| | | private Transform bottom;
|
| | | private Transform name;
|
| | | private TextMesh condition;
|
| | | private DemonDungeonLabel treasureLabel;
|
| | | Transform treasure;
|
| | | SkinnedMeshRenderer treasureSkin;
|
| | | Transform bottom;
|
| | | Transform name;
|
| | | TextMesh condition;
|
| | | DemonDungeonLabel treasureLabel;
|
| | | TreasureThreeDimensionsBehaviour m_ThreeDimensionsBehaviour;
|
| | |
|
| | | #region 红点
|
| | | private Transform potentialRed;
|
| | |
| | | static Dictionary<TreasureState, GameObjectPoolManager.GameObjectPool> m_StatePoolDict = new Dictionary<TreasureState, GameObjectPoolManager.GameObjectPool>();
|
| | | static Dictionary<TreasureCategory, GameObjectPoolManager.GameObjectPool> m_ConditionPoolDict = new Dictionary<TreasureCategory, GameObjectPoolManager.GameObjectPool>();
|
| | | static Dictionary<TreasureCategory, GameObjectPoolManager.GameObjectPool> m_LabelPoolDict = new Dictionary<TreasureCategory, GameObjectPoolManager.GameObjectPool>();
|
| | | static GameObjectPoolManager.GameObjectPool m_TreasureCanvaPool;
|
| | | static Vector3 m_CacheBottomScale = Vector3.zero;
|
| | |
|
| | | TreasureModel m_Model;
|
| | |
| | | RequestBackLight();
|
| | | RequestRedpoint();
|
| | | RequestHighestEffect();
|
| | | RequestTreasureCanva();
|
| | | UpdateTreasureState();
|
| | | UpdateParam();
|
| | | RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent;
|
| | |
| | | RecycleCondition();
|
| | | RecycleTreasureLabel();
|
| | | RecycleHighestEffect();
|
| | | RecycleTreasureCanva();
|
| | | RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent;
|
| | | model.demonTreasureDungeonUpdate -= DemonTreasureDungeonUpdate;
|
| | | }
|
| | |
| | |
|
| | | public void RequestName()
|
| | | {
|
| | | RecycleName();
|
| | | if (category == TreasureCategory.King)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (name == null)
|
| | | {
|
| | | if (paramConfig != null && !paramConfig.treasureNamePrefab.Equals(string.Empty))
|
| | |
| | | treasure.LookAt(UI3DTreasureSelectStage.Instance.showCamera.transform);
|
| | | treasure.gameObject.SetActive(true);
|
| | |
|
| | | Treasure _treasure;
|
| | | if (!model.TryGetTreasure(treasureId, out _treasure))
|
| | | {
|
| | | return;
|
| | | }
|
| | | bool requireGraySkin = RequireGrayTreasureSkin();
|
| | | treasureSkin = treasure.GetComponentInChildren<SkinnedMeshRenderer>();
|
| | | if (treasureSkin != null)
|
| | | {
|
| | | bool _unlock = _treasure.state == TreasureState.Collected
|
| | | || _treasure.state == TreasureState.Collecting;
|
| | | treasureSkin.material.SetFloat("_Gray", _unlock ? 0 : 1);
|
| | | treasureSkin.material.SetFloat("_Gray", requireGraySkin ? 1 : 0);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public void UpdateTreasureState()
|
| | | {
|
| | | Treasure _treasure;
|
| | | if (!model.TryGetTreasure(treasureId, out _treasure))
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (treasure == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | Treasure _treasure;
|
| | | if (!model.TryGetTreasure(treasureId, out _treasure))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | bool requireGraySkin = RequireGrayTreasureSkin();
|
| | | if (treasureSkin != null)
|
| | | {
|
| | | treasureSkin.material.SetFloat("_Gray", _treasure.state == TreasureState.Collected
|
| | | || _treasure.state == TreasureState.Collecting ? 0 : 1);
|
| | | treasureSkin.material.SetFloat("_Gray", requireGraySkin ? 1 : 0);
|
| | | if (model.GetTreasureUnlockShow(UI3DTreasureSelectStage.Instance.currentCategory) == _treasure.id
|
| | | && !UI3DTreasureSelectStage.Instance.CloserComplete)
|
| | | {
|
| | |
| | | private void RequestLockEffect()
|
| | | {
|
| | | RecycleLockEffect();
|
| | | if (category == TreasureCategory.King)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var _id = category == TreasureCategory.Human ? 5132 : 5157;
|
| | | lockEffect = SFXPlayUtility.Instance.Play(_id, treasureRoot);
|
| | | if (lockEffect != null)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void RequestTreasureCanva()
|
| | | {
|
| | | RecycleTreasureCanva();
|
| | | if (category != TreasureCategory.King)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (m_TreasureCanvaPool == null)
|
| | | {
|
| | | var prefab = UILoader.LoadPrefab("TreasureCanva");
|
| | | if (prefab)
|
| | | {
|
| | | m_TreasureCanvaPool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | }
|
| | | }
|
| | | if (m_TreasureCanvaPool != null)
|
| | | {
|
| | | var go = m_TreasureCanvaPool.Request();
|
| | | go.SetActive(true);
|
| | | go.transform.SetParent(root);
|
| | | go.transform.localPosition = Vector3.zero;
|
| | | go.transform.localEulerAngles = new Vector3(0, -180, 0);
|
| | | go.transform.localScale = Vector3.one * 0.01f;
|
| | | LayerUtility.SetLayer(go, LayerUtility.DevisableUI, true);
|
| | | m_ThreeDimensionsBehaviour = go.GetComponent<TreasureThreeDimensionsBehaviour>();
|
| | | m_ThreeDimensionsBehaviour.SetCamera(UI3DTreasureSelectStage.Instance.treasureUICamera);
|
| | | m_ThreeDimensionsBehaviour.Display(treasureId);
|
| | | }
|
| | | }
|
| | |
|
| | | public void RecycleTreasureCanva()
|
| | | {
|
| | | if (m_TreasureCanvaPool != null)
|
| | | {
|
| | | if (m_ThreeDimensionsBehaviour != null)
|
| | | {
|
| | | m_ThreeDimensionsBehaviour.gameObject.SetActive(false);
|
| | | m_TreasureCanvaPool.Release(m_ThreeDimensionsBehaviour.gameObject);
|
| | | m_ThreeDimensionsBehaviour = null;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void CloserState()
|
| | | {
|
| | | RecycleBottom();
|
| | |
| | | RecycleCondition();
|
| | | RecycleTreasureLabel();
|
| | | RecycleHighestEffect();
|
| | | RecycleTreasureCanva();
|
| | | RequestSpecialEffect();
|
| | |
|
| | | Treasure _treasure;
|
| | |
| | | {
|
| | | LayerUtility.SetLayer(root.gameObject, _layer, true);
|
| | | LayerUtility.SetLayer(treasureRoot.gameObject, _layer, true);
|
| | |
|
| | | if (m_ThreeDimensionsBehaviour != null)
|
| | | {
|
| | | LayerUtility.SetLayer(m_ThreeDimensionsBehaviour.gameObject, LayerUtility.DevisableUI, true);
|
| | | }
|
| | | }
|
| | |
|
| | | public void OutCloserState()
|
| | |
| | | RequestName();
|
| | | RequestRedpoint();
|
| | | RequestHighestEffect();
|
| | | RequestTreasureCanva();
|
| | | UpdateTreasureState();
|
| | | RecycleSpecialEffect();
|
| | | UpdateParam();
|
| | |
| | | }
|
| | | UI3DTreasureSelectStage.Instance.ReCheckTreasureHighest();
|
| | | }
|
| | |
|
| | | bool RequireGrayTreasureSkin()
|
| | | {
|
| | | Treasure _treasure;
|
| | | if (!model.TryGetTreasure(treasureId, out _treasure))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return _treasure.state != TreasureState.Collected
|
| | | && _treasure.state != TreasureState.Collecting;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public void OnPointerClick(PointerEventData eventData)
|
| | | {
|
| | | List<RaycastResult> results = new List<RaycastResult>();
|
| | | EventSystem.current.RaycastAll(eventData, results);
|
| | | if (results != null)
|
| | | {
|
| | | var index = results.FindIndex((x) =>
|
| | | {
|
| | | return x.gameObject.GetComponent<TreasureUIEvent>() != null;
|
| | | });
|
| | | if (index != -1)
|
| | | {
|
| | | DebugEx.Log("法宝UI事件拦截");
|
| | | return;
|
| | | }
|
| | | }
|
| | | UI3DTreasureSelectStage.Instance.OnPointDownTreasure(treasureId);
|
| | | }
|
| | |
|
| | |
| | | Redpoint humanRedpoint = new Redpoint(TREASURE_REDPOINTID, CATEGORY_REDPOINTIDS[(int)TreasureCategory.Human - 1]);
|
| | | Redpoint demonRedpoint = new Redpoint(TREASURE_REDPOINTID, CATEGORY_REDPOINTIDS[(int)TreasureCategory.Demon - 1]);
|
| | | Redpoint fairypoint = new Redpoint(TREASURE_REDPOINTID, CATEGORY_REDPOINTIDS[(int)TreasureCategory.Fairy - 1]);
|
| | | Redpoint elderGodRedpoint = new Redpoint(TREASURE_REDPOINTID, CATEGORY_REDPOINTIDS[(int)TreasureCategory.ElderGod - 1]);
|
| | | Redpoint elderGodRedpoint = new Redpoint(TREASURE_REDPOINTID, CATEGORY_REDPOINTIDS[(int)TreasureCategory.King - 1]);
|
| | | Redpoint zergRedpoint = new Redpoint(TREASURE_REDPOINTID, CATEGORY_REDPOINTIDS[(int)TreasureCategory.Zerg - 1]);
|
| | |
|
| | | public Redpoint stoveRedpoint { get; private set; }
|
| | |
| | | [SerializeField] UIAlphaTween m_FadeInStory;
|
| | | [SerializeField] Text m_Story;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerProperty;
|
| | | [SerializeField] Slider m_PropertySlider;
|
| | | [SerializeField] UIAlphaTween m_FadeInProperty;
|
| | | [SerializeField] PropertyBehaviour[] m_BasePropertys;
|
| | | [SerializeField] PropertyBehaviour[] m_SpecialPropertys;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerFightPower;
|
| | | [SerializeField] Text m_FightPower;
|
| | |
|
| | | TreasureModel model { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
|
| | | PlayerTaskDatas taskmodel { get { return ModelCenter.Instance.GetModel<PlayerTaskDatas>(); } }
|
| | | SkillModel skillModel { get { return ModelCenter.Instance.GetModel<SkillModel>(); } }
|
| | | KingTreasureModel kingTreasureModel { get { return ModelCenter.Instance.GetModel<KingTreasureModel>(); } }
|
| | | CrossServerOneVsOneModel oneVsOneModel { get { return ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>(); } }
|
| | |
|
| | | FunctionUnlockFlyObject flyObject;
|
| | | FunctionUnlockFlyObject unlockFlyObject1;
|
| | |
| | | case ShowStep.ShowStory:
|
| | | OnEnterShowStory();
|
| | | break;
|
| | | case ShowStep.ShowProperty:
|
| | | OnEnterShowProperty();
|
| | | break;
|
| | | case ShowStep.ShowComplete:
|
| | | OnEnterShowComplete();
|
| | | break;
|
| | |
| | | m_UnlockTip.gameObject.SetActive(false);
|
| | | m_ContainerFinishShow.gameObject.SetActive(false);
|
| | | m_ContainerFightPower.gameObject.SetActive(false);
|
| | | m_ContainerProperty.gameObject.SetActive(false);
|
| | |
|
| | | for (int i = 0; i < m_TreasureNewGots.Length; i++)
|
| | | {
|
| | |
| | | break;
|
| | | case ShowStep.ShowNameAndSliderUnlock:
|
| | | m_FuncUnLockSlider.value = 0;
|
| | | m_PropertySlider.value = 0;
|
| | | if (timer > 0.7f)
|
| | | {
|
| | | timer = 0f;
|
| | |
| | | }
|
| | | break;
|
| | | case ShowStep.ShowStory:
|
| | | if (timer > 0.7f)
|
| | | {
|
| | | timer = 0f;
|
| | | showStep = ShowStep.ShowComplete;
|
| | | }
|
| | | break;
|
| | | case ShowStep.ShowProperty:
|
| | | m_PropertySlider.value = timer / 0.7f;
|
| | | if (timer > 0.7f)
|
| | | {
|
| | | timer = 0f;
|
| | |
| | | }
|
| | | flyObject = unlockFlyObject1;
|
| | | }
|
| | |
|
| | | if ((TreasureCategory)config.Category == TreasureCategory.King)
|
| | | {
|
| | | Dictionary<int, int> basePropertys = new Dictionary<int, int>();
|
| | | Dictionary<int, int> specialPropertys = new Dictionary<int, int>();
|
| | | var season = 0;
|
| | | if (kingTreasureModel.TryGetSeason(config.ID, out season))
|
| | | {
|
| | | CrossServerOneVsOneModel.CrossServerOneVsOneHistory history;
|
| | | if (oneVsOneModel.TryGetOneVsOneHistory(season, out history))
|
| | | {
|
| | | KingTreasureModel.Division division;
|
| | | if (kingTreasureModel.TryGetDivision(config.ID, history.rewardLevel, out division)
|
| | | && division.propertys != null)
|
| | | {
|
| | | foreach (var key in division.propertys.Keys)
|
| | | {
|
| | | var propertyConfig = Config.Instance.Get<PlayerPropertyConfig>(key);
|
| | | if (propertyConfig == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (propertyConfig.type == 2)
|
| | | {
|
| | | specialPropertys.Add(key, division.propertys[key]);
|
| | | }
|
| | | else
|
| | | {
|
| | | basePropertys.Add(key, division.propertys[key]);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | var propertyIndex = 0;
|
| | | foreach (var key in basePropertys.Keys)
|
| | | {
|
| | | if (propertyIndex < m_BasePropertys.Length)
|
| | | {
|
| | | m_BasePropertys[propertyIndex].gameObject.SetActive(true);
|
| | | m_BasePropertys[propertyIndex].DisplayUpper(key, basePropertys[key]);
|
| | | }
|
| | | propertyIndex++;
|
| | | }
|
| | | for (int i = propertyIndex; i < m_BasePropertys.Length; i++)
|
| | | {
|
| | | m_BasePropertys[i].gameObject.SetActive(false);
|
| | | }
|
| | | propertyIndex = 0;
|
| | | foreach (var key in specialPropertys.Keys)
|
| | | {
|
| | | if (propertyIndex < m_SpecialPropertys.Length)
|
| | | {
|
| | | m_SpecialPropertys[propertyIndex].gameObject.SetActive(true);
|
| | | m_SpecialPropertys[propertyIndex].DisplayUpper(key, specialPropertys[key]);
|
| | | }
|
| | | propertyIndex++;
|
| | | }
|
| | | for (int i = propertyIndex; i < m_SpecialPropertys.Length; i++)
|
| | | {
|
| | | m_SpecialPropertys[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void FinishShow()
|
| | |
| | | showStep = ShowStep.ShowStory;
|
| | | return;
|
| | | }
|
| | | else if (config.Category == (int)TreasureCategory.King)
|
| | | {
|
| | | m_ContainerFuncUnLock.gameObject.SetActive(false);
|
| | | showStep = ShowStep.ShowProperty;
|
| | | return;
|
| | | }
|
| | | if (displayStageCount == 0)
|
| | | {
|
| | | showStep = ShowStep.ShowComplete;
|
| | |
| | | m_ContianerStory.gameObject.SetActive(true);
|
| | | m_FadeInStory.SetStartState();
|
| | | m_FadeInStory.Play();
|
| | | }
|
| | |
|
| | | private void OnEnterShowProperty()
|
| | | {
|
| | | m_ContainerProperty.gameObject.SetActive(true);
|
| | | m_FadeInProperty.SetStartState();
|
| | | m_FadeInProperty.Play();
|
| | | }
|
| | |
|
| | | private void OnEnterShowComplete()
|
| | |
| | | ShowNameAndSliderUnlock,
|
| | | ShowUnlock,
|
| | | ShowStory,
|
| | | ShowProperty,
|
| | | ShowComplete,
|
| | | FadeOut,
|
| | | FlyTo,
|
| | |
| | | [SerializeField] FunctionButton m_HumanBtn;
|
| | | [SerializeField] FunctionButton m_DemonBtn;
|
| | | [SerializeField] FunctionButton m_FairyBtn;
|
| | | [SerializeField] FunctionButton m_KingBtn;
|
| | | [SerializeField] Button m_BackBtn;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerNewGuide;
|
| | |
| | | }
|
| | | UI3DTreasureSelectStage.Instance.SelectTreasureCategory(TreasureCategory.Fairy);
|
| | | });
|
| | | m_KingBtn.onClick.AddListener(() =>
|
| | | {
|
| | | if (UI3DTreasureSelectStage.Instance.currentCategory == TreasureCategory.King
|
| | | || UI3DTreasureSelectStage.Instance.UnlockShowing || UI3DTreasureSelectStage.Instance.IsCloser
|
| | | || UI3DTreasureSelectStage.Instance.treasureFinishShowing)
|
| | | {
|
| | | return;
|
| | | }
|
| | | UI3DTreasureSelectStage.Instance.SelectTreasureCategory(TreasureCategory.King);
|
| | | });
|
| | | m_BackBtn.onClick.AddListener(() =>
|
| | | {
|
| | | if (UI3DTreasureSelectStage.Instance.UnlockShowing || UI3DTreasureSelectStage.Instance.treasureFinishShowing)
|
| | |
| | | m_FairyBtn.repeatClickFunc += () =>
|
| | | {
|
| | | ReclickSelect(TreasureCategory.Fairy);
|
| | | };
|
| | | m_KingBtn.repeatClickFunc += () =>
|
| | | {
|
| | | ReclickSelect(TreasureCategory.King);
|
| | | };
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | m_FairyBtn.state = model.currentCategory == TreasureCategory.Fairy ? TitleBtnState.Click : TitleBtnState.Normal;
|
| | | }
|
| | | if (m_KingBtn.state != TitleBtnState.Locked)
|
| | | {
|
| | | m_KingBtn.state = model.currentCategory == TreasureCategory.King ? TitleBtnState.Click : TitleBtnState.Normal;
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateButtonState()
|
| | |
| | | m_HumanBtn.gameObject.SetActive(!_closer);
|
| | | m_DemonBtn.gameObject.SetActive(!_closer);
|
| | | m_FairyBtn.gameObject.SetActive(!_closer);
|
| | | m_KingBtn.gameObject.SetActive(!_closer);
|
| | | }
|
| | |
|
| | | private void StartAnimation()
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using TableConfig;
|
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | [XLua.Hotfix]
|
| | | public class TreasureThreeDimensionsBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Canvas m_TreasureCanva;
|
| | | [SerializeField] KingThreeDimensionsBehaviour m_KingTreasureBehaviour;
|
| | |
|
| | | public void Display(int treasureId)
|
| | | {
|
| | | m_KingTreasureBehaviour.Dispose();
|
| | | m_KingTreasureBehaviour.gameObject.SetActive(false);
|
| | |
|
| | | var config = Config.Instance.Get<TreasureConfig>(treasureId);
|
| | | if (config != null)
|
| | | {
|
| | | switch ((TreasureCategory)config.Category)
|
| | | {
|
| | | case TreasureCategory.King:
|
| | | m_KingTreasureBehaviour.gameObject.SetActive(true);
|
| | | m_KingTreasureBehaviour.Display(treasureId);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetCamera(Camera camera)
|
| | | {
|
| | | m_TreasureCanva.worldCamera = camera;
|
| | | }
|
| | |
|
| | | private void LateUpdate()
|
| | | {
|
| | | if (!gameObject.layer.Equals(LayerUtility.DevisableUI))
|
| | | {
|
| | | LayerUtility.SetLayer(gameObject, LayerUtility.DevisableUI, true);
|
| | | }
|
| | | }
|
| | |
|
| | | public void Dispose()
|
| | | {
|
| | | m_KingTreasureBehaviour.Dispose();
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 88a37e777b0455c46abebbdbf042494d |
| | | timeCreated: 1545721411 |
| | | 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 UnityEngine; |
| | | using UnityEngine.Events;
|
| | | using UnityEngine.EventSystems; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class TreasureUIEvent : MonoBehaviour, IPointerClickHandler
|
| | | {
|
| | | public event UnityAction onClick;
|
| | | public void OnPointerClick(PointerEventData eventData)
|
| | | {
|
| | | if (onClick != null)
|
| | | {
|
| | | onClick();
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1b7181922816fb34bb46a276c365e599 |
| | | timeCreated: 1545807625 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] Transform m_TreasureRoot;
|
| | | [SerializeField] Camera m_Camera;
|
| | | [SerializeField] Camera m_RenderCamera;
|
| | | [SerializeField] Camera m_TreasureUICamera;
|
| | | [SerializeField] Transform m_CameraControl;
|
| | | [SerializeField] GameObject[] m_TreasureSkys;
|
| | | [SerializeField] GameObject[] m_TreasureTitles;
|
| | | [SerializeField] GameObject[] m_TreasureFogs;
|
| | | public Camera showCamera { get { return m_Camera; } }
|
| | | public Camera renderCamera { get { return m_RenderCamera; } }
|
| | | public Camera treasureUICamera { get { return m_TreasureUICamera; } }
|
| | | public Transform center
|
| | | {
|
| | | get
|
| | |
| | | return null;
|
| | | }
|
| | | }
|
| | |
|
| | | public int selectTreasure
|
| | | {
|
| | | get
|
| | |
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | [NonSerialized]
|
| | | public int presentSelectIndex = 0;
|
| | | public event Action OnCameraBackComplete;
|
| | |
| | | public event Action OnHighestComplete;
|
| | | public event Action startAnimation;
|
| | |
|
| | | private Dictionary<TreasureCategory, List<TreasureComponent>> m_Treasures = new Dictionary<TreasureCategory, List<TreasureComponent>>();
|
| | | private Dictionary<TreasureCategory, bool> m_PreloadDict = new Dictionary<TreasureCategory, bool>();
|
| | | Dictionary<TreasureCategory, List<TreasureComponent>> m_Treasures = new Dictionary<TreasureCategory, List<TreasureComponent>>();
|
| | | Dictionary<TreasureCategory, bool> m_PreloadDict = new Dictionary<TreasureCategory, bool>();
|
| | | List<int> displayTreasures = new List<int>();
|
| | |
|
| | | Coroutine preloadCoroutine = null;
|
| | |
|
| | |
| | | Load(TreasureCategory.Human);
|
| | | Load(TreasureCategory.Demon);
|
| | | Load(TreasureCategory.Fairy);
|
| | | Load(TreasureCategory.King);
|
| | | }
|
| | |
|
| | | void Load(TreasureCategory _type)
|
| | |
| | |
|
| | | public void SelectTreasureCategory(TreasureCategory _type, bool _closer = false)
|
| | | {
|
| | | RefreshDisplayTreasures(_type);
|
| | |
|
| | | presentSelectIndex = 0;
|
| | | UnlockShowing = false;
|
| | | treasureFinishShowing = false;
|
| | |
| | | model.currentCategory = currentCategory;
|
| | |
|
| | | min_angle = startIndex * Mathf.Abs(intervalAngle);
|
| | | max_angle = (m_Treasures[currentCategory].Count + startIndex) * Mathf.Abs(intervalAngle);
|
| | | max_angle = (displayTreasures.Count + startIndex) * Mathf.Abs(intervalAngle);
|
| | |
|
| | | var _index = -1;
|
| | | if (!_closer)
|
| | |
| | | }
|
| | | if (_index == -1)
|
| | | {
|
| | | var _treasureCount = m_Treasures[_type].Count;
|
| | | var _treasureCount = displayTreasures.Count;
|
| | | _index = _treasureCount < pageCount / 2 ? 0 : pageCount / 2;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | switch (currentCategory)
|
| | | {
|
| | | case TreasureCategory.King:
|
| | | {
|
| | | var model = ModelCenter.Instance.GetModel<KingTreasureModel>();
|
| | | var season = 0;
|
| | | if (model.TryGetSeason(_treasureId, out season))
|
| | | {
|
| | | if (season == CrossServerOneVsOnePKSeason.Instance.SeasonID + 1)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("TreasureOneVsOneSeasonNotStart");
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | var _list = m_Treasures[currentCategory];
|
| | | var _index = _list.FindIndex((x) =>
|
| | | {
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | if (Mathf.Abs(i - presentSelectIndex) > startIndex)
|
| | | if (Mathf.Abs(i - presentSelectIndex) > startIndex
|
| | | || !displayTreasures.Contains(_list[i].treasureId))
|
| | | {
|
| | | if (_list[i].display)
|
| | | {
|
| | |
| | | {
|
| | | if (target_angle * forward > max_angle)
|
| | | {
|
| | | float _angle = (m_Treasures[currentCategory].Count - 1 + startIndex) * Mathf.Abs(intervalAngle);
|
| | | float _angle = (displayTreasures.Count - 1 + startIndex) * Mathf.Abs(intervalAngle);
|
| | | target_angle = _angle * forward;
|
| | | }
|
| | | else if (target_angle * forward < min_angle)
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | bool _display = Mathf.Abs(i - presentSelectIndex) < startIndex;
|
| | | bool _display = Mathf.Abs(i - presentSelectIndex) < startIndex
|
| | | && displayTreasures.Contains(_list[i].treasureId);
|
| | | _list[i].SetActive(_display);
|
| | | }
|
| | | }
|
| | |
| | | var _list = m_Treasures[currentCategory];
|
| | | for (int i = 0; i < _list.Count; i++)
|
| | | {
|
| | | if (!displayTreasures.Contains(_list[i].treasureId))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (Mathf.Abs(i - _index) <= startIndex
|
| | | && !_list[i].display)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void RefreshDisplayTreasures(TreasureCategory category)
|
| | | {
|
| | | displayTreasures.Clear();
|
| | | var list = model.GetTreasureCategory(category);
|
| | | switch (category)
|
| | | {
|
| | | case TreasureCategory.King:
|
| | | {
|
| | | var model = ModelCenter.Instance.GetModel<KingTreasureModel>();
|
| | | var displays = model.GetDisplayList();
|
| | | displayTreasures.AddRange(displays);
|
| | | }
|
| | | break;
|
| | | default:
|
| | | displayTreasures.AddRange(list);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | RegisterModel<VirtualPackModel>();
|
| | | RegisterModel<GatherSoulComposeModel>();
|
| | | RegisterModel<GatherSoulDungeonModel>();
|
| | | RegisterModel<KingTreasureModel>();
|
| | | inited = true;
|
| | | }
|
| | |
|
| | |
| | | Human = 1,
|
| | | Demon = 2,
|
| | | Fairy = 3,
|
| | | ElderGod = 4,
|
| | | King = 4,
|
| | | Zerg = 5,
|
| | | }
|
| | |
|