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