basic ECS spawner
This commit is contained in:
36
GECS/entities/BasicEnemy/BasicEnemy.tscn
Normal file
36
GECS/entities/BasicEnemy/BasicEnemy.tscn
Normal file
@@ -0,0 +1,36 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://bct6stmj0qyp2"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ci3kmg1eck6gb" path="res://GECS/entities/BasicEnemy/e_basic_enemy.gd" id="1_h3v2l"]
|
||||
[ext_resource type="Script" uid="uid://b6k13gc2m4e5s" path="res://addons/gecs/ecs/component.gd" id="2_gsgoc"]
|
||||
[ext_resource type="Script" uid="uid://bg653v2p104l1" path="res://GECS/components/c_health.gd" id="3_unr0g"]
|
||||
[ext_resource type="Script" uid="uid://c4ihfoefv2vwd" path="res://GECS/components/c_transform.gd" id="4_07lse"]
|
||||
[ext_resource type="Script" uid="uid://cnqotfu7xgxwa" path="res://GECS/components/c_velocity.gd" id="5_vhe2b"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_vas4o"]
|
||||
script = ExtResource("3_unr0g")
|
||||
metadata/_custom_type_script = "uid://bg653v2p104l1"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_yuljp"]
|
||||
script = ExtResource("4_07lse")
|
||||
metadata/_custom_type_script = "uid://c4ihfoefv2vwd"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_6hf1n"]
|
||||
script = ExtResource("5_vhe2b")
|
||||
velocity = Vector3(2, 0, 0)
|
||||
metadata/_custom_type_script = "uid://cnqotfu7xgxwa"
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ocib1"]
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_4ju8b"]
|
||||
|
||||
[node name="BasicEnemy" type="CharacterBody3D"]
|
||||
script = ExtResource("1_h3v2l")
|
||||
component_resources = Array[ExtResource("2_gsgoc")]([SubResource("Resource_vas4o"), SubResource("Resource_yuljp"), SubResource("Resource_6hf1n")])
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
shape = SubResource("CapsuleShape3D_ocib1")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_4ju8b")
|
||||
10
GECS/entities/BasicEnemy/e_basic_enemy.gd
Normal file
10
GECS/entities/BasicEnemy/e_basic_enemy.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
@tool
|
||||
class_name BasicEnemy
|
||||
extends Entity
|
||||
|
||||
|
||||
func on_ready():
|
||||
# Sync the entity's scene position to the Transform component
|
||||
if has_component(C_Transform):
|
||||
var c_trs = get_component(C_Transform) as C_Transform
|
||||
self.global_position = c_trs.position
|
||||
1
GECS/entities/BasicEnemy/e_basic_enemy.gd.uid
Normal file
1
GECS/entities/BasicEnemy/e_basic_enemy.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ci3kmg1eck6gb
|
||||
Reference in New Issue
Block a user