A class in Root.Township, the global namespace.
Main menu visual: gives a server's preview a cubemap picked from ServerCubeMaps for its scene, so each server keeps the same look. Does nothing on a headless server.
Constructors
| Member | What it is |
|---|
CubeMapUpdater() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private static readonly int _CubeMap | Shader property ID for _CubeMap. |
private ServerCubeMaps cubeMaps | The ServerCubeMaps asset listing cubemaps per scene. |
private Material material | Per-instance copy of the target renderer's material. |
private Dictionary<int, int> serverCubemapID | Cache of the cubemap index chosen for each server ID. |
private Renderer targetRenderer | Renderer whose material gets the cubemap. |
Methods
| Member | What it is |
|---|
void SetupServer(ServerElement newElement) | Applies the cubemap for the given server list entry, caching its chosen index per server ID. |
4 private and internal methods
| Member | What it is |
|---|
private void ApplyCubemap(Cubemap cubemap) | Sets the loaded cubemap on the copied material's _CubeMap property. |
private void Awake() | Copies the target renderer's material so changes don't touch the shared one; on headless it just clears cubeMaps. |
private int GetMapID(int serverIdentifier, int sceneIndex) | Picks a cubemap index for the scene, seeded by the server ID so it's the same every time. |
private void OnDestroy() | Clears the texture and frees the copied material and the loaded cubemaps. |