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