Skip to main content

MicroTutorialStep

An abstract class in Root.Township, ATT.MicroTutorial.Steps.

Base asset for one step of a micro tutorial. Subclasses say which player events finish the step or run their own server logic; the server's step instance spawns the step's content and watches for completion.

Constructors​

MemberWhat it is
protected MicroTutorialStep()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

2 private and internal fields
MemberWhat it is
internal static readonly Logger loggerNLog logger shared by micro tutorial steps.
private static readonly Type[] noRequiredEventsEmpty type array returned by the default RequiredPlayerEventTypes.

Properties​

MemberWhat it is
bool DestroyOnComplete { get; set; }If true, the server despawns the step's dynamic and static content when the step stops.
SetPieceData DynamicContent { get; set; }Set piece whose saved network entities the server loads into the tutorial entity when the step starts. Can be null.
virtual int PlayerEventSearchDepth { get; }How many earlier steps' buffered player events still count for this step. -1 (default) means all earlier steps.
virtual IEnumerable<Type> RequiredPlayerEventTypes { get; }Player event types the step listens to on the event bus. Empty by default.
GameObject StaticContent { get; set; }Prefab instantiated locally (not networked) as the step's static content. Can be null.
string StepName { get; set; }Display name for the step, used in its ToString and log messages.

Methods​

MemberWhat it is
virtual bool IsCompletedByEvent(IPlayerEvent eventInfo)Server: returns true if the given player event finishes the step. Base returns false.
virtual IResult IsConfigurationValid()Checks the step's settings. The base version always succeeds; subclasses report missing fields.
virtual async Task RunForInstance(IServerStepInstance stepInstance)Server: custom async logic run for a step instance, such as a delay or a spawn. Does nothing by default.
override string ToString()Returns the step name and hash code, for logs.

Used in​

Members of other types that take, return or hold a MicroTutorialStep: