You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 16, 2026. It is now read-only.
// UICard.cspublicoverridevoid_Ready(){OnPicked+=()=>{// How to access player??// Player.Speed = 100;}}
I want to do a static approach Player.(...) but this feels wrong and messy. Isn't there a better way to approach this? I don't want to start making static properties and functions in Player.cs just so UICard can interact with Player.
Currently picking a card does nothing.
Lets say picking any card should set the player speed to 100 (players default speed is 50)
How do we do this?
Here are my thoughts.
Add a event to UICard.cs called OnPicked
Invoke this action when the card is picked.
Listen to this action in UICard _Ready()
I want to do a static approach
Player.(...)but this feels wrong and messy. Isn't there a better way to approach this? I don't want to start making static properties and functions in Player.cs just so UICard can interact with Player.Player Script: https://github.com/Valks-Games/AvoidTheEnemies/blob/main/Scripts/Player.cs
UICard Script: https://github.com/Valks-Games/AvoidTheEnemies/blob/main/Scripts/UI/UICard.cs