Skip to main content

ServerCubeMaps

A class in Root.Township, the global namespace.

Asset listing cubemaps per scene for the main menu server preview. CubeMapUpdater loads one per server through Addressables; skipped on headless builds.

Constructors​

MemberWhat it is
ServerCubeMaps()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

3 private and internal fields
MemberWhat it is
private AsyncOperationHandle<Cubemap> currentHandleHandle for the most recently requested cubemap load.
private int currentLoadedIndex of the most recently requested cubemap. Older loads that finish late are released.
private SceneCubeMaps[] sceneBasedcubemapsCubemap lists, one per scene index.

Methods​

MemberWhat it is
async void ApplyCubeMap(int sceneIndex, int mapIndex, Action<Cubemap> useMap)Loads a scene's cubemap by index and passes it to the callback, releasing the previous one. Out of range scene uses scene 0.
void Clean()Releases every loaded cubemap asset.
int CubemapsLength(int sceneIndex)Number of cubemaps for a scene (scene 0 if out of range).

Used in​

Members of other types that take, return or hold a ServerCubeMaps: