Skip to main content

RespawnBeaconController

A class in Root.Township, ATT.Respawn.

Client: spawns a beacon view for each powered (non-global) respawn shrine and updates it when the respawn model changes.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private static Logger loggerClass logger.
private Dictionary<Guid, IRespawnBeaconView> respawnBeaconViewsBeacon views by shrine ID.
private IRespawnSystem respawnSystemInjected respawn system.

Properties​

1 private and internal property
MemberWhat it is
private IRespawnSystemSettings SystemSettings { get; }The global RespawnSystemSettings.

Methods​

MemberWhat it is
override void OnConnected(Player player)Only calls the base method.
void OnModelChanged(IRespawnSystemModel model)Client: spawns the beacons on the first update, then passes each shrine's model to its beacon view.
5 private and internal methods
MemberWhat it is
private void Inject(IRespawnSystem respawnSystem)VContainer injection of the respawn system.
private void OnDestroy()Stops listening to model changes.
private void SpawnAllBeaconViews(IRespawnSystemModel model)Spawns a beacon view for every shrine in the model that isn't the global shrine.
private void SpawnBeaconViewForShrine(Guid shrineId)Takes a pooled beacon from the shrine's settings, places it at the beacon position and stores its view.
private void Start()Creates the view lookup and listens to the respawn system's model changes.