WorldLandmark
A class in Root.Township, Alta.Chunks.
An asset for a large landmark prefab that's loaded through Addressables while certain chunks are loaded, and unloaded when none of them are.
- Listed in World, chunks and saving
- Inherits or implements
ScriptableObject - Attributes
CreateAssetMenu
Constructors
| Member | What it is |
|---|---|
WorldLandmark() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
8 private and internal fields
| Member | What it is |
|---|---|
private bool isLoaded | Whether the landmark is meant to be loaded; set as soon as Load starts. Backing field for IsLoaded. |
private AsyncOperationHandle<GameObject> load | The addressables load operation for the prefab. |
private ChunkReference[] loadedChunks | References to chunks that keep the landmark loaded while any of them is loaded. |
private static Logger logger | Class logger. |
private AssetReference prefab | Addressable prefab spawned when the landmark loads. Backing field for Prefab. |
private Chunk[] sceneLoadedChunks | Resolved chunks from loadedChunks. Backing field for LoadedChunks. |
private Chunk[] sceneStaticChunks | Resolved chunks from staticChunks. Backing field for StaticChunks. |
private ChunkReference[] staticChunks | References to static chunks linked to the landmark. |
Properties
| Member | What it is |
|---|---|
bool IsLoaded { get; } | True from Load until Unload, even while still loading. |
bool IsLoading { get; } | True while the prefab load is still running. |
Chunk[] LoadedChunks { get; } | The scene chunks that keep this landmark loaded. Filled by ResolveChunkReferences. |
TaskCompletionSource<bool> LoadingTask { get; private set; } | Completes when the current load finishes. Null when not loading. |
AssetReference Prefab { get; } | The Addressables reference to the landmark prefab. |
GameObject SpawnedPrefab { get; private set; } | The spawned landmark object while loaded. |
Chunk[] StaticChunks { get; } | The scene chunks listed as static for this landmark. Filled by ResolveChunkReferences. |
Methods
1 private and internal method
Used in
Members of other types that take, return or hold a WorldLandmark: