void RestartLevel() { if (SHSHquit != null) { SHSHquit.Kill(); } SHSHquit = null; this.SHSHtimer = 0; pendingTicks = 0; state = SHRLstate.Gameplay; entities = new List <SHRLentity> (); LoadLevel("shrlTESTLEVEL"); overrideFadeInSpeed = .1f; overrideFadeOutSpeed = .1f; }
public override void Update() { base.Update(); if (fade < .99f) { return; } if (state == SHRLstate.Gameplay) { overrideFadeInSpeed = 1f; overrideFadeOutSpeed = 1f; RefreshEntities(); tickTimer -= Time.unscaledDeltaTime; if (tickTimer < 0 && pendingTicks > 0) { tickTimer = .05f; TickEntities(1); pendingTicks--; } if (GetEnemyCount() <= 0 && player.del != true) { state = SHRLstate.SHSH; return; } if (player.del) { state = SHRLstate.Dead; return; } } else if (state == SHRLstate.SHSH) { overrideFadeInSpeed = .5f; overrideFadeOutSpeed = .5f; for (int i = 0; i < 5; ++i) { string sh = (UnityEngine.Random.value > .5f)?("SUPER"):("HOT"); Popup(sh, UnityEngine.Random.Range(0, SHGUI.current.resolutionX), UnityEngine.Random.Range(0, SHGUI.current.resolutionY), false); } SHSHtimer += Time.unscaledDeltaTime; if (SHSHtimer > 1.5f && SHSHquit == null) { SHSHquit = new SHGUIblinkview(.5f); string s = "HAND OVER THE CONTROL"; SHSHquit.AddSubView(new SHGUIframe(0, 0, s.Length + 2, 2, 'z')); SHSHquit.AddSubView(new SHGUItext(s, 1, 1, 'r')); SHSHquit.x = (int)(SHGUI.current.resolutionX / 2) - (int)(s.Length / 2); SHSHquit.y = (int)(SHGUI.current.resolutionY / 2) - 2; AddSubView(SHSHquit); } } else if (state == SHRLstate.Dead) { overrideFadeInSpeed = .5f; overrideFadeOutSpeed = .5f; SHSHtimer += Time.unscaledDeltaTime; if (SHSHtimer > 0.2f && SHSHquit == null) { SHSHquit = new SHGUIblinkview(.5f); string s = "AGAIN"; SHSHquit.AddSubView(new SHGUIframe(0, 0, s.Length + 2, 2, 'z')); SHSHquit.AddSubView(new SHGUItext(s, 1, 1, 'r')); SHSHquit.x = (int)(SHGUI.current.resolutionX / 2) - (int)(s.Length / 2); SHSHquit.y = (int)(SHGUI.current.resolutionY / 2) - 2; AddSubView(SHSHquit); } } }