// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2022-01-12 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** namespace G.UI { using System.Collections; using TMPro; using UnityEngine; using UnityEngine.UI; /// /// /// partial class WheelWindow { public class Sounds { public static string Appear = "wheel_appear_01"; public static string BigWinLoop; public static string Disappear; public static string NumbersIncrease; public static string SingleTic; public static string WheelSpin = "wheel_spin_01"; public static string Start = "wheel_start_01"; public static string Win = "wheel_win_01"; } public class WheelSlotWidget : KUIWidget { [KUIFlag] Image _imgIcon; [KUIFlag] TextMeshProUGUI _tmpCount; [KUIFlag] GameObject _goState; public override void Refresh() { if (this.data is WheelProxy.SlotInfo slotInfo) { var rewardProp = slotInfo.reward.propItem; IconProxy.Instance.SetSprite(_imgIcon, rewardProp.icon); _tmpCount.text = "x" + slotInfo.reward.count.ToString(); _goState.SetActive(slotInfo.rewardState != 0); } } private void Awake() { SetViewData(); } } public class LuckRewardWidget : KUIWidget { [KUIFlag] Image _imgIcon; [KUIFlag] TextMeshProUGUI _tmpCount; [KUIFlag] TextMeshProUGUI _tmpState; Button _btnState; KUIImage _stateImage; public override void Refresh() { if (this.data is ActivitySubInfo subInfo) { var rewardInfo = subInfo.rewardInfos[0]; IconProxy.Instance.SetSprite(_imgIcon, rewardInfo.propItem.icon); _tmpCount.text = "x" + rewardInfo.count.ToString(); _tmpState.text = subInfo.target.ToString(); _stateImage.ShowSprite(subInfo.status); } } void OnBtnClick() { if (this.data is ActivitySubInfo activitySubInfo) { WheelProxy.Instance.GetRewards(activitySubInfo, (error, message) => { if (error == 0) { Refresh(); PostNotification(GlobalDefine.EVENT_MONEY_CHANGED); ToastBox.ShowText("领取成功"); } else { OpenWindow(activitySubInfo.rewardInfos); } }); } } private void Awake() { SetViewData(); _stateImage = GetComponent(); _btnState = GetComponent