Esempio n. 1
0
    public GameLogic(StartCoroutineDelegate startCoroutine, CreateBallDelegate createBall, PlayerScoresLogic playerScoresLogic, PlayerScoresPresentation playerScoresPresentation, GameData gameData)
    {
        this.startCoroutine           = startCoroutine;
        this.createBall               = createBall;
        this.playerScoresLogic        = playerScoresLogic;
        this.playerScoresPresentation = playerScoresPresentation;
        this.gameData = gameData;

        startCoroutine(GameFlow());
    }
Esempio n. 2
0
    void Awake()
    {
        const int numPlayers = 2;

        PlayerScoresLogic = new PlayerScoresLogic(numPlayers, PlayerScoresData.PointsToWin);

        Text scoresText = GetComponent <Text>();

        PlayerScoresPresentation = new PlayerScoresPresentation((visible) => gameObject.SetActive(visible), PlayerScoresLogic, PlayerScoresData.PointsToWin, scoresText);

        PlayerScoresLogic.OnScoreChanged += PlayerScoresPresentation.UpdateText;
    }