28 lines
826 B
GDScript
28 lines
826 B
GDScript
extends SceneTree
|
|
func _init() -> void:
|
|
var psv: PhysicsServer2D = PhysicsServer2D
|
|
# get_method_list on the class gives class/static methods only.
|
|
var methods: Array = psv.get_method_list()
|
|
var all: Array = []
|
|
for m in methods:
|
|
all.append(str(m.get("name")))
|
|
var has_step := false
|
|
for x in all:
|
|
if "step" in x:
|
|
has_step = true
|
|
break
|
|
print("step in class methods: ", has_step)
|
|
print("total class methods: ", methods.size())
|
|
# Find the actual running instance
|
|
var space: Object = PhysicsServer2D.get_space_create()
|
|
print("space class: ", space.get_class())
|
|
var smethods: Array = space.get_method_list()
|
|
var has2 := false
|
|
for m in smethods:
|
|
var n: String = str(m.get("name"))
|
|
if "integrate" in n:
|
|
has2 = true
|
|
print(" SPACE integrate method: ", n)
|
|
print("space has integrate: ", has2)
|
|
quit()
|