85 lines
1.8 KiB
C#
85 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public enum OfferWallMode
|
|
{
|
|
Diamonds = 0,
|
|
Hooks = 1,
|
|
}
|
|
|
|
|
|
public class AdvertOfferWallSlot : MonoBehaviour
|
|
{
|
|
// 设置类型
|
|
public OfferWallMode mode;
|
|
|
|
//
|
|
private ShopToken _shopToken;
|
|
//
|
|
private IAPItemList iAPItemList;
|
|
|
|
private Button _btnBuy;
|
|
|
|
// 购买图片
|
|
private TMP_Text _textNum;
|
|
|
|
|
|
|
|
#region 周期函数
|
|
private void Awake()
|
|
{
|
|
_btnBuy = transform.Find("position/btn_purchase/btn_green").GetComponent<Button>();
|
|
_btnBuy.onClick.AddListener(OnBuy);
|
|
|
|
// _textNum = transform.Find("position/text_num").GetComponent<TMP_Text>();
|
|
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 功能函数
|
|
|
|
private async void OnBuy()
|
|
{
|
|
_btnBuy.enabled = false;
|
|
|
|
// var tjHelper = GContext.container.Resolve<TapjoyHelper>();
|
|
// tjHelper.GetContent(_shopToken.ID);
|
|
|
|
await Awaiters.NextFrame;
|
|
_btnBuy.enabled = true;
|
|
|
|
}
|
|
public void SetData(ShopToken shopToken)
|
|
{
|
|
_shopToken = shopToken;
|
|
// _textNum.text = shopToken.Number.ToString();
|
|
// iAPItemList = GContext.container.Resolve<Tables>().TbIAPItemList.GetOrDefault(shopToken.IAPID);
|
|
// SKUDetailDataEvent sKUDetailDataEvent = new SKUDetailDataEvent(iAPItemList);
|
|
// GContext.Publish(sKUDetailDataEvent);
|
|
// text_price.text = sKUDetailDataEvent.price;
|
|
// TapjoyHelper.O
|
|
// var tjHelper = GContext.container.Resolve<TapjoyHelper>();
|
|
// tjHelper.OnRequestDiamonds();
|
|
// tjHelper.OnRequestHooks();
|
|
}
|
|
|
|
#endregion
|
|
} |