Deep-Dovers / deep-divers

Retirees making a game
0 stars 0 forks source link

[Tech] Player State Implementation #21

Closed waiteng-kwan closed 1 month ago

waiteng-kwan commented 1 month ago

Basic implementation of a player state, similar to Unreal Engine's player state

Currently a player state consists of just the health.

waiteng-kwan commented 1 month ago

Added MaxHealth and CurrentHealth to PlayerState component. This component is attached to the PlayerCharacter prefab and has an event listener for health changed.

Tried it out with some testing code, the UI does update when it's being called.

Note that this is local only, not set to only server gets to change