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