{{description>Learn how the Curvy Generator manages input and output resources, and the difference between managed and unmanaged resources.}} ====== Resources ====== In the Curvy Generator, resources are GameObjects or prefabs that [[.:modules:start]] read from or write to. Resources are split into two categories by ownership: ===== Unmanaged Resources ===== Unmanaged resources are created by the user, outside the generator hierarchy. Modules reference them as input. Examples: * A Unity Mesh used by [[.:modules:inputmesh|Input Mesh]] * A Prefab used by [[.:modules:inputgameobject|Input Game Object]] The generator reads them but never creates, destroys, or modifies them. ===== Managed Resources ===== Managed resources are created and owned by the generator. They are child GameObjects of the CurvyGenerator in the hierarchy. There are two resource types: ==== Managed Input Resources ==== These are input GameObjects of the generator's modules. For example, the spline used by [[.:modules:inputsplinepath]] when the user clicks on the "+" button in that module. * Instantiated prefabs produced by [[.:modules:creategameobject|Create Game Object]] modules ==== Managed Output Resources ==== These are output GameObjects of the generator's modules. For example, mesh GameObjects produced by [[.:modules:createmesh|Create Mesh]] modules. They are created on demand. The generator uses a [[..:components:poolmanager]] component (auto-added alongside CurvyGenerator) to recycle managed resources. This avoids unnecessary memory allocations. Any changes made by the user to these GameObjects may be overridden by the generator the next time it updates. Key behaviors: * **Created on demand** - modules create them on first refresh and reuse them on subsequent refreshes. * **Pooled** - the generator keeps a pool of mesh and GameObject resources. When output is cleared or the graph changes, resources go back to the pool instead of being destroyed, reducing allocation overhead. * **Cleared on graph changes** - if a module is not configured (missing or broken input), its managed resources are deleted. * **Saved with templates** - when you [[templates|save a template]], managed resources are included in the template prefab. Loading the template recreates them in the target graph. To manually clear output managed resources, use the **Clear Output** button in the [[grapheditor#toolbar|graph toolbar]].