mirror of
https://github.com/godotengine/regression-test-project.git
synced 2026-01-03 14:09:15 +03:00
Clean 3.x branch (#65)
This commit is contained in:
@@ -1,30 +1,32 @@
|
||||
extends Node2D
|
||||
|
||||
var available_classes : Array = []
|
||||
var exeptions : Array = ["SceneTree", "EditorSettings", "ProjectSettings"]
|
||||
var available_classes: Array = []
|
||||
var exeptions: Array = ["SceneTree", "EditorSettings", "ProjectSettings"]
|
||||
|
||||
|
||||
func _ready():
|
||||
var cl : Array = Array(ClassDB.get_class_list())
|
||||
var cl: Array = Array(ClassDB.get_class_list())
|
||||
cl.sort()
|
||||
for name_of_class in cl:
|
||||
if !ClassDB.can_instance(name_of_class):
|
||||
continue
|
||||
if name_of_class in exeptions:
|
||||
continue
|
||||
if name_of_class.to_lower().find("server") != -1:
|
||||
continue
|
||||
|
||||
print("########### " + name_of_class)
|
||||
print("GDSCRIPT CODE: var thing = ClassDB.instance(\"" + name_of_class + "\")")
|
||||
print("GDSCRIPT CODE: str(" + name_of_class + ")")
|
||||
|
||||
var thing = ClassDB.instance(name_of_class)
|
||||
str(thing)
|
||||
|
||||
if thing is Node:
|
||||
print("GDSCRIPT CODE: thing.queue_free()")
|
||||
thing.queue_free()
|
||||
elif thing is Object && !(thing is Reference):
|
||||
print("GDSCRIPT CODE: thing.free()")
|
||||
thing.free()
|
||||
|
||||
# Repeat 3 times, to be sure that code don't crash in unreleated function
|
||||
for _i in range(3):
|
||||
if !ClassDB.can_instance(name_of_class):
|
||||
continue
|
||||
if name_of_class in exeptions:
|
||||
continue
|
||||
if name_of_class.to_lower().find("server") != -1:
|
||||
continue
|
||||
|
||||
print("########### " + name_of_class)
|
||||
print('GDSCRIPT CODE: var thing = ClassDB.instance("' + name_of_class + '")')
|
||||
print("GDSCRIPT CODE: str(" + name_of_class + ")")
|
||||
|
||||
var thing = ClassDB.instance(name_of_class)
|
||||
str(thing)
|
||||
|
||||
if thing is Node:
|
||||
print("GDSCRIPT CODE: thing.queue_free()")
|
||||
thing.queue_free()
|
||||
elif thing is Object && !(thing is Reference):
|
||||
print("GDSCRIPT CODE: thing.free()")
|
||||
thing.free()
|
||||
|
||||
Reference in New Issue
Block a user