8715 子 【主干】【BT2】【测试】H.活动-节日祈愿/【主干】【前端】【BT2】H.活动-节日祈愿 - 节日祝福子界面
| | |
| | | Register(typeof(HAA42_tagMCFeastLoginInfo), typeof(DTCAA42_tagMCFeastLoginInfo));
|
| | | Register(typeof(HAA39_tagMCFeastLoginPlayerInfo), typeof(DTCAA39_tagMCFeastLoginPlayerInfo));
|
| | |
|
| | | Register(typeof(HAA43_tagMCFeastWishInfo), typeof(DTCAA43_tagMCFeastWishInfo));
|
| | | Register(typeof(HAA44_tagMCFeastWishPlayerInfo), typeof(DTCAA44_tagMCFeastWishPlayerInfo));
|
| | | Register(typeof(HAA45_tagMCFeastWishResult), typeof(DTCAA45_tagMCFeastWishResult));
|
| | | #endregion
|
| | | }
|
| | |
|
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 10 节日祝福瓶选择奖励物品 #tagCMFeastWishBottleChooseItem |
| | | |
| | | public class CAA10_tagCMFeastWishBottleChooseItem : GameNetPackBasic { |
| | | public byte BottleNum; //瓶子编号 |
| | | public byte RecordIndex; //物品索引,用于选择及记录是否已选择 |
| | | |
| | | public CAA10_tagCMFeastWishBottleChooseItem () { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xAA10; |
| | | } |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (BottleNum, NetDataType.BYTE); |
| | | WriteBytes (RecordIndex, NetDataType.BYTE); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 32de00e5247cfb842bf56a52aac81b2d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 11 节日祝福池祝福 #tagCMFeastWishPoolWish |
| | | |
| | | public class CAA11_tagCMFeastWishPoolWish : GameNetPackBasic { |
| | | public byte WishCount; //祝福次数 |
| | | |
| | | public CAA11_tagCMFeastWishPoolWish () { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xAA11; |
| | | } |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (WishCount, NetDataType.BYTE); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6395715942de8c4468c36b2e8802649d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | // AA 43 节日祝福活动信息 #tagMCFeastWishInfo |
| | | |
| | | public class DTCAA43_tagMCFeastWishInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA43_tagMCFeastWishInfo vNetData = vNetPack as HAA43_tagMCFeastWishInfo; |
| | | |
| | | OperationTimeHepler.Instance.UpdateHolidayWish(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6389daba18ea32b42bdfd2acda521382 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | |
| | | // AA 44 节日祝福活动玩家信息 #tagMCFeastWishPlayerInfo |
| | | |
| | | public class DTCAA44_tagMCFeastWishPlayerInfo : DtcBasic { |
| | | |
| | | HolidayWishPoolModel model { get { return ModelCenter.Instance.GetModel<HolidayWishPoolModel>(); } } |
| | | |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA44_tagMCFeastWishPlayerInfo vNetData = vNetPack as HAA44_tagMCFeastWishPlayerInfo; |
| | | |
| | | model.UpdateInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0f40199dfd060cf49ae1ec192afa4bdc |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | |
| | | // AA 45 节日祝福祝福结果 #tagMCFeastWishResult |
| | | |
| | | public class DTCAA45_tagMCFeastWishResult : DtcBasic { |
| | | |
| | | HolidayWishPoolModel model { get { return ModelCenter.Instance.GetModel<HolidayWishPoolModel>(); } } |
| | | |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA45_tagMCFeastWishResult vNetData = vNetPack as HAA45_tagMCFeastWishResult; |
| | | |
| | | model.OnAddWish(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73804b4fa0de1464da68194ab7d2c990 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 43 节日祝福活动信息 #tagMCFeastWishInfo |
| | | |
| | | public class HAA43_tagMCFeastWishInfo : GameNetPackBasic { |
| | | public string StartDate; // 开始日期 y-m-d |
| | | public string EndtDate; // 结束日期 y-m-d |
| | | public byte ResetType; // 重置类型,0-0点重置;1-5点开,5点重置;2-5点开,0点重置 |
| | | public byte WishPoolShowCount; //祝福池展示物品数 |
| | | public uint[] WishPoolShowItemList; //祝福池展示物品ID列表 |
| | | public byte BottleCount; // 祝福瓶个数 |
| | | public tagMCFeastWishBottleInfo[] BottleInfoList; // 祝福瓶信息 |
| | | |
| | | public HAA43_tagMCFeastWishInfo () { |
| | | _cmd = (ushort)0xAA43; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out StartDate, vBytes, NetDataType.Chars, 10); |
| | | TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10); |
| | | TransBytes (out ResetType, vBytes, NetDataType.BYTE); |
| | | TransBytes (out WishPoolShowCount, vBytes, NetDataType.BYTE); |
| | | TransBytes (out WishPoolShowItemList, vBytes, NetDataType.DWORD, WishPoolShowCount); |
| | | TransBytes (out BottleCount, vBytes, NetDataType.BYTE); |
| | | BottleInfoList = new tagMCFeastWishBottleInfo[BottleCount]; |
| | | for (int i = 0; i < BottleCount; i ++) { |
| | | BottleInfoList[i] = new tagMCFeastWishBottleInfo(); |
| | | TransBytes (out BottleInfoList[i].BottleNum, vBytes, NetDataType.BYTE); |
| | | TransBytes (out BottleInfoList[i].NeedWishValue, vBytes, NetDataType.WORD); |
| | | TransBytes (out BottleInfoList[i].ChooseTimeMax, vBytes, NetDataType.BYTE); |
| | | TransBytes (out BottleInfoList[i].ChoosePrizeCount, vBytes, NetDataType.BYTE); |
| | | BottleInfoList[i].ChoosePrizeList = new tagMCFeastWishBottleItem[BottleInfoList[i].ChoosePrizeCount]; |
| | | for (int j = 0; j < BottleInfoList[i].ChoosePrizeCount; j ++) { |
| | | BottleInfoList[i].ChoosePrizeList[j] = new tagMCFeastWishBottleItem(); |
| | | TransBytes (out BottleInfoList[i].ChoosePrizeList[j].RecordIndex, vBytes, NetDataType.BYTE); |
| | | TransBytes (out BottleInfoList[i].ChoosePrizeList[j].ItemID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out BottleInfoList[i].ChoosePrizeList[j].ItemCount, vBytes, NetDataType.WORD); |
| | | TransBytes (out BottleInfoList[i].ChoosePrizeList[j].IsBind, vBytes, NetDataType.BYTE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public struct tagMCFeastWishBottleInfo { |
| | | public byte BottleNum; //瓶子编号 |
| | | public ushort NeedWishValue; //单次领奖所需祝福值 |
| | | public byte ChooseTimeMax; //最大可领奖次数 |
| | | public byte ChoosePrizeCount; //可选择奖励个数 |
| | | public tagMCFeastWishBottleItem[] ChoosePrizeList; // 选择奖励物品列表,已选过的无法再选 |
| | | } |
| | | |
| | | public struct tagMCFeastWishBottleItem { |
| | | public byte RecordIndex; //物品索引,用于选择及记录是否已选择 |
| | | public uint ItemID; |
| | | public ushort ItemCount; |
| | | public byte IsBind; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 493eeebd8fe9f8647a73248300a6bf63 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 44 节日祝福活动玩家信息 #tagMCFeastWishPlayerInfo |
| | | |
| | | public class HAA44_tagMCFeastWishPlayerInfo : GameNetPackBasic { |
| | | public byte BottleCount; // 祝福瓶个数 |
| | | public tagMCFeastWishPlayerBottle[] PlayerBottleInfo; // 祝福瓶信息 |
| | | |
| | | public HAA44_tagMCFeastWishPlayerInfo () { |
| | | _cmd = (ushort)0xAA44; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out BottleCount, vBytes, NetDataType.BYTE); |
| | | PlayerBottleInfo = new tagMCFeastWishPlayerBottle[BottleCount]; |
| | | for (int i = 0; i < BottleCount; i ++) { |
| | | PlayerBottleInfo[i] = new tagMCFeastWishPlayerBottle(); |
| | | TransBytes (out PlayerBottleInfo[i].BottleNum, vBytes, NetDataType.BYTE); |
| | | TransBytes (out PlayerBottleInfo[i].WishValue, vBytes, NetDataType.WORD); |
| | | TransBytes (out PlayerBottleInfo[i].ChooseRecord, vBytes, NetDataType.DWORD); |
| | | } |
| | | } |
| | | |
| | | public struct tagMCFeastWishPlayerBottle { |
| | | public byte BottleNum; //瓶子编号 |
| | | public ushort WishValue; //当前可用祝福值 |
| | | public uint ChooseRecord; //已选物品索引记录,与记录索引位运算判断是否已选择;累计已选择次数前端自己计算,通过该值可算出 |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: bbf6572f0f3ef834b95a2810b7b86847 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 45 节日祝福祝福结果 #tagMCFeastWishResult |
| | | |
| | | public class HAA45_tagMCFeastWishResult : GameNetPackBasic { |
| | | public ushort AddWishValue; // 本次增加的祝福值 |
| | | public ushort WishResultLen; |
| | | public string WishResult; // 获得物品结果[[物品ID,个数,是否绑定], ...] |
| | | |
| | | public HAA45_tagMCFeastWishResult () { |
| | | _cmd = (ushort)0xAA45; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out AddWishValue, vBytes, NetDataType.WORD); |
| | | TransBytes (out WishResultLen, vBytes, NetDataType.WORD); |
| | | TransBytes (out WishResult, vBytes, NetDataType.Chars, WishResultLen); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0ce5b0f0805bebe49ba639bc0022ea72 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | OperationTimeHepler.Instance.TryGetOperation(Operation.HolidayLogin, out holiday); |
| | | redPoint.state = RedPointState.None; |
| | | |
| | | if (holiday == null) return; //封包顺序如果有问题 此处为空 |
| | | |
| | | for (int i = 0; i < holiday.loginAwards.Count; i++) |
| | | { |
| | | if (GetLoginAwardState(holiday.loginAwards[i].DayNum) == 1) |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, April 18, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class HolidayWishBottle : MonoBehaviour |
| | | { |
| | | [SerializeField] Image bottleWater; |
| | | [SerializeField] Image bottleFull; |
| | | [SerializeField] UIAlphaTween m_AlphaTween; |
| | | [SerializeField] Text waterProcess; |
| | | [SerializeField] Text isOver; |
| | | [SerializeField] UIEffect AddWish; |
| | | [SerializeField] TextMove AddWishText; |
| | | [SerializeField] Button OpenAwards; |
| | | |
| | | HolidayWishPoolModel model { get { return ModelCenter.Instance.GetModel<HolidayWishPoolModel>(); } } |
| | | |
| | | private void Awake() |
| | | { |
| | | model.UpdateWishNum += ShowAddEffect; |
| | | } |
| | | |
| | | |
| | | public void Display(byte bottleNum, OperationHolidayWish holiday) |
| | | { |
| | | AddWish.gameObject.SetActive(true); |
| | | bottleFull.gameObject.SetActive(false); |
| | | m_AlphaTween.enabled = false; |
| | | |
| | | var process = Math.Min(model.GetBottleProcessState(bottleNum, holiday), 1); |
| | | if (process == -1) |
| | | { |
| | | //已领完 |
| | | isOver.gameObject.SetActive(true); |
| | | |
| | | bottleFull.gameObject.SetActive(false); |
| | | bottleWater.gameObject.SetActive(false); |
| | | waterProcess.gameObject.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | if (process == 1) |
| | | { |
| | | //已满 |
| | | bottleFull.gameObject.SetActive(true); |
| | | m_AlphaTween.enabled = true; |
| | | m_AlphaTween.Play(); |
| | | } |
| | | isOver.gameObject.SetActive(false); |
| | | |
| | | bottleWater.gameObject.SetActive(true); |
| | | bottleWater.fillAmount = process; |
| | | waterProcess.gameObject.SetActive(true); |
| | | waterProcess.text = (int)(process * 100) + "%"; |
| | | } |
| | | |
| | | OpenAwards.SetListener(() => |
| | | { |
| | | model.bottleNumSelect = bottleNum; |
| | | WindowCenter.Instance.Open<WishBottleAwardWin>(); |
| | | }); |
| | | } |
| | | |
| | | public void ShowAddEffect(int num) |
| | | { |
| | | AddWishText.Begin(Language.Get("SubWishInfo3", num)); |
| | | AddWish.Play(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ac8419ef66b74134787c567518e24609 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, September 26, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | public class HolidayWishPoolItemCell : CellView { |
| | | [SerializeField] ItemCell itemCell; |
| | | |
| | | public void Display(int index) |
| | | { |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(Operation.HolidayWish, out holiday); |
| | | |
| | | //第一个为标的物 |
| | | int itemID = (int)holiday.wishPool[index]; |
| | | var config = ItemConfig.Get(itemID); |
| | | var itemData = new ItemCellModel(itemID, false, 1); |
| | | itemCell.Init(itemData); |
| | | itemCell.button.SetListener(()=> { |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ea4bf8da19778c4293fcf6b234c8360 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class HolidayWishPoolModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity |
| | | { |
| | | public event Action<int> onStateUpdate; |
| | | public const int redPointID = 28002; |
| | | public Redpoint redPoint = new Redpoint(MainRedDot.RedPoint_HolidayWishes, redPointID); |
| | | Operation operationType = Operation.HolidayWish; |
| | | |
| | | //节日祝福 id从101开始和精彩活动区分 |
| | | public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_JRZF; |
| | | public const int activityID = 102; |
| | | |
| | | //瓶子编号对应的int2<祝福值,领取情况> |
| | | public Dictionary<byte, Int2> bottleDict = new Dictionary<byte, Int2>(); |
| | | public event Action UpdateBottleInfo; // 瓶子信息变更 祝福值和领奖情况 |
| | | public event Action UpdateLegendMsg; |
| | | public event Action<int> UpdateWishNum; |
| | | |
| | | public byte bottleNumSelect; |
| | | public List<WishLegend> wishLegends = new List<WishLegend>(); |
| | | |
| | | public int wishItemID; //祝福需要的物品ID |
| | | public int wishCount1; // 祝福次数 |
| | | public int wishSingleNeedNum = 1; //单次祝福需要的物品数量 |
| | | public int wishCount2; |
| | | |
| | | bool IsRequestLegend = false; //首次启动界面请求 |
| | | int viewType = 17; |
| | | |
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | |
| | | public override void Init() |
| | | { |
| | | playerPack.refreshItemCountEvent += RefreshItemCountEvent; |
| | | DTCA003_tagUniversalGameRecInfo.onGetUniversalGameInfo += OnGetUniversalGameInfo; |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent; |
| | | OpenServerActivityCenter.Instance.Register(activityID, this, activityType); |
| | | |
| | | var funcCfg = FuncConfigConfig.Get("FeastWishCfg"); |
| | | wishItemID = int.Parse(funcCfg.Numerical1); |
| | | var _jsonDataC = LitJson.JsonMapper.ToObject(funcCfg.Numerical2); |
| | | if (_jsonDataC.Count > 0) |
| | | { |
| | | wishCount1 = int.Parse(_jsonDataC[0].ToString()); |
| | | wishCount2 = int.Parse(_jsonDataC[1].ToString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | bottleDict.Clear(); |
| | | IsRequestLegend = false; |
| | | wishLegends.Clear(); |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | } |
| | | |
| | | public override void UnInit() |
| | | { |
| | | playerPack.refreshItemCountEvent -= RefreshItemCountEvent; |
| | | DTCA003_tagUniversalGameRecInfo.onGetUniversalGameInfo -= OnGetUniversalGameInfo; |
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent; |
| | | } |
| | | |
| | | public bool IsOpen { |
| | | get { |
| | | return OperationTimeHepler.Instance.SatisfyOpenCondition(operationType); |
| | | } |
| | | } |
| | | |
| | | public bool priorityOpen { |
| | | get { |
| | | return redPoint.state == RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | public bool IsAdvance { |
| | | get { |
| | | return OperationTimeHepler.Instance.SatisfyAdvanceCondition(operationType); |
| | | } |
| | | } |
| | | |
| | | private void OperationEndEvent(Operation type, int state) |
| | | { |
| | | if (type == operationType && state == 0) |
| | | { |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OperationAdvanceEvent(Operation type) |
| | | { |
| | | if (type == operationType) |
| | | { |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OperationStartEvent(Operation type, int state) |
| | | { |
| | | if (type == operationType && state == 0) |
| | | { |
| | | |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //0 可领取 1 已领取 |
| | | public int GetBottleAwardState(byte bottleNum, int index) |
| | | { |
| | | |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday); |
| | | |
| | | int recordIndex = holiday.wishBottles[bottleNumSelect].ChoosePrizeList[index].RecordIndex; |
| | | if (((int)Math.Pow(2, recordIndex) & bottleDict[bottleNum].y) == 0) |
| | | { |
| | | return 0; |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | void UpdateRedpoint() |
| | | { |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday); |
| | | redPoint.state = RedPointState.None; |
| | | |
| | | if (holiday == null) return; //封包顺序如果有问题 此处为空 |
| | | |
| | | // 瓶子的祝福值满 和 有祝福值可祈愿的情况 增加红点 |
| | | foreach (var bottle in bottleDict) |
| | | { |
| | | var state = GetBottleProcessState(bottle.Key, holiday); |
| | | if (state >= 1) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | if (playerPack.GetItemCountByID(PackType.Item, wishItemID) >= wishCount1) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | } |
| | | |
| | | } |
| | | |
| | | //瓶子进度0到1, -1代表已领完 |
| | | public float GetBottleProcessState(byte bottleNum, OperationHolidayWish holiday) |
| | | { |
| | | if (holiday == null) return 0; |
| | | if (!bottleDict.ContainsKey(bottleNum) || !holiday.wishBottles.ContainsKey(bottleNum)) return 0; |
| | | |
| | | if (NumberOf1(bottleDict[bottleNum].y) >= holiday.wishBottles[bottleNum].ChooseTimeMax) |
| | | return -1; |
| | | |
| | | return bottleDict[bottleNum].x / (float)holiday.wishBottles[bottleNum].NeedWishValue; |
| | | } |
| | | |
| | | //遍历每次消除一个1,有多少次就多少个1 |
| | | private int NumberOf1(int n) |
| | | { |
| | | int count = 0; |
| | | while (n != 0) |
| | | { |
| | | count++; |
| | | n &= n - 1; |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | public void UpdateInfo(HAA44_tagMCFeastWishPlayerInfo netPack) |
| | | { |
| | | for (int i = 0; i < netPack.PlayerBottleInfo.Length; i++) |
| | | { |
| | | byte bottleNum = netPack.PlayerBottleInfo[i].BottleNum; |
| | | if (bottleDict.ContainsKey(bottleNum)) |
| | | { |
| | | bottleDict[bottleNum] = new Int2(netPack.PlayerBottleInfo[i].WishValue, (int)netPack.PlayerBottleInfo[i].ChooseRecord); |
| | | } |
| | | else |
| | | { |
| | | bottleDict.Add(bottleNum, new Int2(netPack.PlayerBottleInfo[i].WishValue, (int)netPack.PlayerBottleInfo[i].ChooseRecord)); |
| | | } |
| | | } |
| | | |
| | | if (UpdateBottleInfo != null) |
| | | UpdateBottleInfo(); |
| | | |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | public void SendWish(byte wishCount) |
| | | { |
| | | CAA11_tagCMFeastWishPoolWish wish = new CAA11_tagCMFeastWishPoolWish(); |
| | | wish.WishCount = wishCount; |
| | | GameNetSystem.Instance.SendInfo(wish); |
| | | } |
| | | |
| | | private void RefreshItemCountEvent(PackType packType, int index, int itemId) |
| | | { |
| | | if (itemId != wishItemID) return; |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | |
| | | //每次启动游戏 只在打开界面做一次请求,后续会收到服务端单条通知 |
| | | public void RequestLegend() |
| | | { |
| | | if (IsRequestLegend) return; |
| | | IsRequestLegend = true; |
| | | CA001_tagViewUniversalGameRec legend = new CA001_tagViewUniversalGameRec(); |
| | | legend.ViewType = (byte)viewType; |
| | | GameNetSystem.Instance.SendInfo(legend); |
| | | } |
| | | |
| | | public void OnAddWish(HAA45_tagMCFeastWishResult netPack) |
| | | { |
| | | if (UpdateWishNum != null) |
| | | { |
| | | UpdateWishNum((int)netPack.AddWishValue); |
| | | } |
| | | } |
| | | |
| | | private void OnGetUniversalGameInfo(HA003_tagUniversalGameRecInfo package) |
| | | { |
| | | if (!IsRequestLegend) |
| | | { |
| | | //界面首次启动后会获取一次总信息 |
| | | return; |
| | | } |
| | | |
| | | if (package.Type != viewType) return; |
| | | for (int i = 0; i < package.Count; i++) |
| | | { |
| | | WishLegend msg = new WishLegend() |
| | | { |
| | | name = package.UniversalGameRec[i].StrValue1, |
| | | itemID = (int)package.UniversalGameRec[i].Value1, |
| | | itemCount = (int)package.UniversalGameRec[i].Value2, |
| | | source = (int)package.UniversalGameRec[i].Value3, |
| | | }; |
| | | |
| | | wishLegends.Add(msg); |
| | | } |
| | | if (wishLegends.Count > 35) |
| | | wishLegends.RemoveRange(0, 5); |
| | | |
| | | if (UpdateLegendMsg != null) |
| | | UpdateLegendMsg(); |
| | | |
| | | } |
| | | |
| | | public struct WishLegend |
| | | { |
| | | public string name; |
| | | public int itemID; |
| | | public int itemCount; |
| | | public int source; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: cf43871e7f02e6c4da7abc3b4f7bb861 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, April 18, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class HolidayWishPoolWin : Window |
| | | { |
| | | List<HolidayWishBottle> bottleList = new List<HolidayWishBottle>(); |
| | | |
| | | ScrollerController m_Controller; // 物品 |
| | | Button wish1; |
| | | Text wishTxt1; |
| | | Text wishNeedNum1; |
| | | |
| | | Button wish2; |
| | | Text wishTxt2; |
| | | Text wishNeedNum2; |
| | | |
| | | Text allStarNum; //可祝福的物品总数 |
| | | RichText wishLegend; |
| | | |
| | | Operation operationType = Operation.HolidayWish; |
| | | |
| | | HolidayWishPoolModel model { get { return ModelCenter.Instance.GetModel<HolidayWishPoolModel>(); } } |
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | bottleList.Add(GetWidgt<HolidayWishBottle>("light1")); |
| | | bottleList.Add(GetWidgt<HolidayWishBottle>("light2")); |
| | | bottleList.Add(GetWidgt<HolidayWishBottle>("light3")); |
| | | bottleList.Add(GetWidgt<HolidayWishBottle>("light4")); |
| | | bottleList.Add(GetWidgt<HolidayWishBottle>("light5")); |
| | | |
| | | m_Controller = GetWidgt<ScrollerController>("ScrollerControl"); |
| | | |
| | | wish1 = GetWidgt<Button>("wishbtn1"); |
| | | wishTxt1 = GetWidgt<Text>("Text1"); |
| | | wishNeedNum1 = GetWidgt<Text>("startnum1"); |
| | | |
| | | wish2 = GetWidgt<Button>("wishbtn2"); |
| | | wishTxt2 = GetWidgt<Text>("Text2"); |
| | | wishNeedNum2 = GetWidgt<Text>("startnum2"); |
| | | |
| | | allStarNum = GetWidgt<Text>("allstarnum"); |
| | | wishLegend = GetWidgt<RichText>("Content1"); |
| | | } |
| | | |
| | | |
| | | void UseItemWish(int needEmpty, byte useCnt) |
| | | { |
| | | if (useCnt > playerPack.GetItemCountByID(PackType.Item, model.wishItemID)) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("RealmLevelUpError_3"); |
| | | return; |
| | | } |
| | | int emptyCnt = playerPack.GetEmptyGridCount(PackType.Item); |
| | | if (emptyCnt < needEmpty) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("GeRen_lhs_202580"); |
| | | return; |
| | | } |
| | | model.SendWish(useCnt); |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | wish1.SetListener(() => |
| | | { |
| | | UseItemWish(2, (byte)model.wishCount1); |
| | | }); |
| | | |
| | | wish2.SetListener(() => |
| | | { |
| | | UseItemWish(2, (byte)model.wishCount2); |
| | | }); |
| | | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | model.RequestLegend(); |
| | | m_Controller.OnRefreshCell += OnRefreshCell; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent; |
| | | playerPack.refreshItemCountEvent += RefreshItemCountEvent; |
| | | model.UpdateLegendMsg += UpdateLegendMsg; |
| | | model.UpdateBottleInfo += Display; |
| | | |
| | | } |
| | | |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | m_Controller.OnRefreshCell -= OnRefreshCell; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent; |
| | | playerPack.refreshItemCountEvent -= RefreshItemCountEvent; |
| | | model.UpdateLegendMsg -= UpdateLegendMsg; |
| | | model.UpdateBottleInfo -= Display; |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | private void RefreshItemCountEvent(PackType packType, int index, int itemId) |
| | | { |
| | | if (itemId != model.wishItemID) return; |
| | | var itemCnt = playerPack.GetItemCountByID(PackType.Item, model.wishItemID); |
| | | allStarNum.text = itemCnt.ToString(); |
| | | |
| | | if (itemCnt < model.wishSingleNeedNum * model.wishCount1) |
| | | wishNeedNum1.color = UIHelper.GetUIColor(TextColType.Red, true); |
| | | else |
| | | wishNeedNum1.color = UIHelper.GetUIColor(TextColType.LightYellow, true); |
| | | |
| | | if (itemCnt < model.wishSingleNeedNum * model.wishCount2) |
| | | wishNeedNum2.color = UIHelper.GetUIColor(TextColType.Red, true); |
| | | else |
| | | wishNeedNum2.color = UIHelper.GetUIColor(TextColType.LightYellow, true); |
| | | } |
| | | |
| | | |
| | | void Display() |
| | | { |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday); |
| | | |
| | | int index = 0; |
| | | foreach(var key in holiday.wishBottles.Keys) |
| | | { |
| | | if (index >= bottleList.Count) |
| | | { |
| | | break; |
| | | } |
| | | bottleList[index].gameObject.SetActive(true); |
| | | bottleList[index].Display(key, holiday); |
| | | index++; |
| | | } |
| | | for (int i = index; i < bottleList.Count; i++) |
| | | { |
| | | bottleList[i].gameObject.SetActive(false); |
| | | } |
| | | |
| | | DisplayScroll(); |
| | | |
| | | var itemCnt = playerPack.GetItemCountByID(PackType.Item, model.wishItemID); |
| | | |
| | | wishTxt1.text = Language.Get("SubWishInfo4", model.wishCount1); |
| | | wishNeedNum1.text = (model.wishSingleNeedNum * model.wishCount1).ToString(); |
| | | if (itemCnt < model.wishSingleNeedNum * model.wishCount1) |
| | | wishNeedNum1.color = UIHelper.GetUIColor(TextColType.Red, true); |
| | | else |
| | | wishNeedNum1.color = UIHelper.GetUIColor(TextColType.LightYellow, true); |
| | | |
| | | wishTxt2.text = Language.Get("SubWishInfo4", model.wishCount2); |
| | | wishNeedNum2.text = (model.wishSingleNeedNum * model.wishCount2).ToString(); |
| | | if (itemCnt < model.wishSingleNeedNum * model.wishCount2) |
| | | wishNeedNum2.color = UIHelper.GetUIColor(TextColType.Red, true); |
| | | else |
| | | wishNeedNum2.color = UIHelper.GetUIColor(TextColType.LightYellow, true); |
| | | |
| | | allStarNum.text = itemCnt.ToString(); |
| | | } |
| | | |
| | | void DisplayScroll() |
| | | { |
| | | m_Controller.Refresh(); |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday); |
| | | |
| | | for (int i = 0; i < holiday.wishPool.Count; i++) |
| | | { |
| | | m_Controller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | m_Controller.Restart(); |
| | | m_Controller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | if (type != ScrollerDataType.Header) return; |
| | | var _cell = cell as HolidayWishPoolItemCell; |
| | | _cell.Display(_cell.index); |
| | | } |
| | | |
| | | private void OperationTimeUpdateEvent(Operation type) |
| | | { |
| | | if (type == operationType) |
| | | { |
| | | Display(); |
| | | } |
| | | } |
| | | |
| | | void UpdateLegendMsg() |
| | | { |
| | | string msg = string.Empty; |
| | | foreach (var legend in model.wishLegends) |
| | | { |
| | | if (legend.source == 1) |
| | | { |
| | | //祝福瓶获得 |
| | | msg += Language.Get("SubWishInfo6", legend.name, legend.itemID, legend.itemCount); |
| | | } |
| | | else { |
| | | msg += Language.Get("SubWishInfo5", legend.name, legend.itemID, legend.itemCount); |
| | | } |
| | | } |
| | | |
| | | wishLegend.text = msg; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 833ff8bebd4e1004aa9a7c597fbd710e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | { |
| | | base.AddListeners(); |
| | | SetFunctionListener(0, ShowLoginWin); |
| | | SetFunctionListener(1, ShowAlchemyNormalDrug); |
| | | SetFunctionListener(1, ShowHolidayWishPoolWin); |
| | | SetFunctionListener(2, ShowAlchemyFairy); |
| | | SetFunctionListener(3, ShowAlchemyFairyDrug); |
| | | } |
| | |
| | | SetFunctionButtonActive(3, false); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | for (int i = 0; i < 4; i++) |
| | | { |
| | | if (GetFunctionButtonRedPointState(i) != RedPointState.None) |
| | | { |
| | | FunctionButtonInvoke(i); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | CloseSubWindows(); |
| | | base.OnPreClose(); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | functionOrder = 0; |
| | | } |
| | | |
| | | private void ShowAlchemyNormalDrug() |
| | | private void ShowHolidayWishPoolWin() |
| | | { |
| | | CloseSubWindows(); |
| | | WindowCenter.Instance.Open<AlchemyNormalUseDrugWin>(); |
| | | WindowCenter.Instance.Open<HolidayWishPoolWin>(); |
| | | functionOrder = 1; |
| | | } |
| | | |
| New file |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI |
| | | { |
| | | public class OperationHolidayWish : OperationBase |
| | | { |
| | | //瓶子编号对应的信息 |
| | | public Dictionary<byte, HAA43_tagMCFeastWishInfo.tagMCFeastWishBottleInfo> wishBottles = new Dictionary<byte, HAA43_tagMCFeastWishInfo.tagMCFeastWishBottleInfo>(); |
| | | public List<uint> wishPool = new List<uint>(); //展示奖池物品ID |
| | | |
| | | public override bool SatisfyOpenCondition() |
| | | { |
| | | return PlayerDatas.Instance.baseData.LV >= limitLv; |
| | | } |
| | | |
| | | public override string ToDisplayTime() |
| | | { |
| | | var textBuilder = OperationTimeHepler.textBuilder; |
| | | textBuilder.Length = 0; |
| | | textBuilder.Append(startDate.ToDisplay()); |
| | | if (startDate != endDate) |
| | | { |
| | | textBuilder.Append("—"); |
| | | textBuilder.Append(endDate.ToDisplay()); |
| | | } |
| | | return textBuilder.ToString(); |
| | | } |
| | | |
| | | public override void Reset() |
| | | { |
| | | base.Reset(); |
| | | } |
| | | |
| | | public void ParsePackage(HAA43_tagMCFeastWishInfo package) |
| | | { |
| | | wishPool.Clear(); |
| | | for (int i = 0; i < package.WishPoolShowItemList.Length; i++) |
| | | { |
| | | wishPool.Add(package.WishPoolShowItemList[i]); |
| | | } |
| | | |
| | | wishBottles.Clear(); |
| | | for (int i = 0; i < package.BottleInfoList.Length; i++) |
| | | { |
| | | wishBottles.Add(package.BottleInfoList[i].BottleNum, package.BottleInfoList[i]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4dd67f0928853d14eb487df8dfb9aa79 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, September 14, 2017 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class TextMove : MonoBehaviour |
| | | { |
| | | [SerializeField] ScreenMoveTo m_MoveTo; |
| | | [SerializeField] UIAlphaTween m_AlphaTween; |
| | | |
| | | [SerializeField] Text m_Text; |
| | | public float startX; |
| | | public float startY; |
| | | |
| | | |
| | | public void Begin(string content) |
| | | { |
| | | this.transform.SetActive(true); |
| | | SetEnable(true); |
| | | m_Text.text = content; |
| | | |
| | | this.transform.localPosition = new Vector3(startX, startY, 0); |
| | | m_MoveTo.Begin(OnFloatEnd); |
| | | m_Text.color = m_Text.color.SetA(1f); |
| | | m_AlphaTween.SetStartState(); |
| | | m_AlphaTween.Play(); |
| | | } |
| | | |
| | | public void SetEnable(bool _enable) |
| | | { |
| | | m_MoveTo.enabled = _enable; |
| | | m_AlphaTween.enabled = _enable; |
| | | } |
| | | |
| | | private void OnFloatEnd() |
| | | { |
| | | SetEnable(false); |
| | | this.transform.SetActive(false); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 533fe0e50f5571946a1462416c3d622b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, June 21, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class WishBottleAwardWin : Window |
| | | { |
| | | |
| | | List<ItemCell> itemList = new List<ItemCell>(); |
| | | List<Image> itemSelect = new List<Image>(); |
| | | List<Image> getYetList = new List<Image>(); |
| | | Button m_OKButton; |
| | | Text m_Text; |
| | | Button m_CloseButton; |
| | | |
| | | int SelectIndex = -1; |
| | | Operation operationType = Operation.HolidayWish; |
| | | |
| | | HolidayWishPoolModel model { get { return ModelCenter.Instance.GetModel<HolidayWishPoolModel>(); } } |
| | | |
| | | #region Built-in |
| | | |
| | | protected override void BindController() |
| | | { |
| | | itemList.Clear(); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell1")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell2")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell3")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell4")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell5")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell6")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell7")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell8")); |
| | | |
| | | itemSelect.Clear(); |
| | | itemSelect.Add(GetWidgt<Image>("select1")); |
| | | itemSelect.Add(GetWidgt<Image>("select2")); |
| | | itemSelect.Add(GetWidgt<Image>("select3")); |
| | | itemSelect.Add(GetWidgt<Image>("select4")); |
| | | itemSelect.Add(GetWidgt<Image>("select5")); |
| | | itemSelect.Add(GetWidgt<Image>("select6")); |
| | | itemSelect.Add(GetWidgt<Image>("select7")); |
| | | itemSelect.Add(GetWidgt<Image>("select8")); |
| | | |
| | | getYetList.Clear(); |
| | | getYetList.Add(GetWidgt<Image>("yet1")); |
| | | getYetList.Add(GetWidgt<Image>("yet2")); |
| | | getYetList.Add(GetWidgt<Image>("yet3")); |
| | | getYetList.Add(GetWidgt<Image>("yet4")); |
| | | getYetList.Add(GetWidgt<Image>("yet5")); |
| | | getYetList.Add(GetWidgt<Image>("yet6")); |
| | | getYetList.Add(GetWidgt<Image>("yet7")); |
| | | getYetList.Add(GetWidgt<Image>("yet8")); |
| | | |
| | | m_OKButton = GetWidgt<Button>("OK"); |
| | | m_CloseButton = GetWidgt<Button>("CloseBtn"); |
| | | m_Text = GetWidgt<Text>("wishText"); |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_CloseButton.AddListener(CloseClick); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | SelectIndex = -1; |
| | | model.UpdateBottleInfo += Display; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | model.UpdateBottleInfo -= Display; |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | void Display() |
| | | { |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday); |
| | | |
| | | |
| | | for (int i = 0; i < itemList.Count; i++) |
| | | { |
| | | var items = holiday.wishBottles[model.bottleNumSelect].ChoosePrizeList; |
| | | if (i < items.Length) |
| | | { |
| | | itemList[i].gameObject.SetActive(true); |
| | | |
| | | int itemID = (int)items[i].ItemID; |
| | | var config = ItemConfig.Get(itemID); |
| | | var itemData = new ItemCellModel(itemID, false, items[i].ItemCount); |
| | | itemList[i].Init(itemData); |
| | | itemList[i].auctionIcon.gameObject.SetActive(items[i].IsBind > 0 ? true : false); |
| | | |
| | | |
| | | //选中 |
| | | foreach (var select in itemSelect) |
| | | { |
| | | select.gameObject.SetActive(false); |
| | | } |
| | | if (SelectIndex != -1) |
| | | itemSelect[SelectIndex].gameObject.SetActive(true); |
| | | |
| | | int index = i; |
| | | itemList[i].button.SetListener(() => { |
| | | foreach (var select in itemSelect) |
| | | { |
| | | select.gameObject.SetActive(false); |
| | | } |
| | | itemSelect[index].gameObject.SetActive(true); |
| | | SelectIndex = index; |
| | | }); |
| | | |
| | | //已领取 |
| | | getYetList[i].gameObject.SetActive(model.GetBottleAwardState(model.bottleNumSelect, i) == 1); |
| | | } |
| | | else |
| | | { |
| | | itemList[i].gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | m_OKButton.SetListener(() => { |
| | | if (SelectIndex == -1) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("WishBottle1"); |
| | | return; |
| | | } |
| | | if (model.GetBottleAwardState(model.bottleNumSelect, SelectIndex) == 1) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("WishBottle"); |
| | | return; |
| | | } |
| | | |
| | | int recordIndex = holiday.wishBottles[model.bottleNumSelect].ChoosePrizeList[SelectIndex].RecordIndex; |
| | | |
| | | CAA10_tagCMFeastWishBottleChooseItem wish = new CAA10_tagCMFeastWishBottleChooseItem(); |
| | | wish.BottleNum = model.bottleNumSelect; |
| | | wish.RecordIndex = (byte)recordIndex; |
| | | GameNetSystem.Instance.SendInfo(wish); |
| | | }); |
| | | |
| | | var needNum = holiday.wishBottles[model.bottleNumSelect].NeedWishValue; |
| | | var curNum = model.bottleDict[model.bottleNumSelect].x; |
| | | string curNumStr = UIHelper.AppendColor(curNum >= needNum ? TextColType.DarkGreen:TextColType.Red, curNum.ToString()); |
| | | |
| | | m_Text.text = Language.Get("SubWishInfo7", curNumStr, needNum); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6ce78a3b2fd4c5343ba3ac108ff81823 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateHolidayWish(HAA43_tagMCFeastWishInfo package)
|
| | | {
|
| | | OperationBase operationBase = null;
|
| | | operationDict.TryGetValue(Operation.HolidayWish, out operationBase);
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(Operation.HolidayWish);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (operationBase == null)
|
| | | {
|
| | | operationBase = new OperationHolidayWish();
|
| | | operationDict.Add(Operation.HolidayWish, operationBase);
|
| | | }
|
| | | var operation = operationBase as OperationHolidayWish;
|
| | | operation.Reset();
|
| | | operation.startDate = ParseOperationDate(package.StartDate);
|
| | | operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | operation.resetType = package.ResetType;
|
| | | operation.ParsePackage(package);
|
| | | if (operationTimeUpdateEvent != null)
|
| | | {
|
| | | operationTimeUpdateEvent(Operation.HolidayWish);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public void UpdateMultiRechargePackage(HAA27_tagMCActRechargePrizeInfo package)
|
| | | {
|
| | |
| | | DaysAccumulateRecharge, //累计充值,多日
|
| | | CollectWords, //收集文字
|
| | | HolidayLogin, //节日登录
|
| | | HolidayWish, //节日祝福
|
| | | max,
|
| | | }
|
| | | }
|
| | |
| | | RegisterModel<CollectWordsModel>();
|
| | |
|
| | | RegisterModel<HolidayLoginModel>();
|
| | | RegisterModel<HolidayWishPoolModel>();
|
| | |
|
| | | inited = true;
|
| | | }
|
| | |
| | | |
| | | m_TitleIcon.SetSprite(WindowConfig.GetTitleIconKey(name)); |
| | | m_TitleIcon.SetNativeSize(); |
| | | |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataUpdate; |
| | | |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | |
| | | m_Diamond = this.GetComponent<Text>("Pivot/Container_BackGround/FollowStoreBottom/GoldCountBG/CountText"); |
| | | m_BindDiamond = this.GetComponent<Text>("Pivot/Container_BackGround/FollowStoreBottom/GoldPaperCountBG/CountText"); |
| | | |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataUpdate; |
| | | |
| | | UpdateMoney(); |
| | | } |
| | | |
| | |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataUpdate; |
| | | CloseSubWindows(); |
| | | } |
| | | |
| | |
| | | m_Group.SetFunctionButtonActive(order, isShow); |
| | | } |
| | | |
| | | public RedPointState GetFunctionButtonRedPointState(int order) |
| | | { |
| | | return m_Group.GetFunctionButtonRedPointState(order); |
| | | } |
| | | |
| | | public void FunctionButtonInvoke(int order) |
| | | { |
| | | m_Group.TriggerByOrder(order); |
| | | m_Group.GotoOrder(order); |
| | | } |
| | | |
| | | private void OnPlayerDataUpdate(PlayerDataType type) |
| | | { |
| | | switch (type) |
| | |
| | | { |
| | | functionButtons[order].gameObject.SetActive(isShow); |
| | | } |
| | | }
|
| | |
|
| | | public RedPointState GetFunctionButtonRedPointState(int order)
|
| | | { |
| | | if (functionButtons.ContainsKey(order)) |
| | | { |
| | | return RedpointCenter.Instance.GetRedpointState(functionButtons[order].redpoint.redpointId); |
| | | } |
| | | |
| | | return RedPointState.None; |
| | | } |
| | | } |
| | | |