Files
ft/Client/Assets/Scripts/UI/Advert/AdvertOfferWallSlot.cs
2026-06-29 21:18:33 +08:00

101 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using asap.core;
using cfg;
using GameCore;
#if UNITY_ANDROID
using TapjoyUnity.Internal;
#endif
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);
#if UNITY_ANDROID
var helper = FindObjectOfType<TapjoyHelper>();
if (helper)
{
helper.ShowContent((int)mode);
}
#endif
#if AGG
using (var e = GEvent.GameEvent("tapjoy_click"))
{
}
#endif
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
}