mirror of
https://github.com/Relintai/regression-test-project.git
synced 2024-11-12 10:25:30 +01:00
CreatingAllThings (#61)
This commit is contained in:
parent
e40215477b
commit
95da6a1ad7
@ -16,6 +16,7 @@ var can_be_closed: bool = true
|
||||
|
||||
# Each scene runs alone
|
||||
const alone_steps: Array = [
|
||||
"res://CreatingAllThings/CreatingAllThings.tscn",
|
||||
"res://Nodes/Nodes.tscn",
|
||||
"res://Physics/2D/Physics2D.tscn",
|
||||
"res://Physics/3D/Physics3D.tscn",
|
||||
|
30
CreatingAllThings/CreatingAllThings.gd
Normal file
30
CreatingAllThings/CreatingAllThings.gd
Normal file
@ -0,0 +1,30 @@
|
||||
extends Node2D
|
||||
|
||||
var available_classes : Array = []
|
||||
var exeptions : Array = ["SceneTree", "EditorSettings", "ProjectSettings"]
|
||||
|
||||
func _ready():
|
||||
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()
|
||||
|
6
CreatingAllThings/CreatingAllThings.tscn
Normal file
6
CreatingAllThings/CreatingAllThings.tscn
Normal file
@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://CreatingAllThings/CreatingAllThings.gd" type="Script" id=1]
|
||||
|
||||
[node name="CreatingAllThings" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
Loading…
Reference in New Issue
Block a user