Table of Contents

Event OnSelectedHeroChanged

Namespace
GrindFest
Assembly
GrindFest.dll

Raised when SelectedHero becomes a different hero (or none), so "the player switched hero" can be an event instead of a question the UI has to ask on a timer. Bind it with useEventSync(party, 'SelectedHero', [party]), which subscribes add_OnSelectedHeroChanged and re-reads the property - the same shape as the generated OnGoldChanged on this class.

Written by hand rather than with [EventfulProperty] on the field: that generator emits get => _selectedHero, and this property is deliberately not a plain field read (see below).

public event Action<HeroController> OnSelectedHeroChanged

Returns

Action<HeroController>
Raised when becomes a different hero (or none), so "the player switched hero" can be an event instead of a question the UI has to ask on a timer. Bind it with useEventSync(party, 'SelectedHero', [party]), which subscribes add_OnSelectedHeroChanged and re-reads the property - the same shape as the generated OnGoldChanged on this class. Written by hand rather than with [EventfulProperty] on the field: that generator emits get => _selectedHero, and this property is deliberately not a plain field read (see below).