require-for-update-gate

Prevents Unity DOTS ISystem execution when singleton or component prerequisites are absent.

6|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/dyCuong03/unity-agent-team --skill require-for-update-gate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: require-for-update-gate
Source: https://github.com/dyCuong03/unity-agent-team/tree/main/.claude/skills/unity-dots/require-for-update-gate
Command: npx skills add https://github.com/dyCuong03/unity-agent-team --skill require-for-update-gate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents ECS/Unity DOTS systems from running when required singleton or component prerequisites are missing, which eliminates boilerplate null-checks and avoids wasted scheduling work.

Core Features & Use Cases

  • Precondition gating: Uses state.RequireForUpdate<T>() in OnCreate to ensure a system only runs when the required singleton or component type exists.
  • Safe access pattern: Pairs the gate with SystemAPI.GetSingleton<T>() in OnUpdate, relying on the gate to guarantee presence.
  • Combinable requirements: Supports AND-ing multiple RequireForUpdate calls so systems activate only when all conditions are satisfied.
  • Use Case: Only activate a spawn/movement system when a SpawnerConfig singleton and a scene-scoped marker component exist, avoiding early-frame errors and unnecessary work.

Quick Start

Tell the AI to add state.RequireForUpdate<YourRequiredSingleton>() and state.RequireForUpdate<YourSceneTag>() in OnCreate, then use SystemAPI.GetSingleton<YourRequiredSingleton>() inside OnUpdate.

Frequently Asked Questions about require-for-update-gate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent a Unity DOTS system from running when a required singleton is missing?

You can prevent unnecessary execution by calling state.RequireForUpdate<T>() in OnCreate to ensure the system only updates when the required singleton exists, allowing safe access via SystemAPI.GetSingleton<T>() in OnUpdate.

What does RequireForUpdate do in Unity ECS?

RequireForUpdate in Unity ECS gates system execution by halting OnUpdate when specified component or singleton types are absent, eliminating boilerplate null-checks and avoiding wasted scheduling work for inactive features.

Can I require multiple components before a DOTS system activates?

Yes, you can require multiple components by making several state.RequireForUpdate<T>() calls in OnCreate, which ANDs the conditions together so the system only runs when all specified singletons and markers are present.

What is the best way to handle feature flags in Unity DOTS ISystem workflows?

The best way to handle feature flags in Unity DOTS is using state.RequireForUpdate<T>() in OnCreate to conditionally activate systems based on feature-flag singletons or scene-scoped markers, preventing early-frame errors and unnecessary work.

Why does my ECS system throw an error when accessing a missing singleton?

Accessing a missing singleton throws an error because the system runs without its prerequisite; adding state.RequireForUpdate<T>() in OnCreate gates execution so SystemAPI.GetSingleton<T>() only runs when the singleton is guaranteed to exist.