Skip to main content

PrefabInPositionObserver

A class in Root.Township, ATT.MicroTutorial.Steps.

Trigger placed in a step's dynamic content. Server: broadcasts PrefabInPositionEvent for the domain's player when a network prefab enters it.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private Domain domainThe parent tutorial domain, found on first trigger.
private static IEventBus eventBusBacking field for EventBus.
private static readonly Logger loggerClass logger.
private const string LogPrefixPrefix for log lines.

Properties​

1 private and internal property
MemberWhat it is
private static IEventBus EventBus { get; }The township event bus, fetched lazily and shared by all observers.

Methods​

2 private and internal methods
MemberWhat it is
private void OnTriggerEnter(Collider other)Server: finds the entering collider's NetworkPrefab and broadcasts the event for the domain's player.
private void Start()Disables the component on clients.