Skip to main content

TerrainModificationRegister

A class in Root.Township, the global namespace.

Singleton that gives each GenerationStarter an id and makes sure terrain is only modified once per id.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private uint nextIdNext id to hand out.
private HashSet<uint> spawnedIds that have already modified terrain.

Methods​

MemberWhat it is
bool CheckModify(uint id)Returns true the first time an id is checked, so the caller should modify terrain; false after that.
uint GetNextId()Returns a new id, counting up from 1.