seedpackets and handlers
This commit is contained in:
parent
2a7c402cd0
commit
73a2fe42ad
16 changed files with 157 additions and 58 deletions
|
|
@ -1,4 +1,4 @@
|
|||
extends Resource
|
||||
extends GameIdentifiableResource
|
||||
|
||||
## Base class for every possible entity in game. Makes possible for entities to be spawned using seedpackets
|
||||
class_name SeedpacketResource
|
||||
|
|
@ -20,11 +20,3 @@ class_name SeedpacketResource
|
|||
|
||||
## Order to sort in almanach
|
||||
@export_range(0,4056,1,"or_greater","hide_slider") var order : int
|
||||
|
||||
var gid : StringName = ""
|
||||
|
||||
func get_gid() -> StringName:
|
||||
if gid == "":
|
||||
var split_path = resource_path.split("/")
|
||||
gid = split_path[split_path.size()].trim_suffix(".tres").to_lower()
|
||||
return gid
|
||||
|
|
|
|||
15
scripts/resources/game_identifiable_resource.gd
Normal file
15
scripts/resources/game_identifiable_resource.gd
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
extends Resource
|
||||
|
||||
## Class that has unique GID specified by its filename.
|
||||
|
||||
class_name GameIdentifiableResource
|
||||
|
||||
## Game identifactor. Generates from resource filename. Should be unique.
|
||||
var gid : StringName = ""
|
||||
|
||||
## Gets GID. If resource has none, generates one.
|
||||
func get_gid() -> StringName:
|
||||
if gid == "":
|
||||
var split_path = resource_path.split("/")
|
||||
gid = split_path[split_path.size()].trim_suffix(".tres").to_lower()
|
||||
return gid
|
||||
1
scripts/resources/game_identifiable_resource.gd.uid
Normal file
1
scripts/resources/game_identifiable_resource.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://v044g4j1khxd
|
||||
Loading…
Add table
Add a link
Reference in a new issue