public static void Update(float dt) { DeltaTime = dt; if (currentScene.IsNeedUpdate) { currentScene.Update(); } TimerInvoker.Update(); }
public void Shoot() { if (isReadyShoot) { isReadyShoot = false; scene.LaserCounterText = ""; TimerInvoker.InvokeTroughtTime(ReloadTime, Refresh); LaserRay.SetActive(true); TimerInvoker.InvokeTroughtTime(RayTime, () => LaserRay.SetActive(false)); } }
public void Stop() { if (isStarted) { message.Text = "GameOver.\nPress SPACE to restart"; message.SetActive(true); isStarted = false; ship.Physic.Velocity = new Vector2(0, 0); ship.GunLaser.LaserRay.SetActive(false); ship.SetActive(false); TimerInvoker.CancelAll(); } }