public async void Restart() { if (state != GameState.Play) { return; } state = GameState.Draw; Subscribe(_lineDrawer); _adService.ShowBanner(AdPosition.Top).Forget(); Analytics.CustomEvent( Constants.LevelRestarted, new Dictionary <string, object>() { { "level", _level.SceneNumber }, { "stars", _starCount.Value }, { "passed", _level.passed } } ); _endOfLevel.gameObject.SetActive(false); _starCount.Value = 0; OnRestart?.Invoke(); if (_adService.HasNextAd()) { await _adService.ShowVideo(); } }
public static void OnRestartInvoke(object sender = null) { if (OnRestart != null) { OnRestart.Invoke(null, EventArgs.Empty); } }
private void Update() { if (Input.GetKeyDown(KeyCode.LeftArrow)) { OnMove?.Invoke(Vector2Int.left); } if (Input.GetKeyDown(KeyCode.RightArrow)) { OnMove?.Invoke(Vector2Int.right); } if (Input.GetKeyDown(KeyCode.UpArrow)) { OnMove?.Invoke(Vector2Int.up); } if (Input.GetKeyDown(KeyCode.DownArrow)) { OnMove?.Invoke(Vector2Int.down); } if (Input.GetKeyDown(KeyCode.R)) { OnRestart?.Invoke(); } if (Input.GetKeyDown(KeyCode.Escape)) { OnEscape?.Invoke(); } }
public void Restart() { DestroyEntitiesWithTag(EntityTag.Bullet); DestroyEntitiesWithTag(EntityTag.Enemy); OnRestart?.Invoke(); ResumeGame(); }
public void Restart() { OnRestart?.Invoke(); if (!hasPlayer) { return; } SetCameraDepth(-10); SetPlayerState(true); }
public void GameRestart() { GameStop(); foreach (var component in components.ToArray()) { component.GameRestart(); } if (OnRestart != null) { OnRestart.Invoke(); } }
public void Restart() { OnRestart?.Invoke(); Player.Instance.SetPosition(playerInitPosition); toolsCollected = 0; gameTime = TimeToFinish.ToFloat(); stGameTime = new StandardTime(); stGameTime.ConvertFrom(gameTime); ResumeGame(); UpdateGameUI(); }
void Awake() { m_RestartButton.onClick.AddListener(() => { OnRestart?.Invoke(); }); m_MainMenu.onClick.AddListener(() => { OnMainMenu?.Invoke(); }); }
private static void HandleStandardKey(ConsoleKeyInfo?keyInfo) { string key = keyInfo.Value.KeyChar.ToString(); switch (key) { case " ": // Refresh Console.Clear(); break; case "|": ConsoleEx.WriteLineEnh("*Cancelling..*"); _cts.Cancel(); ShortDelay(); Console.Clear(); break; case "^": // Restart (forget all state) if (ConsoleEx.PromptEnhForInputKeysUpper("Are you sure? Y/N ", "yn") == "Y") { ConsoleEx.WriteLineEnh("*Restarting..* (if supported)"); ShortDelay(); OnRestart?.Invoke(); ShortDelay(); Console.Clear(); } else { ShortDelay(); Console.Clear(); } break; case "q": // Quit (lower) if (ConsoleEx.PromptEnhForInputKeysUpper("Are you sure? Y/N ", "yn") == "Y") { ConsoleEx.WriteLineEnh("\n*Quitting..*"); ShortDelay(); OnQuit?.Invoke(); ShortDelay(); _running = false; } else { ShortDelay(); Console.Clear(); } break; case "Q": // Quit (upper) ConsoleEx.WriteLineEnh("*Quitting..*"); ShortDelay(); OnQuit?.Invoke(); ShortDelay(); _running = false; break; default: break; } }
public void Restart() { running = true; totalCarriages = carriagesParent.childCount; totalMeds = startingTotalMeds; medsEffectiveness = startingMedsEffectiveness; UpdateTotalMedsMesh(); totalPeople = startingCarriagePeople * totalCarriages; UpdateTotalPeopleMesh(); secondsLeftToIncreaseMedsEffect = secondsToIncreaseMedsEffect; OnRestart?.Invoke(); }
public static void AddToTimeline(LockstepInputs inputs) { if (inputs.TickId < 0) { Index = 0; lockstepInputs.Clear(); OnRestart?.Invoke(); } if (inputs.TickId != lockstepInputs.Count) { return; } lockstepInputs.Add(inputs); inputTrackDict.Add(inputs.TickId, new List <Dictionary <int, Dictionary <Type, List <IInput> > > >()); if (inputs.UserInputs != null && inputs.UserInputs.Length > 0) { for (int i = 0; i < inputs.UserInputs.Length; i++) { var dict = new Dictionary <int, Dictionary <Type, List <IInput> > >(); for (int j = 0; j < inputs.UserInputs[i].Length; j++) { var userInputs = inputs.UserInputs[i][j]; dict.Add(userInputs.UserId, new Dictionary <Type, List <IInput> >()); if (userInputs.InputData != null) { for (int k = 0; k < userInputs.InputData.Length; k++) { var input = MessagePackUtility.Deserialize <IInput>(userInputs.InputData[k]); var type = input.GetType(); if (!dict[userInputs.UserId].ContainsKey(type)) { dict[userInputs.UserId].Add(type, new List <IInput>()); } dict[userInputs.UserId][type].Add(input); } } } inputTrackDict[inputs.TickId].Add(dict); } } }
public static void Restart() { Eitrum.Engine.Core.Timer.Stop(endGameRestartRoutine); Parent.DestroyAllChildren(); roundTimer = GameSettings.RoundDuration; SpawnPlayers(); OnRestart?.Invoke(); int counter = 3; Eitrum.Engine.Core.Timer.Repeat(1f, counter, () => { counter -= 1; OnCountDown.Invoke(counter); if (counter == 0) { OnRoundStart?.Invoke(); for (int iPlayer = 0, nPlayer = players.Count; iPlayer < nPlayer; ++iPlayer) { players[iPlayer].canMove = true; players[iPlayer].rb.isKinematic = false; } } }); }
public void PressRestart() { Hide(); OnRestart?.Invoke(); }
private void Restart() { OnRestart?.Invoke(currentLevel); }
void restart() { OnRestart?.Invoke(); pepsi = false; }
public static void Restart() => OnRestart?.Invoke();
public void InvokeRestart() { OnRestart?.Invoke(); }
private void Restart() { OnRestart?.Invoke(); }