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