Exemple #1
0
 public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.GetComponentInParent <CharacterController>() != null)
     {
         OnLevelFinished?.Invoke();
     }
 }
Exemple #2
0
 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());
     }
 }
Exemple #3
0
    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);
        }
    }
Exemple #4
0
 public static void InvokeLevelFinished(double reward)
 {
     OnLevelFinished?.Invoke(reward);
     OnSave?.Invoke();
 }
Exemple #5
0
 public void LevelFinished()
 {
     OnLevelFinished?.Invoke();
 }