19 lines
433 B
GDScript3
19 lines
433 B
GDScript3
|
class_name VRPN_Button
|
||
|
extends Node
|
||
|
|
||
|
@export var vrpn : VRPN = null
|
||
|
@export var button_sensor : String = "Button0"
|
||
|
@export var register_on_start : bool = true
|
||
|
|
||
|
var state : int = 0
|
||
|
|
||
|
func _ready():
|
||
|
if not vrpn:
|
||
|
push_warning("No VRPN client for button on '%s' given." % [self.name])
|
||
|
elif register_on_start:
|
||
|
vrpn.buttons.append(self)
|
||
|
|
||
|
func _on_vrpn(vrpn_data : Dictionary) -> void:
|
||
|
if vrpn_data['sensor'] == button_sensor:
|
||
|
pass
|