Added SceneNode Loading

This commit is contained in:
Strieglitz
2025-02-18 23:38:21 +01:00
parent 5c88f4ed48
commit a1b0e6b5e7
28 changed files with 148 additions and 36 deletions

View File

@@ -0,0 +1,13 @@
extends Resource
class_name AttachmentResource
@export var attachment_stats: AttachmentStats
@export var attachment_scene: PackedScene
func instantiate(parent: Node3D)->Attachment:
var attachment_instance = attachment_scene.instantiate() as Attachment
attachment_instance.init_Attachment(attachment_stats)
parent.add_child(attachment_instance)
return attachment_instance

View File

@@ -0,0 +1,6 @@
extends Resource
class_name AttachmentStats
@export var damage: Damage
@export var fire_rate: FireRate

View File

@@ -1,5 +0,0 @@
extends Resource
class_name Weapon
@export var name: String

View File

@@ -0,0 +1,13 @@
extends Resource
class_name WeaponResource
@export var name: String
@export var weapon_stats: WeaponStats
@export var weapon_scene: PackedScene
func instantiate(parent: Node3D)->Weapon:
var weapon_instance = weapon_scene.instantiate() as Weapon
weapon_instance.init_weapon(weapon_stats)
parent.add_child(weapon_instance)
return weapon_instance

View File

@@ -4,3 +4,4 @@ class_name WeaponStats
@export var damage: Damage
@export var fire_rate: FireRate