public void OnTriggerEnter2D(Collider2D other) { if (other.GetComponentInParent <CharacterController>() != null) { OnLevelFinished?.Invoke(); } }
public void InputControllerMovePlayer(Vector2Int direction) { if (!_isGameActive) { return; } Player.Move(Level.NextPlayerPosition(Player.Position, (Vector3Int)direction)); if (Level.IsOnFinishCell(Player.Position)) //проверяем на конец уровня { _isGameActive = false; OnLevelFinished?.Invoke(!LevelLoader.HasMoveLevels()); } }
private void SetPointsToPlayer(Player p) { int multiplier = Players.Length - finishedPlayers.Count; p.Points += PointsAmount * multiplier; finishedPlayers.Add(p); if (Players.Length == finishedPlayers.Count) { OnLevelFinished?.Invoke(Players); } }
public static void InvokeLevelFinished(double reward) { OnLevelFinished?.Invoke(reward); OnSave?.Invoke(); }
public void LevelFinished() { OnLevelFinished?.Invoke(); }