Class TestCharacterReactive
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
Test component that exercises the OneJS (v3) reactive contract with game-like properties.
Each backing field has a public property and an OnXChanged event, which is what
TSX binds to with useEventSync(obj, 'Strength') (it calls obj.add_OnStrengthChanged
and re-reads obj.Strength). The one exception is HealthPercent: a calculated
property has no setter to hang an event on, so it only updates when its inputs do.
public class TestCharacterReactive : MonoBehaviour
- Inheritance
-
objectTestCharacterReactive
Properties
- CharacterName
Reactive view of
_characterName; raisesOnCharacterNameChangedwhen the value actually changes.
- Dexterity
Reactive view of
_dexterity; raisesOnDexterityChangedwhen the value actually changes.
- Health
Reactive view of
_health; raisesOnHealthChangedwhen the value actually changes.
- Intelligence
Reactive view of
_intelligence; raisesOnIntelligenceChangedwhen the value actually changes.
- Level
Reactive view of
_level; raisesOnLevelChangedwhen the value actually changes.
- MaxHealth
Reactive view of
_maxHealth; raisesOnMaxHealthChangedwhen the value actually changes.
- Strength
Reactive view of
_strength; raisesOnStrengthChangedwhen the value actually changes.