System

The global system that stores and manages all Flora instances.

The FloraSystem is a singleton that manages the data and rendering of all Flora instances globally.

It can be used to create, modify, query, and destroy instances at runtime.

You can access it through the static Instance property, but this may return null if no instances exist yet. To guarantee access, use the static method:

FloraSystem.GetOrCreate()

Instance Management

Create or destroy a single instance

FloraSystem.GetOrCreate().CreateInstance(prefab, parent, pos, rot, scale);
FloraSystem.Instance?.DestroyInstance(handle);

Create or destroy a batch of instances

FloraSystem.GetOrCreate().CreateInstances(prefab, parent, handlesArray, transformsArray);
FloraSystem.Instance?.DestroyInstances(handlesArray);

Control instance visibility

FloraSystem.Instance.SetInstanceEnabled(instanceHandle, false);
FloraSystem.Instance.SetInstancesEnabled(instanceHandleArray, false);

Query instances by bounds or sphere

FloraSystem.Instance.FindInstancesInSphereMatching(myInstanceFilter, mySphere, Allocator.Temp);
FloraSystem.Instance.FindInstancesInBoundsMatching(myInstanceFilter, mySphere, Allocator.Temp);

Example

Last updated