Beispiel #1
0
    void Awake()
    {
        dominoBlockHolder = GetComponent <DominoBlockHolder>();
        gameManager       = GetComponent <GameManager>();

        DominoBlockHolder.OnDeckChanged += UpdateDisplayBasedOnData;

        for (int i = 0; i < 7; i++)
        {
            GameObject playerGameObject = Instantiate(dominoBlockPrefab);
            playerGameObject.transform.SetParent(playerHolder.transform, false);
            playerGameObject.SetActive(false);

            GameObject opponentGameObject = Instantiate(dominoBlockOpponentPrefab);
            opponentGameObject.transform.SetParent(opponentHolder.transform, false);
            opponentGameObject.SetActive(false);
        }

        for (int i = 0; i < 28; i++)
        {
            GameObject tableGameObject = Instantiate(dominoBlockPrefab);
            tableGameObject.transform.SetParent(tabletTopHolder.transform, false);
            tableGameObject.SetActive(false);
        }
    }
Beispiel #2
0
    void Start()
    {
        hasPlayerPlayedBlock = false;
        hasAIPlayedBlock     = false;
        canPlayerMove        = true;
        canAIMove            = true;

        winUI.SetActive(false);
        loseUI.SetActive(false);
        tieUI.SetActive(false);

        currentState = State.START;

        startingHand    = 7;
        numberOfPlayers = 2;

        playerDominoesLeft = startingHand;
        aIDominoesLeft     = startingHand;

        dominoBlockHolder = GetComponent <DominoBlockHolder>();
        dominoDisplay     = GetComponent <DominoDisplay>();

        StartCoroutine(StartUp());
    }