Setup debug coloring for spawners
This commit is contained in:
@@ -1,12 +1,20 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
|
|
||||||
|
const debugging: bool = true
|
||||||
|
|
||||||
enum Faction {
|
enum Faction {
|
||||||
ALLIES,
|
ALLIES,
|
||||||
AXIS,
|
AXIS,
|
||||||
NEUTRAL
|
NEUTRAL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const FactionColor = {
|
||||||
|
Faction.ALLIES: Color(0.281, 0.493, 0.989, 1.0),
|
||||||
|
Faction.AXIS: Color(1.0, 0.274, 0.213, 1.0),
|
||||||
|
Faction.NEUTRAL: Color(0.71, 0.584, 0.0, 1.0)
|
||||||
|
}
|
||||||
|
|
||||||
enum ControllerCommand {
|
enum ControllerCommand {
|
||||||
NONE,
|
NONE,
|
||||||
PULL_UP,
|
PULL_UP,
|
||||||
|
|||||||
@@ -38,3 +38,6 @@ faction = 1
|
|||||||
[node name="game_controller" parent="controller_manager" instance=ExtResource("7_vef74")]
|
[node name="game_controller" parent="controller_manager" instance=ExtResource("7_vef74")]
|
||||||
|
|
||||||
[node name="game_mode" parent="controller_manager/game_controller" instance=ExtResource("3_fc0e3")]
|
[node name="game_mode" parent="controller_manager/game_controller" instance=ExtResource("3_fc0e3")]
|
||||||
|
|
||||||
|
[node name="spawner" parent="." instance=ExtResource("5_ryrav")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 84.06215, 2.5178223, -76.95647)
|
||||||
|
|||||||
@@ -8,7 +8,22 @@ var delay_timer: Timer = null
|
|||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
pass
|
_debug_setup()
|
||||||
|
|
||||||
|
|
||||||
|
func _debug_setup() -> void:
|
||||||
|
if not Globals.debugging:
|
||||||
|
visible = false
|
||||||
|
return
|
||||||
|
|
||||||
|
var timer = get_tree().create_timer(0.200)
|
||||||
|
await timer.timeout
|
||||||
|
|
||||||
|
visible = true
|
||||||
|
var visual_node: MeshInstance3D = get_node("visual")
|
||||||
|
var visual_node2: MeshInstance3D = get_node("visual_direction")
|
||||||
|
visual_node.mesh.material.albedo_color = Globals.FactionColor[faction]
|
||||||
|
visual_node2.mesh.material.albedo_color = Globals.FactionColor[faction]
|
||||||
|
|
||||||
func _on_area_body_entered(_body: Jet) -> void:
|
func _on_area_body_entered(_body: Jet) -> void:
|
||||||
if delay_timer:
|
if delay_timer:
|
||||||
|
|||||||
@@ -1,20 +1,38 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://bgrku2wvaadgg"]
|
[gd_scene load_steps=7 format=3 uid="uid://bgrku2wvaadgg"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://2xevacik8ja4" path="res://scripts/controllers/spawn_system/spawner.gd" id="1_yd0ab"]
|
[ext_resource type="Script" uid="uid://2xevacik8ja4" path="res://scripts/controllers/spawn_system/spawner.gd" id="1_yd0ab"]
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_yd0ab"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_7k17k"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
material = SubResource("StandardMaterial3D_yd0ab")
|
||||||
|
size = Vector3(20, 10, 25)
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7k17k"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_8iah5"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
material = SubResource("StandardMaterial3D_7k17k")
|
||||||
|
size = Vector3(12, 1, 4)
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_7k17k"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_7k17k"]
|
||||||
size = Vector3(20, 10, 25)
|
size = Vector3(20, 10, 25)
|
||||||
|
|
||||||
[node name="spawner" type="Area3D"]
|
[node name="spawner" type="Area3D"]
|
||||||
script = ExtResource("1_yd0ab")
|
script = ExtResource("1_yd0ab")
|
||||||
|
|
||||||
[node name="detector" type="CollisionShape3D" parent="."]
|
[node name="visual" type="MeshInstance3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.9008179, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
||||||
shape = SubResource("BoxShape3D_7k17k")
|
mesh = SubResource("BoxMesh_7k17k")
|
||||||
|
|
||||||
[node name="ray" type="RayCast3D" parent="."]
|
[node name="visual_direction" type="MeshInstance3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.3711385e-08, -0.99999994, 0, 0.99999994, -4.3711385e-08, 0, 0, -12.65)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, -14.107723)
|
||||||
top_level = true
|
mesh = SubResource("BoxMesh_8iah5")
|
||||||
enabled = false
|
skeleton = NodePath("../visual")
|
||||||
hit_back_faces = false
|
|
||||||
collide_with_bodies = false
|
[node name="detector" type="CollisionShape3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
||||||
|
shape = SubResource("BoxShape3D_7k17k")
|
||||||
|
|||||||
Reference in New Issue
Block a user