-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.gd
37 lines (27 loc) · 839 Bytes
/
test.gd
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
31
32
33
34
35
36
37
extends Node2D
@onready var label: Label = $Label
var _my_js_callback = JavaScriptBridge.create_callback(myCallback) # This
var externalator = JavaScriptBridge.get_interface("externalator")
var cardano = JavaScriptBridge.get_interface("cardano")
func _ready() -> void:
pass;
#externalator.addGodotFunction('enableWallet',myCallback)
func _process(delta: float) -> void:
pass
func check_wallets() -> void:
if OS.has_feature('web'):
if cardano.nami:
#godotFunctions.enableWallet()
#cardano.nami.isEnabled.connect(myCallback)
cardano.nami.isEnabled().then(myCallback)
#print(test)
print("lol")
label.text = "Nami"
else:
label.text = "-"
else:
print("The JavaScriptBridge singleton is NOT available")
func myCallback(args):
print('callback!!')
func _on_timer_timeout() -> void:
check_wallets()