Created
December 15, 2022 13:04
-
-
Save aabhasr1/cbd6cc942a11a5abeeddfd69e97ee4f7 to your computer and use it in GitHub Desktop.
TextView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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