Beispiel #1
0
        void Init()
        {
            //make sure we have a deck
            MyDeck = Deck.GetInstance();
            if (MyDeck == null)
            {
                Debug.LogError("Unable to get the deck!");
                return;
            }

            //make sure we have a table
            MyTable = Table.GetInstance();
            if (MyDeck == null)
            {
                Debug.LogError("Unable to get the table!");
                return;
            }

            //get our banner for messages
            MyBanner = GameObject.FindObjectOfType <Banner>();
            if (MyBanner == null)
            {
                Debug.LogError("Unable to find banner");
            }

            MyRoundCounter = GameObject.FindObjectOfType <RoundCounter>();
            if (MyRoundCounter == null)
            {
                Debug.LogError("Unable to find round counter");
            }

            MyTable.Init();

            //set up the deck
            MyDeck.CreateCards();
            MyDeck.ShuffleCards();
        }