private void Start() { instance = this; eventChannel = new EventChannel(Service.Get <EventDispatcher>()); eventChannel.AddListener <PlayerSpawnedEvents.LocalPlayerSpawned>(onLocalPlayerSpawned); gate = new ParentGate(); gate.OnContinue += onGatePassed; }
private void OnDestroy() { if (instance == this) { instance = null; } eventChannel.RemoveAllListeners(); if (gate != null) { gate.OnContinue -= onGatePassed; } }