Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs-unity.molca.id/llms.txt

Use this file to discover all available pages before exploring further.

File: Assets/_Molca/_Core/Sequence/Step/Step.cs
Namespace: Molca.Sequence

Status

StepStatus: Inactive, Active, Completed.

Completion

IsCompleted is true only when the step is internally complete and all child steps are complete.

Identity and telemetry

Events

OnStepBegin, OnStepEnd (UnityEvent), OnStatusChanged, StartTime / EndTime.

Auxiliaries

[SerializeReference] List<StepAuxiliary> — see Core Sequence/Auxiliary/ and VR step auxiliaries. In VR training, the StepInfo auxiliary (and subclasses for extra fields) supplies step titles used by Scenario UI task lists and modal copy — not just optional scoring/haptics.

VR subclasses

Training steps in Assets/_MolcaSDK/_VR/Scripts/Scenario/Steps/ — see the VR steps section in navigation.

Typical custom / VR step (code)

VR steps inherit Step, wire [SerializeField] for designers, subscribe in OnStepActivated, and call Complete() when the training rule is satisfied (dispatches Step.Completed / Step.FullyCompleted via EventDispatcher).
using Molca.Sequence;
using UnityEngine;

public class ExampleTrainingStep : Step
{
    [SerializeField] private float holdSeconds = 2f;
    private float _elapsed;

    protected override void OnStepActivated()
    {
        base.OnStepActivated();
        _elapsed = 0f;
    }

    public override void UpdateStep()
    {
        base.UpdateStep();
        _elapsed += Time.deltaTime;
        if (_elapsed >= holdSeconds)
            Complete();
    }
}
Concrete VR steps (grab, teleport, valve, …) follow this shape with XR-specific fields — see each feature page and the matching *.cs under _MolcaSDK/_VR/Scripts/Scenario/Steps/.

API Reference

MethodSignatureDescription
OnStepActivatedprotected virtual void OnStepActivated()Called when the step becomes active — override to initialize step-specific logic, subscribe to events, or reset state
OnStepDeactivatedprotected virtual void OnStepDeactivated()Called when the step becomes inactive — override to clean up resources, unsubscribe from events, or save state
UpdateSteppublic virtual void UpdateStep()Called every frame while the step is active — override to implement per-frame logic like timers or condition checks
Completeprotected void Complete()Mark the step as completed and dispatch Step.Completed / Step.FullyCompleted events via EventDispatcher to advance the sequence
Failprotected void Fail()Mark the step as failed — dispatches failure events and may trigger retry logic depending on sequence configuration
Resetpublic virtual void Reset()Reset the step to its initial state — called when restarting a sequence or retrying a failed step

Unity Editor

Step Inspector