using System.Collections.Generic; using MoleMole.Config; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; using proto; namespace MoleMole { public class RedeemDialogContext : BaseDialogContext { public enum RedeemStatus { Error = 0, ShowInfo = 1, RedeemSuccess = 2 } private const string DROP_ITEM_ANIMATION_NAME = "DropItemScale10"; private string _redeemCode; private RedeemStatus _redeemStatus; private GetRedeemCodeInfoRsp _redeemInfo; private string _errorCode; private SequenceAnimationManager _animationManager; private List _redeemRewardList; public RedeemDialogContext(string redeemCode, RedeemStatus status, GetRedeemCodeInfoRsp redeemInfo = null, string errorCode = null) { config = new ContextPattern { contextName = "RedeemDialogContext", viewPrefabPath = "UI/Menus/Dialog/RedeemDialog" }; _redeemCode = redeemCode; _redeemStatus = status; _redeemInfo = redeemInfo; _errorCode = errorCode; } public override bool OnPacket(NetPacketV1 pkt) { ushort cmdId = pkt.getCmdId(); if (cmdId == 214) { OnExchangeRedeemCodeRsp(pkt.getData()); } return false; } protected override void BindViewCallbacks() { BindViewCallback(base.view.transform.Find("BG"), EventTriggerType.PointerClick, OnBGClick); BindViewCallback(base.view.transform.Find("Dialog/CloseBtn").GetComponent