Skip to content

TextStudio3DControlPool

ClassTextStudio.ThreeDTextStudio.3D
[AddComponentMenu("Text Studio/Spatial UI/3D Control Pool")]
[DisallowMultipleComponent]
public sealed class TextStudio3DControlPool : MonoBehaviour

Owns a bounded Unity object pool for reusable world-space control prefab instances.

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.
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.

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.

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.

public void Clear()

Returns every rented control and destroys retained inactive instances.

public TextStudio3DControlPool()

public TextStudio3DControl Prefab { get; set; }

Returns

TextStudio.ThreeD.TextStudio3DControl

public int Count { get; }

Returns

System.Int32

public int ActiveCount { get; }

Returns

System.Int32

public int MaximumSize { get; set; }

Returns

System.Int32