Skip to main content

MicroTutorialOrbInjector

A class in Root.Township, ATT.MicroTutorial.

Server: spawns micro tutorial entry orbs into chunks listed in MicroTutorialFaceOrbSpawnSettings when those chunks load, and removes them when they unload.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private static readonly Logger loggerClass logger.
private NetworkPrefab microTutorialFaceOrbThe orb prefab to spawn.
private readonly Dictionary<Chunk, List<OrbSpawnData>> orbSpawnDataByChunkSpawn data grouped by chunk.
private readonly Dictionary<Chunk, List<NetworkEntity>> spawnedOrbEntitiesByChunkSpawned orb entities grouped by chunk, used for despawning.

Properties​

1 private and internal property
MemberWhat it is
private static MicroTutorialFaceOrbSpawnSettings Settings { get; }The global MicroTutorialFaceOrbSpawnSettings.

Methods​

MemberWhat it is
override void Initialize()Server: reads the orb injector data from the settings and sets up spawning per chunk.
4 private and internal methods
MemberWhat it is
private void DespawnOrbsForChunk(Chunk chunk)Destroys the orbs spawned for a chunk, unless players are still in it.
private void OnDestroy()Despawns all orbs and unhooks the chunk events.
private void SetupOrbSpawnData(OrbInjectorData data)Stores spawn data under its chunk and hooks that chunk's load and unload events.
private void SpawnOrbsForChunk(Chunk chunk)Spawns an orb for each spawn data entry in the chunk and sets its tutorial. Skipped when the system is disabled.