sdk 代码合并
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using tysdk;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -5,37 +6,45 @@ using UnityEngine.UI;
|
||||
public class SDKTest : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private Button guestLoginBtn;
|
||||
|
||||
private Button _loginGuestBtn;
|
||||
[SerializeField]
|
||||
private Button googoleLoginBtn;
|
||||
|
||||
private Button _loginGoogleBtn;
|
||||
[SerializeField]
|
||||
private Button facebookLoginBtn;
|
||||
|
||||
private Button _loginFbBtn;
|
||||
[SerializeField]
|
||||
private Button LogOutBtn;
|
||||
|
||||
private Button _logOutBtn;
|
||||
[SerializeField]
|
||||
private Text log;
|
||||
private Button _payTestBtn;
|
||||
[SerializeField]
|
||||
private Button _payListBtn;
|
||||
[SerializeField]
|
||||
private Button _gaTestBtn;
|
||||
[SerializeField]
|
||||
private Button _gaAppMaxBtn;
|
||||
[SerializeField]
|
||||
private Text _messageTxt;
|
||||
|
||||
void Start()
|
||||
{
|
||||
guestLoginBtn.onClick.AddListener(() => OnLogin(EAccoutType.hwGuest));
|
||||
googoleLoginBtn.onClick.AddListener(() => OnLogin(EAccoutType.hwGoogle));
|
||||
facebookLoginBtn.onClick.AddListener(() => OnLogin(EAccoutType.hwFacebook));
|
||||
LogOutBtn.onClick.AddListener(OnLogout);
|
||||
_loginGuestBtn.onClick.AddListener(() => OnLogin(EAccoutType.hwGuest));
|
||||
_loginGoogleBtn.onClick.AddListener(() => OnLogin(EAccoutType.hwGoogle));
|
||||
_loginFbBtn.onClick.AddListener(() => OnLogin(EAccoutType.hwFacebook));
|
||||
_logOutBtn.onClick.AddListener(OnLogout);
|
||||
_payTestBtn.onClick.AddListener(OnPayTestBtn);
|
||||
_payListBtn.onClick.AddListener(OnPayListBtn);
|
||||
_gaTestBtn.onClick.AddListener(OnGaBtn);
|
||||
_gaAppMaxBtn.onClick.AddListener(OnAppMaxBtn);
|
||||
}
|
||||
|
||||
private async void OnLogin(EAccoutType accoutType)
|
||||
{
|
||||
log.text = string.Empty;
|
||||
_messageTxt.text = string.Empty;
|
||||
var info = await TYSdkFacade.Instance.Login(accoutType);
|
||||
log.text = $"Login: {info.isSuccess}";
|
||||
_messageTxt.text = $"Login: {info.isSuccess}";
|
||||
if(info.isSuccess)
|
||||
{
|
||||
log.text += $"\n{info.msg}";
|
||||
log.text += $"\n{TYSdkFacade.Instance.TYAccountInfo.token}";
|
||||
_messageTxt.text += $"\n{info.msg}";
|
||||
_messageTxt.text += $"\n{TYSdkFacade.Instance.TYAccountInfo.token}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,4 +52,38 @@ public class SDKTest : MonoBehaviour
|
||||
{
|
||||
TYSdkFacade.Instance.Logout();
|
||||
}
|
||||
|
||||
public async void OnPayTestBtn()
|
||||
{
|
||||
string prodId = "comarkgameft1chooseone0199";
|
||||
string pType = "googleiab.global.app";
|
||||
string prodPrice = "2,616";
|
||||
string prodName = "test:₩2,616";
|
||||
int count = 1;
|
||||
|
||||
Debug.LogError($"[AggSdk::Pay] prodId : {prodId} prodPrice : {prodPrice} prodName : {prodName} ");
|
||||
PaymentInfo payResult = await TYSdkFacade.Instance.Pay(prodId, prodPrice, prodName, count, pType);
|
||||
|
||||
}
|
||||
|
||||
public async void OnPayListBtn()
|
||||
{
|
||||
Debug.LogError("PayList ask");
|
||||
var result = await TYSdkFacade.Instance.ThirdExtend();
|
||||
}
|
||||
|
||||
public void OnGaBtn()
|
||||
{
|
||||
Debug.LogError("Ga ask");
|
||||
using ( var e = GAEvent.TackEvent("idcheckdone") )
|
||||
{
|
||||
e.AddContent("test ga", true);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnAppMaxBtn()
|
||||
{
|
||||
// TYSdkFacade.Instance.PlayAd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user