Skip to main content
File: Assets/_MolcaSDK/_VR/Scripts/Scenario/Steps/ValveActionStep.cs
Base: Step

Role

Completes when every ToolValveAction in valveActions fires onToolOperationComplete. On Initialize, sockets are disabled; on activate, each is enabled, listener registered, and ResetToolOperation() called. When all report done, Complete() is invoked after completionDelay.

Code

// Designer: assign ToolValveAction[] or leave empty to auto-collect on this object / children.
// Each ToolValveAction must raise onToolOperationComplete when its tool op finishes.

using MolcaSDK.VR.Scenario;

public class RebindToolSockets : UnityEngine.MonoBehaviour
{
    public ValveActionStep step;

    public void SetAngles(int socketIndex, float angle) => step.SetTargetAngle(socketIndex, angle);
}
(SetTargetAngle exists on the step for per-socket targets — see full ValveActionStep.cs.)

Troubleshooting

  • Stuck — not all sockets complete — Ensure every ToolValveAction is in the array, onToolOperationComplete fires exactly once per intended op, and sockets are not left enabled from a prior run (deactivate should clear listeners).
  • Empty array error — Assign valveActions or place ToolValveAction components on/under the same GameObject for auto-discovery.
  • Delayed completion — Reduce completionDelay if the UX feels laggy after the last socket.

Unity Editor

ValveActionStep Inspector — compare fields to ValveStep.

ValveActionStep in Unity Inspector