MapBoardRenderer
A class in Root.Township, Alta.Map.
Client: renders a map board's UI canvas into a render texture with a shared hidden camera, re-rendering when landmarks change. Destroys itself on headless servers.
- Listed in World, chunks and saving
- Inherits or implements
MonoBehaviour - Attributes
RequireComponent
Constructors
| Member | What it is |
|---|---|
MapBoardRenderer() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
Methods
7 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Destroys itself on headless builds. Otherwise makes the render texture and shared camera, renders once and listens for landmark changes. |
private void CheckRender(MarkerInfo marker) | On landmark change, queues a render if visible, otherwise marks that one is needed. |
private void OnBecameInvisible() | Marks the board as not visible so renders are put off. |
private void OnBecameVisible() | Marks the board visible and renders if a change came in while hidden. |
private void OnDestroy() | Releases the render texture and removes the landmark listener. |
private void QueueRender() | Schedules RenderMap 0.5 s later, unless one is already queued. |
private void RenderMap() | Turns the canvas on, renders it with renderCamera into the texture, then turns it off again. |