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