Property SelectedHero
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
SelectedHero
The hero the player currently controls, or null when there is none.
Answers null for a destroyed hero on purpose: Unity's fake-null does not survive the OneJS
bridge, so a destroyed hero is truthy in JS and hero.gameObject throws inside the UI. That
throw was uncaught, so React 19 unmounted the whole tree and the session was left with no UI at
all. Returning null makes the UI's own null checks - hero?.gameObject?.name - do their job.
public HeroController SelectedHero { get; set; }