-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemoScript.cs
More file actions
30 lines (27 loc) · 858 Bytes
/
DemoScript.cs
File metadata and controls
30 lines (27 loc) · 858 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
26
27
28
29
30
using UnityEngine;
using static Plug;
public class DemoScript : MonoBehaviour
{
private void Start()
{
Plug.RequestConnectWithAgent(new string[] { "cnoib-2yaaa-aaaaf-qadja-cai", "qoctq-giaaa-aaaaa-aaaea-cai" }, "https://mainnet.dfinity.network", (r, e) =>
{
if (r != null)
{
Debug.Log("[unity] public key: " + r);
Plug.RequestBalance((r, e) =>
{
Debug.Log("[unity] Balances: " + r);
});
Plug.GetPrincipal((r, e) =>
{
Debug.Log("[unity] Principal ID: " + r);
});
}
else
{
Debug.Log("[unity] error: " + e);
}
});
}
}