solar-systemSystem

The global system that stores and manages all Flora instances.

The FloraSystem is the global runtime API for Flora instances.

What It Is

FloraSystem stores runtime instance data and provides methods to create, modify, query, and destroy instances.

When To Use It

Use FloraSystem when you need runtime control (spawning, simulation updates, queries, bulk enable/disable).

Access Pattern

Use FloraSystem.GetOrCreate() to guarantee an active system.

var flora = FloraSystem.GetOrCreate();

Core Tasks

Create or destroy a single instance

FloraInstanceHandle handle = FloraSystem.GetOrCreate()
    .CreateInstance(prefab, parent, pos, rot, scale);

FloraSystem.Instance?.DestroyInstance(handle);

Create or destroy a batch of instances

Control instance visibility

Query instances by sphere or bounds


Example

How To Verify

  • Created instances are visible and have valid handles.

  • Query returns expected subset.

  • Destroy/disable calls remove visibility and invalidate stale handles.

Migration Note

Older names like FindInstancesInSphereMatching and FindInstancesInBoundsMatching were replaced by FindInstancesIntersectingSphereMatching and FindInstancesIntersectingBoundsMatching.

Last updated