Skip to main content

ModifiableLandmarkSelector

A class in Root.Township, Alta.Chunks.

Swaps a landmark between its original and modified look, based on the ModifiableStaticManager state for its hash, and follows changes to that state.

Constructors​

MemberWhat it is
ModifiableLandmarkSelector()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

3 private and internal fields
MemberWhat it is
private GameObject finalBacking field for Final.
private uint modifiableHashBacking field for ModifiableHash.
private GameObject originalBacking field for Original.

Properties​

MemberWhat it is
GameObject Final { get; set; }Object shown when the landmark is modified.
uint ModifiableHash { get; set; }Hash of the modifiable static object this follows.
GameObject Original { get; set; }Object shown when the landmark is not modified.

Methods​

MemberWhat it is
void Select(bool isModified)Shows Final and hides Original when modified, and the other way round when not.
3 private and internal methods
MemberWhat it is
private void Awake()Reads the current modified state, shows the matching object and subscribes to ObjectChanged.
private void CheckChange(uint objectHash, bool isModified)Calls Select when the changed object's hash is this one's.
private void OnDestroy()Unsubscribes from ObjectChanged.