TextStudio3DControlPool
[AddComponentMenu("Text Studio/Spatial UI/3D Control Pool")][DisallowMultipleComponent]public sealed class TextStudio3DControlPool : MonoBehaviourOwns a bounded Unity object pool for reusable world-space control prefab instances.
Methods
Section titled “Methods”
Prewarm(int)
Section titled “Prewarm(int)”public void Prewarm(int count)Creates and returns inactive instances so subsequent rents can reuse them without instantiation.
Parameters
| Name | Type | Description |
|---|---|---|
count |
System.Int32 | Requested instance count, clamped to the pool’s configured maximum. |
Rent()
Section titled “Rent()”public TextStudio3DControl Rent()Rents an active control at the pool parent’s origin and identity rotation.
Returns
TextStudio.ThreeD.TextStudio3DControl: A pooled control, or null when no valid prefab is configured.
Rent(Vector3, Quaternion)
Section titled “Rent(Vector3, Quaternion)”public TextStudio3DControl Rent(Vector3 localPosition, Quaternion localRotation)Rents an active control and assigns its world position and rotation.
Parameters
| Name | Type |
|---|---|
localPosition |
UnityEngine.Vector3 |
localRotation |
UnityEngine.Quaternion |
Returns
TextStudio.ThreeD.TextStudio3DControl: A pooled control, or null when no valid prefab is configured.
Return(TextStudio3DControl)
Section titled “Return(TextStudio3DControl)”public bool Return(TextStudio3DControl instance)Resets and releases a control that is currently owned by this pool.
Parameters
| Name | Type |
|---|---|
instance |
TextStudio.ThreeD.TextStudio3DControl |
Returns
System.Boolean: True when the instance was rented from this pool and was returned.
Clear()
Section titled “Clear()”public void Clear()Returns every rented control and destroys retained inactive instances.
Constructors
Section titled “Constructors”
TextStudio3DControlPool()
Section titled “TextStudio3DControlPool()”public TextStudio3DControlPool()Properties
Section titled “Properties”
Prefab
Section titled “Prefab”public TextStudio3DControl Prefab { get; set; }Returns
TextStudio.ThreeD.TextStudio3DControl
public int Count { get; }Returns
System.Int32
ActiveCount
Section titled “ActiveCount”public int ActiveCount { get; }Returns
System.Int32
MaximumSize
Section titled “MaximumSize”public int MaximumSize { get; set; }Returns
System.Int32