feat: started adding animation behaviour

This commit is contained in:
Gerard Gascón 2025-04-12 14:16:06 +02:00
parent 2f60fd19d6
commit 2a9e824a9e
12 changed files with 123 additions and 93 deletions

View file

@ -3,11 +3,11 @@ class_name DragonOutfit
@export var allow_null: bool
@export var outfits: Array[Texture2D]
@export var outfits: Array[SpriteFrames]
var index: int = 0
func _init(outfits: Array[Texture2D] = []):
func _init(outfits: Array[SpriteFrames] = []):
self.outfits = outfits
@ -44,7 +44,7 @@ func get_index(texture: Texture2D) -> int:
return outfits.find(texture)
func get_texture(index: int) -> Texture2D:
func get_texture(index: int) -> SpriteFrames:
if index < 0 or index >= len(outfits):
return null