13 lines
363 B
GDScript
13 lines
363 B
GDScript
extends CharacterBody3D
|
|
|
|
@export var stats: PlayerStats
|
|
|
|
func _ready() -> void:
|
|
add_to_group("player")
|
|
PlayerData.init_from_resource(stats)
|
|
if PlayerData.returning_from_dungeon:
|
|
global_position = PlayerData.portal_position + Vector3(0, 1, -5)
|
|
PlayerData.returning_from_dungeon = false
|
|
elif PlayerData.dungeon_cleared:
|
|
PlayerData.clear_cache()
|