Esempio n. 1
0
 protected override void DoShow(Entity ent, string arg, string arg2)
 {
     if (this.menuImpl == null)
     {
         this.Setup();
     }
     this.currEnt = ent;
     if (arg == "info")
     {
         this.menuImpl.SwitchToScreen("infoRoot", null);
     }
     else if (arg == "map")
     {
         this.menuImpl.SwitchToScreen("mapRoot", null);
     }
     else if (arg == "cards")
     {
         this.menuImpl.SwitchToScreen("cardsRoot", arg2);
     }
     else
     {
         this.menuImpl.ShowFirst();
     }
     this.pauseTag = ObjectUpdater.Instance.RequestPause(null);
     EventListener.GamePause(true);         // Invoke custom event
 }
Esempio n. 2
0
 protected override void DoHide()
 {
     if (this.mapWindow != null && this.mapWindow.IsActive)
     {
         this.mapWindow.Hide();
         this.mapWindow = null;
     }
     this.menuImpl.Hide();
     this.menuImpl.Reset();
     if (this.pauseTag != null)
     {
         this.pauseTag.Release();
         this.pauseTag = null;
     }
     EventListener.GamePause(false);         // Invoke custom event
 }
Esempio n. 3
0
 void OnDestroy()
 {
     PlayerRespawner.allRespawners.Remove(this);
     if (this.ent != null)
     {
         this.UnregEvents(this.ent);
     }
     if (this.backCam != null && this.fadeTimer > 0f)
     {
         this.backCam.backgroundColor = this.startFadeColor;
     }
     if (this.localPauseTag != null)
     {
         this.localPauseTag.Release();
         this.localPauseTag = null;
     }
 }
Esempio n. 4
0
 public void ForceRespawn()
 {
     if (this.inForceRespawn)
     {
         return;
     }
     this.inForceRespawn = true;
     if (this.WillChangeLevels())
     {
         this.localPauseTag = ObjectUpdater.Instance.RequestPause(null);
         Killable entityComponent = this.ent.GetEntityComponent <Killable>();
         if (entityComponent != null)
         {
             entityComponent.CurrentHp = entityComponent.MaxHp;
         }
         this.ChangeLevelRespawn();
         return;
     }
     ObjectUpdater.PauseTag  pauseTag   = ObjectUpdater.Instance.RequestPause(null);
     OverlayFader.OnDoneFunc onDoneFunc = delegate()
     {
         this.inForceRespawn = false;
         pauseTag.Release();
         Killable entityComponent2 = this.ent.GetEntityComponent <Killable>();
         if (entityComponent2 != null)
         {
             Killable.DeathData deathData = new Killable.DeathData(true);
             entityComponent2.ForceDeath(0f, deathData, true);
         }
     };
     if (this._fadeOut != null)
     {
         Vector3 value = CoordinateTransformer.ToViewport("Main Camera", this.ent.WorldPosition);
         OverlayFader.StartFade(this._fadeOut, true, onDoneFunc, new Vector3?(value));
     }
     else
     {
         onDoneFunc();
     }
 }