Class UITKNameplateLayer
Draws every visible Nameplate as a single UI Toolkit element, projected from its world anchor onto this screen-space panel each frame.
[DefaultExecutionOrder(1000)]
[DisallowMultipleComponent]
public sealed class UITKNameplateLayer : MonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUITKNameplateLayer
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Remarks
One element per plate is the whole point. Overhead text used to be a set of sibling WorldLabels projected one at a time and then pushed apart vertically in screen space. Two world points a few centimetres apart do not project to a constant screen-space gap: pitch the camera and the gap shrinks, look down the offset and it vanishes, so the correction that separated the rows at one camera angle overlapped them at another. A plate projects ONE point and lays its rows out in points inside that element, where vertical order is the layout engine's business and no camera angle can disturb it.
What is shared with UITKWorldLabelLayer, and why. Both layers sit
on the same UIDocument, and both take the draw distance and the hide-behind-geometry
toggle from ClientWorldLabelSettings. One document means one panel, one
projection matrix and a guaranteed paint order — the nameplate container is the FIRST child
of the root, so a damage number always reads over a plate rather than fighting it for order.
The two shared settings are statements about projected world UI as a whole, and a second
copy of each would let a player set two answers to one question.
Everything else is this layer's own, from ClientNameplateSettings: opacity, size, background strength, which optional rows are drawn, and the visible-plate budget. The budget in particular must not be shared — a burst of damage numbers can never push the plate the player is aiming at off the screen, and a crowded hub can never starve the combat feedback.
Sizes are in points at a reference size. A plate's font size is computed from its world-unit size and its distance, exactly as a world label's is, and every other measurement in NameplateStyle — padding, border, radius, row spacing — is scaled by the same ratio. That is what keeps a plate's proportions identical near and far; absolute point padding would swallow a distant plate whole.
Fields
DistantLodDistance
Beyond this distance a plate is repositioned on a stride. Zero disables the stride.
public float DistantLodDistance
Field Value
DistantUpdateInterval
How many frames apart a distant plate is repositioned.
public int DistantUpdateInterval
Field Value
ExecutionOrder
Runs after the camera writers, for the reason documented on ExecutionOrder: projecting against a camera that has not been placed yet is a one-frame lag that reads as a tick-rate shimmer (issue #227).
public const int ExecutionOrder = 1000
Field Value
MaxFontSize
Largest font size a plate's name row is drawn at, in points.
public float MaxFontSize
Field Value
MaxVisibleDistance
Beyond this distance in metres a plate is not drawn. Zero means no limit.
public float MaxVisibleDistance
Field Value
MaxVisiblePlates
How many plates may be drawn at once. Zero means no limit.
public int MaxVisiblePlates
Field Value
Remarks
Counted separately from the world label budget on purpose; see the class remarks.
MinFontSize
Smallest font size a plate's name row is drawn at, in points.
public float MinFontSize
Field Value
OccludeBehindGeometry
Whether scene geometry hides a plate. Costs one linecast per visible plate.
public bool OccludeBehindGeometry
Field Value
OcclusionMask
The layers a plate can be hidden behind.
public LayerMask OcclusionMask
Field Value
- LayerMask
OffScreenMargin
How far outside the panel a plate may project before it is dropped.
public float OffScreenMargin
Field Value
ProjectionCamera
The camera plates are projected from. Falls back to Camera.main.
public Camera ProjectionCamera
Field Value
- Camera
Properties
Instance
The live layer, or null outside a client scene.
public static UITKNameplateLayer Instance { get; }