Table of Contents

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.

Every write goes through here, which is what makes OnSelectedHeroChanged the whole story: Party.SelectHero is the only intended caller, but HeroNetworkBehaviour and the UI screens assign the property directly, and all of those paths have to announce themselves.

public HeroController SelectedHero { get; set; }

Property Value

HeroController