Table of Contents

Class EventfulPropertyAttribute

Namespace
GrindFest
Assembly
GrindFest.dll

Marks a field whose property and change event are generated at compile time by Tools/EventfulProperties (shipped as a Roslyn analyzer in Assets/_GrindFest/Plugins, labelled RoslynAnalyzer). The containing class must be declared partial.

[EventfulProperty] private long _gold;

generates

public long Gold { get => _gold; set { ...OnGoldChanged?.Invoke(value); } }
public event System.Action<long> OnGoldChanged;

which is exactly the shape the UI's useEventSync(source, "Gold") subscribes to. This is the v2 OneJS codegen (OneJS.Codegen.dll); the v3 package does not ship it, so this project keeps its own copy rather than hand-writing the property and the event for every value the UI watches.

[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
public sealed class EventfulPropertyAttribute : Attribute
Inheritance
object
EventfulPropertyAttribute
Inherited Members