ActionAttribute
namespace Griff.Scenes;
public sealed class ActionAttribute : AttributeMarks a method of a component as something it does that anything in the game can set off with no code: a Trigger when a message arrives, a wire as its signal comes on (see the Contraptions module’s Wire), or a script with Game.Do. Actions are found by this attribute, the way components are found, so a script component’s own methods count as soon as they’re marked. The method returns nothing and takes at most one value it’s done with: a number (Single), a whole number (Int32), true or false (Boolean) or a name (String). Its /// summary says what it does, in the Inspector and to agents. A script’s action reaches the game through its own Game; one of Griff’s components holds only its own state, so an action that needs the game takes the service it needs as its first parameter (an IGameService, such as the panels or the flags), which the system that owns that part of the game provides.
Properties
Section titled “Properties”public string? Name { get; }What it’s called, e.g. “Start”; the method’s own name if not given. Spaces aren’t needed (“EndTurn” reads “End Turn”).