private void InvokeGameCompleted() { GameManager.Instance.ChangePauseState(this, false); if (currentResult != GameResult.None) { GameCompleted?.Invoke(LevelManager.Instance.SelectedChapter, LevelManager.Instance.CurrentLevel, LevelManager.Instance.SelectedLevel.GetCurrentStar().Number, CurrentScore, currentResult, LevelManager.Instance.DailyChallenge); } currentResult = GameResult.None; }
// Call this when the player completes the task public virtual void OnCompleted() { AddAudioSource(); if (GameCompleted != null) { if (onCompleteAudioClip != null) { audioSource.PlayOneShot(onCompleteAudioClip); } GameCompleted.Invoke(); } }
private void GameTick(object sender, EventArgs e) { if (!m_ComponentManager.HasWinner) { m_ComponentManager.Update(); Refresh(); } else { GameTimer.Stop(); GameCompleted?.Invoke(this); } }
void Reload(string serializedBoard) { if (string.IsNullOrWhiteSpace(serializedBoard)) { return; } var lines = serializedBoard.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); if (!lines.Any()) { return; } items.Clear(); foreach (var line in lines) { var values = line.Split(new string[] { ":" }, StringSplitOptions.None); var coordinateX = default(int); var coordinateY = default(int); if (int.TryParse(values[0], out coordinateX) && int.TryParse(values[1], out coordinateY)) { var shape = values[2]; items.Add(Tuple.Create(coordinateX, coordinateY, shape ?? string.Empty)); } } if (items.Count == 9) { GameCompleted?.Invoke(this, EventArgs.Empty); } else { Reloaded?.Invoke(this, EventArgs.Empty); } }
private void OnGameCompleted(EventArgs e) { GameCompleted?.Invoke(this, e); }
protected virtual void OnGameCompleted(Participant e) { GenerateRandomPuzzle(); GameCompleted?.Invoke(this, e); }
protected virtual void OnGameCompleted(FieldState e) { GameCompleted?.Invoke(this, e); }