| | |
| | | public static void Init()
|
| | | {
|
| | | // 登记相应的数据体及对应的数据转逻辑类
|
| | | Register(typeof(HC103_tagMCCrossRealmPKPlayerHisSeasonInfo), typeof(DTCC103_tagMCCrossRealmPKPlayerHisSeasonInfo));
|
| | | Register(typeof(HA31E_tagMCGatherSoulHoleInfo), typeof(DTCA31E_tagMCGatherSoulHoleInfo));
|
| | | Register(typeof(HAA1D_tagMCActTotalRechargeInfo), typeof(DTCAA1D_tagMCActTotalRechargeInfo));
|
| | | Register(typeof(HAA1C_tagMCTotalRechargePlayerInfo), typeof(DTCAA1C_tagMCTotalRechargePlayerInfo));
|
| | |
| | | AddAsyncTask<GatherSoulConfig>();
|
| | | AddAsyncTask<GatherSoulPropertyConfig>();
|
| | | AddAsyncTask<GatherSoulComposeConfig>();
|
| | | AddAsyncTask<KingTreasureConfig>();
|
| | |
|
| | | while (!AllCompleted())
|
| | | {
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5b663b3ba5393ed48b7fffe4aef93e06 |
| | | folderAsset: yes |
| | | timeCreated: 1545739922 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 347d20a1a7dffcf4480071f8d7c68df5 |
| | | folderAsset: yes |
| | | timeCreated: 1545739922 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, December 25, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using Snxxz.UI;
|
| | | public class DTCC103_tagMCCrossRealmPKPlayerHisSeasonInfo : DtcBasic
|
| | | {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HC103_tagMCCrossRealmPKPlayerHisSeasonInfo;
|
| | |
|
| | | if (package != null)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<KingTreasureModel>().OnReceivePackage(package);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: aea18089ed98537489e7a0b8be009aed |
| | | timeCreated: 1545740009 |
| | | 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 |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a29e6c04b20e24543b2b4257f691f2f3 |
| | | folderAsset: yes |
| | | timeCreated: 1545739922 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C1 03 跨服PK玩家历史赛季信息 #tagMCCrossRealmPKPlayerHisSeasonInfo
|
| | |
|
| | | public class HC103_tagMCCrossRealmPKPlayerHisSeasonInfo : GameNetPackBasic {
|
| | | public ushort Count; // 赛季个数
|
| | | public tagMCCrossRealmPKPlayerHisSeason[] SeasonList; // 赛季信息列表
|
| | |
|
| | | public HC103_tagMCCrossRealmPKPlayerHisSeasonInfo () {
|
| | | _cmd = (ushort)0xC103;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Count, vBytes, NetDataType.WORD);
|
| | | SeasonList = new tagMCCrossRealmPKPlayerHisSeason[Count];
|
| | | for (int i = 0; i < Count; i ++) {
|
| | | SeasonList[i] = new tagMCCrossRealmPKPlayerHisSeason();
|
| | | TransBytes (out SeasonList[i].SeasonID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out SeasonList[i].Order, vBytes, NetDataType.WORD);
|
| | | TransBytes (out SeasonList[i].DanLV, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out SeasonList[i].AwardLV, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCCrossRealmPKPlayerHisSeason {
|
| | | public ushort SeasonID; // 赛季ID
|
| | | public ushort Order; // 名次
|
| | | public byte DanLV; // 段位
|
| | | public byte AwardLV; // 赛季结算奖励等级,比如王者法宝的属性取该等级对应属性
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1a71510dacb88cd40ae18a7c3112ee2d |
| | | timeCreated: 1545739975 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | [XLua.Hotfix]
|
| | | public class KingThreeDimensionsBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Text m_Season;
|
| | | [SerializeField] Image m_State;
|
| | | [SerializeField] Text m_Division;
|
| | | [SerializeField] Text m_Score;
|
| | |
|
| | | KingTreasureModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<KingTreasureModel>(); }
|
| | | }
|
| | |
|
| | | public void Display(int treasureId)
|
| | | {
|
| | | var season = 0;
|
| | | if (model.TryGetSeason(treasureId, out season))
|
| | | {
|
| | | m_Season.text = season.ToString();
|
| | | }
|
| | | }
|
| | |
|
| | | public void Dispose()
|
| | | {
|
| | |
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: cc8974057d676b64e971f6c9c47acc19 |
| | | timeCreated: 1545721558 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | {
|
| | | public class KingTreasureModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, TreasureStatus> treasureStatusDict = new Dictionary<int, TreasureStatus>();
|
| | | 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>();
|
| | | Dictionary<int, CrossServerOneVsOneHistory> oneVsOneHistoryDict = new Dictionary<int, CrossServerOneVsOneHistory>();
|
| | |
|
| | | public event Action<int> treasureStatusRefresh;
|
| | | public event Action<int> treasureWearRefresh;
|
| | | public event Action oneVsOneHistoryRefresh;
|
| | |
|
| | | public int wearCountLimit { get; private set; }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
|
| | | ParseConfig();
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | treasureStatusDict.Clear();
|
| | | treasureWearDict.Clear();
|
| | | oneVsOneHistoryDict.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | |
| | | var config = Config.Instance.Get<FuncConfigConfig>("KingTreasure");
|
| | | if (config != null)
|
| | | {
|
| | | wearCountLimit = int.Parse(config.Numerical1);
|
| | | treasureSeasonDict = ConfigParse.GetDic<int, int>(config.Numerical1);
|
| | | wearCountLimit = int.Parse(config.Numerical2);
|
| | | }
|
| | |
|
| | | var configs = Config.Instance.GetAllValues<KingTreasureConfig>();
|
| | |
| | | && dict.TryGetValue(divisionLevel, out division);
|
| | | }
|
| | |
|
| | | public bool TryGetStatus(int treasureId, out TreasureStatus status)
|
| | | public bool IsWear(int treasureId)
|
| | | {
|
| | | return treasureStatusDict.TryGetValue(treasureId, out status);
|
| | | if (treasureWearDict.ContainsKey(treasureId))
|
| | | {
|
| | | return treasureWearDict[treasureId];
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void OnReceivePackage()
|
| | | public bool TryGetSeason(int treasureId, out int season)
|
| | | {
|
| | | return treasureSeasonDict.TryGetValue(treasureId, out season);
|
| | | }
|
| | |
|
| | | public void OnReceivePackage(HC103_tagMCCrossRealmPKPlayerHisSeasonInfo package)
|
| | | {
|
| | | oneVsOneHistoryDict.Clear();
|
| | | for (int i = 0; i < package.Count; i++)
|
| | | {
|
| | | var data = package.SeasonList[i];
|
| | | oneVsOneHistoryDict[data.SeasonID] = new CrossServerOneVsOneHistory()
|
| | | {
|
| | | season = data.SeasonID,
|
| | | division = data.DanLV,
|
| | | order = data.Order,
|
| | | rewardLevel = data.AwardLV,
|
| | | };
|
| | | }
|
| | | if (oneVsOneHistoryRefresh != null)
|
| | | {
|
| | | oneVsOneHistoryRefresh();
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnReceivePackage(HA352_tagMCMagicWeaponLVInfo package)
|
| | |
| | | for (int i = 0; i < package.Count; i++)
|
| | | {
|
| | | var data = package.InfoList[i];
|
| | | TreasureStatus status;
|
| | | if (!TryGetStatus((int)data.MWID, out status))
|
| | | var config = Config.Instance.Get<TreasureConfig>((int)data.MWID);
|
| | | if (config == null || config.Category != (int)TreasureCategory.King)
|
| | | {
|
| | | status = new TreasureStatus();
|
| | | treasureStatusDict.Add((int)data.MWID, status);
|
| | | continue;
|
| | | }
|
| | | if (treasureStatusRefresh != null)
|
| | | treasureWearDict[(int)data.MWID] = data.IsWear == 1;
|
| | | if (treasureWearRefresh != null)
|
| | | {
|
| | | treasureStatusRefresh((int)data.MWID);
|
| | | treasureWearRefresh((int)data.MWID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public Dictionary<int, int> propertys;
|
| | | }
|
| | |
|
| | | public class TreasureStatus
|
| | | public class CrossServerOneVsOneHistory
|
| | | {
|
| | | public int division { get; private set; }
|
| | | public bool isWear { get; private set; }
|
| | |
|
| | | public void OnReceive(int division)
|
| | | {
|
| | | this.division = division;
|
| | | }
|
| | |
|
| | | public void OnReceive(bool isWear)
|
| | | {
|
| | | this.isWear = isWear;
|
| | | }
|
| | |
|
| | | public void Reset()
|
| | | {
|
| | | division = 0;
|
| | | isWear = false;
|
| | | }
|
| | | public int season;
|
| | | public int order;
|
| | | public int division;
|
| | | public int rewardLevel;
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | void DisplayGot()
|
| | | {
|
| | | m_ContainerGot.gameObject.SetActive(true);
|
| | | KingTreasureModel.TreasureStatus status;
|
| | | List<int> basePropertys = new List<int>();
|
| | | List<int> specialPropertys = new List<int>();
|
| | | if (kingTreasureModel.TryGetStatus(model.selectedTreasure, out status))
|
| | | {
|
| | | //--todo 显示段位等级
|
| | | KingTreasureModel.Division division;
|
| | | if (kingTreasureModel.TryGetDivision(model.selectedTreasure, status.division, 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]]);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | //ingTreasureModel.TreasureStatus status;
|
| | | //ist<int> basePropertys = new List<int>();
|
| | | //ist<int> specialPropertys = new List<int>();
|
| | | //f (kingTreasureModel.TryGetStatus(model.selectedTreasure, out status))
|
| | | //{
|
| | | // //--todo 显示段位等级
|
| | | // KingTreasureModel.Division division;
|
| | | // if (kingTreasureModel.TryGetDivision(model.selectedTreasure, status.division, 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()
|
| | |
| | | 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))
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | 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();
|
| | |
| | |
|
| | | bool RequireGrayTreasureSkin()
|
| | | {
|
| | | if (category == TreasureCategory.King)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | Treasure _treasure;
|
| | | if (!model.TryGetTreasure(treasureId, out _treasure))
|
| | | {
|
| 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: |
| | |
| | | [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;
|
| | |
|
| | |
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | |
| | | 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)
|
| | | {
|
| | | default:
|
| | | displayTreasures.AddRange(list);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|