Skip to content

Instantly share code, notes, and snippets.

@aabhasr1
Created December 15, 2022 13:04
Show Gist options
  • Save aabhasr1/cbd6cc942a11a5abeeddfd69e97ee4f7 to your computer and use it in GitHub Desktop.
Save aabhasr1/cbd6cc942a11a5abeeddfd69e97ee4f7 to your computer and use it in GitHub Desktop.
TextView
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class TextView : MonoBehaviour, CFPaymentService.CFPaymentCallback
{
[SerializeField]
private TMP_Text _title;
void OnApplicationPause(bool paused)
{
CFPaymentService CFPaymentService = new CFPaymentService();
//Save scene Name if paused, otherwise load last scene
if (!paused)
{
CFPaymentService.setCallback(this);
}
}
public void onPaymentVerify(string orderID) {
ExecuteOnMainThread.RunOnMainThread.Enqueue(() => {
_title.text = "verify";
Debug.Log("Text: verify");
});
}
public void onPaymentFailure(string orderID) {
ExecuteOnMainThread.RunOnMainThread.Enqueue(() => {
// Code here will be called in the main thread...
_title.text = "failed";
Debug.Log("Text: failed");
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment