-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@tool | ||
extends Node3D | ||
|
||
const IcosahedronScene = preload('res://src/models/icosahedron/Icosahedron.tscn') | ||
var G: Globals = Globals.new() | ||
@onready var icosahedron: Icosahedron = $Icosahedron | ||
|
||
@export var a := false: | ||
set(val): | ||
var new_figure = IcosahedronScene.instantiate() | ||
new_figure.shader_type = 1 | ||
self.add_child(new_figure) | ||
new_figure.owner = get_tree().edited_scene_root | ||
print_debug(new_figure.shader_type) | ||
print_debug(G.tw) | ||
|
||
@export var b := false: | ||
set(val): | ||
for i in self.get_children(): | ||
remove_child(i) | ||
|
||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready() -> void: | ||
#if not get_tree().edited_scene_root.get_node_or_null('./globals'): | ||
#var globals = Globals.new() | ||
#globals.set_name('globals') | ||
#get_tree().edited_scene_root.call_deferred('add_child', globals) | ||
#G = get_tree().edited_scene_root.get_node('./globals') | ||
pass # Replace with function body. | ||
|
||
|
||
# Called every frame. 'delta' is the elapsed time since the previous frame. | ||
func _process(delta: float) -> void: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[gd_scene load_steps=4 format=3 uid="uid://cd21bp42ng8gy"] | ||
|
||
[ext_resource type="Script" path="res://src/models/icosahedron/test/variant_test.gd" id="1_4av47"] | ||
[ext_resource type="PackedScene" uid="uid://c28nbcejwepp8" path="res://src/models/icosahedron/Icosahedron.tscn" id="2_d25gj"] | ||
[ext_resource type="Script" path="res://src/models/icosahedron/components/Icosahedron.gd" id="3_bof8s"] | ||
|
||
[node name="VariantTest" type="Node3D"] | ||
script = ExtResource("1_4av47") | ||
|
||
[node name="Icosahedron" type="MeshInstance3D" parent="." instance=ExtResource("2_d25gj")] | ||
script = ExtResource("3_bof8s") | ||
shader_type = 1 |