Rework player state system to use an event subscription system to avoid directly calling methods on individual state and having to worry about validity
This commit is contained in:
@@ -45,9 +45,9 @@ func GetAllDialogueTriggers() -> Array[DialogueTrigger]:
|
||||
return arr
|
||||
|
||||
|
||||
func GetPlayer() -> PlayerCharacter:
|
||||
func GetPlayerBody() -> CharacterBody2D:
|
||||
var nodes := get_tree().get_nodes_in_group("Player Group")
|
||||
if nodes.is_empty():
|
||||
return null
|
||||
|
||||
return nodes[0] as PlayerCharacter
|
||||
return nodes[0] as CharacterBody2D
|
||||
|
||||
Reference in New Issue
Block a user