8124 子 【主干】新功能:累计充值 / 【前端】【主干】累计充值
| | |
| | | public static void Init()
|
| | | {
|
| | | // 登记相应的数据体及对应的数据转逻辑类
|
| | | Register(typeof(HA328_tagMCHistoryReChargeAwardRecord), typeof(DTCA328_tagMCHistoryReChargeAwardRecord));
|
| | | Register(typeof(HB311_tagGCTalkCache), typeof(DTCB311_tagGCTalkCache));
|
| | | Register(typeof(HAC01_tagGCFamilyWarInfo), typeof(DTCAC01_tagGCFamilyWarInfo));
|
| | | Register(typeof(HA40D_tagGCServerCreatFamilyTimes), typeof(DTCA40D_tagGCServerCreatFamilyTimes));
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Wednesday, July 17, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public partial class AddUpRechargeConfig |
| | | { |
| | | |
| | | public readonly int RewardID;
|
| | | public readonly int Recharge;
|
| | | public readonly string Reward;
|
| | | public readonly int VIPLimit; |
| | | |
| | | public AddUpRechargeConfig() |
| | | { |
| | | } |
| | | |
| | | public AddUpRechargeConfig(string input) |
| | | { |
| | | try |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out RewardID); |
| | |
|
| | | int.TryParse(tables[1],out Recharge); |
| | |
|
| | | Reward = tables[2];
|
| | |
|
| | | int.TryParse(tables[3],out VIPLimit); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | static Dictionary<string, AddUpRechargeConfig> configs = new Dictionary<string, AddUpRechargeConfig>(); |
| | | public static AddUpRechargeConfig Get(string id) |
| | | { |
| | | if (!inited) |
| | | { |
| | | Debug.Log("AddUpRechargeConfig 还未完成初始化。"); |
| | | return null; |
| | | } |
| | | |
| | | if (configs.ContainsKey(id)) |
| | | { |
| | | return configs[id]; |
| | | } |
| | | |
| | | AddUpRechargeConfig config = null; |
| | | if (rawDatas.ContainsKey(id)) |
| | | { |
| | | config = configs[id] = new AddUpRechargeConfig(rawDatas[id]); |
| | | rawDatas.Remove(id); |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static AddUpRechargeConfig Get(int id) |
| | | { |
| | | return Get(id.ToString()); |
| | | } |
| | | |
| | | public static List<string> GetKeys() |
| | | { |
| | | var keys = new List<string>(); |
| | | keys.AddRange(configs.Keys); |
| | | keys.AddRange(rawDatas.Keys); |
| | | return keys; |
| | | } |
| | | |
| | | public static List<AddUpRechargeConfig> GetValues() |
| | | { |
| | | var values = new List<AddUpRechargeConfig>(); |
| | | values.AddRange(configs.Values); |
| | | |
| | | var keys = new List<string>(rawDatas.Keys); |
| | | foreach (var key in keys) |
| | | { |
| | | values.Add(Get(key)); |
| | | } |
| | | |
| | | return values; |
| | | } |
| | | |
| | | public static bool Has(string id) |
| | | { |
| | | return configs.ContainsKey(id) || rawDatas.ContainsKey(id); |
| | | } |
| | | |
| | | public static bool Has(int id) |
| | | { |
| | | return Has(id.ToString()); |
| | | } |
| | | |
| | | public static bool inited { get; private set; } |
| | | protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>(); |
| | | public static void Init(bool sync=false) |
| | | { |
| | | inited = false; |
| | | var path = string.Empty; |
| | | if (AssetSource.refdataFromEditor) |
| | | { |
| | | path = ResourcesPath.CONFIG_FODLER +"/AddUpRecharge.txt"; |
| | | } |
| | | else |
| | | { |
| | | path = AssetVersionUtility.GetAssetFilePath("config/AddUpRecharge.txt"); |
| | | } |
| | | |
| | | configs.Clear(); |
| | | var tempConfig = new AddUpRechargeConfig(); |
| | | var preParse = tempConfig is IConfigPostProcess; |
| | | |
| | | if (sync) |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new AddUpRechargeConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | inited = true; |
| | | } |
| | | else |
| | | { |
| | | ThreadPool.QueueUserWorkItem((object _object) => |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new AddUpRechargeConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | inited = true; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8d24fb2f23ef9ec4898ccbdaebe0a226 |
| | | timeCreated: 1563346681 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, July 17, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | public class DTCA328_tagMCHistoryReChargeAwardRecord : DtcBasic {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HA328_tagMCHistoryReChargeAwardRecord;
|
| | | ModelCenter.Instance.GetModel<AddUpRechargeModel>().ReceivePackage(package);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f304f169157903a42840d01699d0b648 |
| | | timeCreated: 1563350936 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 28 历史累积充值奖励领取记录 #tagMCHistoryReChargeAwardRecord
|
| | |
|
| | | public class HA328_tagMCHistoryReChargeAwardRecord : GameNetPackBasic {
|
| | | public uint AwardGetRecord; // 按二进制位标示领取记录 配置奖励ID代表第几位
|
| | |
|
| | | public HA328_tagMCHistoryReChargeAwardRecord () {
|
| | | _cmd = (ushort)0xA328;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out AwardGetRecord, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fbd33c62f56476445a2cb17a801b4917 |
| | | timeCreated: 1563350923 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<VipRechargeWin>(false, 1);
|
| | | if (ModelCenter.Instance.GetModel<VipModel>().vipRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | WindowCenter.Instance.Open<VipRechargeWin>(false, 1);
|
| | | }
|
| | | else if(ModelCenter.Instance.GetModel<AddUpRechargeModel>().redpoint.state == RedPointState.Simple)
|
| | | {
|
| | | WindowCenter.Instance.Open<VipRechargeWin>(false, 2);
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<VipRechargeWin>(false, 1);
|
| | | }
|
| | | }
|
| | |
|
| | | void HeadButton()
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class AddUpRechargeBehaviour : CellView
|
| | | {
|
| | | [SerializeField] Text m_Title;
|
| | | [SerializeField] RareItem[] m_Items;
|
| | | [SerializeField] Text m_Progress;
|
| | | [SerializeField] Button m_GetReward;
|
| | | [SerializeField] Transform m_Complete;
|
| | | [SerializeField] Transform m_UnAchieve;
|
| | |
|
| | | VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
|
| | | AddUpRechargeModel model { get { return ModelCenter.Instance.GetModel<AddUpRechargeModel>(); } }
|
| | |
|
| | | public void Display(int id)
|
| | | {
|
| | | var config = AddUpRechargeConfig.Get(id);
|
| | | m_Title.text = string.Format("累计充值:{0}元", config.Recharge);
|
| | |
|
| | | List<Item> items;
|
| | | model.TryGetItems(id, out items);
|
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | if (items != null && i < items.Count)
|
| | | {
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | var item = items[i];
|
| | | var itemData = new ItemCellModel(item.id, true, (ulong)item.count);
|
| | | m_Items[i].SetItemRare(itemData, item.quality == 1);
|
| | | m_Items[i].button.SetListener(() =>
|
| | | {
|
| | | ItemTipUtility.Show(item.id);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Items[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | var state = model.GetAddUpRechargeState(id);
|
| | | m_Progress.gameObject.SetActive(state == -1);
|
| | | m_UnAchieve.gameObject.SetActive(state == -1);
|
| | | m_Complete.gameObject.SetActive(state == 1);
|
| | | m_GetReward.gameObject.SetActive(state == 0);
|
| | | switch (state)
|
| | | {
|
| | | case -1:
|
| | | m_Progress.text = StringUtility.Contact("进度:", PlayerDatas.Instance.baseData.coinPointTotal * 0.01, "/", config.Recharge);
|
| | | break;
|
| | | }
|
| | |
|
| | | m_GetReward.SetListener(() =>
|
| | | {
|
| | | model.SendGetReward(id);
|
| | | });
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7eac1fc4f4862d043a57b60c912a67bb |
| | | timeCreated: 1563348985 |
| | | 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; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class AddUpRechargeModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, Dictionary<int, List<Item>>> m_AddUpItems = new Dictionary<int, Dictionary<int, List<Item>>>();
|
| | |
|
| | | public readonly Redpoint redpoint = new Redpoint(35, 3506);
|
| | |
|
| | | public uint rewardRecord { get; private set; }
|
| | |
|
| | | public event Action onRewardRecordUpdate;
|
| | |
|
| | | VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | |
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | var configs = AddUpRechargeConfig.GetValues();
|
| | | foreach (var config in configs)
|
| | | {
|
| | | m_AddUpItems[config.RewardID] = new Dictionary<int, List<Item>>();
|
| | | var dict = m_AddUpItems[config.RewardID];
|
| | | var json = LitJson.JsonMapper.ToObject(config.Reward);
|
| | | foreach (var jobKey in json.Keys)
|
| | | {
|
| | | var job = int.Parse(jobKey);
|
| | | dict[job] = new List<Item>();
|
| | | var itemArray = LitJson.JsonMapper.ToObject<int[][]>(json[jobKey].ToJson());
|
| | | for (int i = 0; i < itemArray.Length; i++)
|
| | | {
|
| | | dict[job].Add(new Item()
|
| | | {
|
| | | id = itemArray[i][0],
|
| | | count = itemArray[i][1],
|
| | | quality = itemArray[i].Length > 2 ? itemArray[i][2] : 0,
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshEvent(PlayerDataType dataType)
|
| | | {
|
| | | if (dataType == PlayerDataType.VIPLv
|
| | | || dataType == PlayerDataType.ChangeCoinPointTotal)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetItems(int id,out List<Item> items)
|
| | | {
|
| | | items = null;
|
| | | if (m_AddUpItems.ContainsKey(id))
|
| | | {
|
| | | m_AddUpItems[id].TryGetValue(PlayerDatas.Instance.baseData.Job, out items);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void ReceivePackage(HA328_tagMCHistoryReChargeAwardRecord package)
|
| | | {
|
| | | rewardRecord = package.AwardGetRecord;
|
| | | if (onRewardRecordUpdate != null)
|
| | | {
|
| | | onRewardRecordUpdate();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool SatisfyAnyVipLevel()
|
| | | {
|
| | | var configs = AddUpRechargeConfig.GetValues();
|
| | | foreach (var config in configs)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.VIPLv >= config.VIPLimit)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public int GetAddUpRechargeState(int id)
|
| | | {
|
| | | if (MathUtility.GetBitValue(rewardRecord, (ushort)id))
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | var config = AddUpRechargeConfig.Get(id);
|
| | | if (PlayerDatas.Instance.baseData.VIPLv < config.VIPLimit)
|
| | | {
|
| | | return -1;
|
| | | }
|
| | | if (PlayerDatas.Instance.baseData.coinPointTotal * 0.01 < config.Recharge)
|
| | | {
|
| | | return -1;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public void SendGetReward(int id)
|
| | | {
|
| | | CA504_tagCMPlayerGetReward pak = new CA504_tagCMPlayerGetReward();
|
| | | pak.RewardType = (byte)GotServerRewardType.Def_RewardType_HistoryChargeAward;
|
| | | pak.DataEx = (uint)id;
|
| | | pak.DataExStrLen = 0;
|
| | | pak.DataExStr = string.Empty;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | void UpdateRedpoint()
|
| | | {
|
| | | var isOpen = SatisfyAnyVipLevel();
|
| | | var configs = AddUpRechargeConfig.GetValues();
|
| | | var redable = false;
|
| | | foreach (var config in configs)
|
| | | {
|
| | | if (isOpen && GetAddUpRechargeState(config.RewardID) == 0)
|
| | | {
|
| | | redable = true;
|
| | | }
|
| | | }
|
| | | redpoint.state = redable ? RedPointState.Simple : RedPointState.None;
|
| | | }
|
| | |
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5494b046cc7775d4daeac578bb40bbf1 |
| | | timeCreated: 1563343226 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, July 17, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class AddUpRechargeWin : Window
|
| | | {
|
| | | [SerializeField] ScrollerController m_Scroller;
|
| | | [SerializeField] Button m_Recharge;
|
| | | [SerializeField] Text m_GoldValue;
|
| | |
|
| | | AddUpRechargeModel model { get { return ModelCenter.Instance.GetModel<AddUpRechargeModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Scroller.OnRefreshCell += OnRefreshCell;
|
| | | m_Recharge.SetListener(() =>
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("FuncNoOpen_Nowaday");
|
| | | return;
|
| | | }
|
| | | if (FuncOpen.Instance.IsFuncOpen(113))
|
| | | {
|
| | | ModelCenter.Instance.GetModel<VipModel>().OpenVipPayUI(VipModel.VipWinType.Pay);
|
| | | }
|
| | | else
|
| | | {
|
| | | FuncOpen.Instance.ProcessorFuncErrorTip(113);
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | model.onRewardRecordUpdate += OnRewardRecordUpdate;
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.onRewardRecordUpdate -= OnRewardRecordUpdate;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void OnRewardRecordUpdate()
|
| | | {
|
| | | m_Scroller.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | |
|
| | | void Display()
|
| | | {
|
| | | m_GoldValue.text = UIHelper.ReplaceLargeNum(PlayerDatas.Instance.baseData.diamond);
|
| | |
|
| | | var configs = AddUpRechargeConfig.GetValues();
|
| | | var jumpIndex = 0;
|
| | | m_Scroller.Refresh();
|
| | | foreach (var config in configs)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.VIPLv >= config.VIPLimit)
|
| | | {
|
| | | m_Scroller.AddCell(ScrollerDataType.Header, config.RewardID);
|
| | | if (model.GetAddUpRechargeState(config.RewardID) == 1)
|
| | | {
|
| | | jumpIndex++;
|
| | | }
|
| | | }
|
| | | }
|
| | | jumpIndex = Mathf.Min(jumpIndex, configs.Count - 1);
|
| | | m_Scroller.Restart();
|
| | |
|
| | | var offset = 0f;
|
| | | m_Scroller.JumpIndex(jumpIndex, ref offset);
|
| | | var rect = m_Scroller.mScrollRect.transform as RectTransform;
|
| | | m_Scroller.JumpIndex(offset - rect.rect.height / 2, 0, EnhancedUI.EnhancedScroller.EnhancedScroller.TweenType.immediate);
|
| | | }
|
| | |
|
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var rechargeCell = cell as AddUpRechargeBehaviour;
|
| | | rechargeCell.Display(cell.index);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e9f80d8a5ec549a4c93db536d0891273 |
| | | timeCreated: 1563343249 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | {
|
| | | Pay = 0,
|
| | | Vip = 1,
|
| | | VipInverst = 2,
|
| | | MonthInvest = 3,
|
| | | AddUp = 2,
|
| | | }
|
| | |
|
| | | public VipWinType vipWinType = VipWinType.Vip;
|
| | |
| | | [SerializeField] Button closeBtn;
|
| | | [SerializeField] FunctionButton vipPayTitleBtn;
|
| | | [SerializeField] FunctionButton vipTitleBtn;
|
| | | [SerializeField] FunctionButton addUpBtn;
|
| | | [SerializeField] FunctionButtonGroup buttonGroup;
|
| | | [SerializeField] Image m_Line;
|
| | | [SerializeField] Vector3[] m_LinePositions;
|
| | |
|
| | | private VipModel m_Model;
|
| | | private VipModel model
|
| | |
| | |
|
| | | TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
|
| | |
|
| | | FairyJadeInvestmentModel m_FairyJadeInvestmentModel;
|
| | | FairyJadeInvestmentModel fairyJadeInvestmentModel { get { return m_FairyJadeInvestmentModel ?? (m_FairyJadeInvestmentModel = ModelCenter.Instance.GetModel<FairyJadeInvestmentModel>()); } }
|
| | | AddUpRechargeModel addUpRechargeModel { get { return ModelCenter.Instance.GetModel<AddUpRechargeModel>(); } }
|
| | | private VipModel.VipWinType presentWinType = VipModel.VipWinType.Vip;
|
| | |
|
| | | #region Built-in
|
| | |
| | | closeBtn.onClick.AddListener(OnClose);
|
| | | vipPayTitleBtn.onClick.AddListener(OnVipPay);
|
| | | vipTitleBtn.onClick.AddListener(OnVip);
|
| | | addUpBtn.onClick.AddListener(OnAddUp);
|
| | | }
|
| | |
|
| | | private void OnAddUp()
|
| | | {
|
| | | CloseChildWin();
|
| | | WindowCenter.Instance.Open<AddUpRechargeWin>();
|
| | | presentWinType = VipModel.VipWinType.AddUp;
|
| | | functionOrder = 2;
|
| | | }
|
| | |
|
| | | public void OnVipPay()
|
| | | {
|
| | | CloseChildWin();
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | DisplayButtonStates();
|
| | | CloseChildWin();
|
| | | model.OnVipOpenPayWinEvent += OnVipWinOpenEvnet;
|
| | | RechargeTipWin.JumpVipPanel += JumpVipPanel;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
|
| | | }
|
| | |
|
| | | private void JumpVipPanel()
|
| | |
| | | CloseChildWin();
|
| | | model.OnVipOpenPayWinEvent -= OnVipWinOpenEvnet;
|
| | | RechargeTipWin.JumpVipPanel -= JumpVipPanel;
|
| | |
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshEvent(PlayerDataType dataType)
|
| | | {
|
| | | if (dataType == PlayerDataType.VIPLv)
|
| | | {
|
| | | DisplayButtonStates();
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayButtonStates()
|
| | | {
|
| | | var isAddUpOpen = addUpRechargeModel.SatisfyAnyVipLevel();
|
| | | addUpBtn.gameObject.SetActive(isAddUpOpen);
|
| | | m_Line.rectTransform.localPosition = isAddUpOpen ? m_LinePositions[1] : m_LinePositions[0];
|
| | | }
|
| | |
|
| | | private void OnVipWinOpenEvnet()
|
| | | {
|
| | | if (presentWinType == model.vipWinType)
|
| | |
| | | vipPayTitleBtn.state = TitleBtnState.Click;
|
| | | break;
|
| | | case VipModel.VipWinType.Vip:
|
| | | vipTitleBtn.state = TitleBtnState.Click;
|
| | | OnVip();
|
| | | vipTitleBtn.state = TitleBtnState.Click;
|
| | | break;
|
| | | case VipModel.VipWinType.AddUp:
|
| | | OnAddUp();
|
| | | addUpBtn.state = TitleBtnState.Click;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | RegisterModel<MonthWeekInvestModel>();
|
| | | RegisterModel<NewDropItemModel>();
|
| | | RegisterModel<ExchangeActiveTokenModel>();
|
| | | RegisterModel<AddUpRechargeModel>();
|
| | | inited = true;
|
| | | }
|
| | |
|
| | |
| | | normalTasks.Add(new ConfigInitTask("OpenServerActivityConfig", () => { OpenServerActivityConfig.Init(); }, () => { return OpenServerActivityConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("RidingPetBossRewardConfig", () => { RidingPetBossRewardConfig.Init(); }, () => { return RidingPetBossRewardConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("ReikiRootEffectConfig", () => { ReikiRootEffectConfig.Init(); }, () => { return ReikiRootEffectConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("ItemExchangeConfig", () => { ItemExchangeConfig.Init(); }, () => { return ItemExchangeConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("ItemExchangeConfig", () => { ItemExchangeConfig.Init(); }, () => { return ItemExchangeConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("AddUpRechargeConfig", () => { AddUpRechargeConfig.Init(); }, () => { return AddUpRechargeConfig.inited; })); |
| | | } |
| | | |
| | | static List<ConfigInitTask> doingTasks = new List<ConfigInitTask>(); |
| | |
| | | Def_RewardType_FeastWeekPartyAct = 25, //领取节日巡礼活动奖励25
|
| | | Def_RewardType_FeastWeekPartyPoint = 26, //领取节日巡礼积分奖励26
|
| | | Def_RewardType_FairyAdventuresAward = 27,//缥缈奇遇
|
| | | Def_RewardType_HistoryChargeAward = 28,//累计充值
|
| | | }
|
| | |
|
| | | [XLua.LuaCallCSharp]
|