-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAsyncPurchasesExample.cs
More file actions
25 lines (22 loc) · 768 Bytes
/
Copy pathAsyncPurchasesExample.cs
File metadata and controls
25 lines (22 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using UdonSharp;
using UnityEngine;
using VRC.Economy;
using VRC.SDKBase;
namespace LogicCuteGuy.LCGUdonSharp.Examples.AsyncAwait
{
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
public class AsyncPurchasesExample : UdonSharpBehaviour
{
private IProduct[] _products;
public override async void Interact()
{
await VRCAsync.ListPurchasesAsync(Networking.LocalPlayer);
Debug.Log("[Async economy] Local purchase count: " + _products.Length);
}
public override void OnListPurchases(IProduct[] products, VRCPlayerApi player)
{
_products = products;
Debug.Log("[Legacy economy callback] Purchases received for " + player.displayName);
}
}
}