Exemple #1
0
        public void CreateHands()
        {
            if (!_hands.IsEmpty())
            {
                return;
            }

            Setup();

            int handIdWithExtraTile = Random.Range(0, _handCount);

            _indicatorTileView = _tileViewPoolManager.Spawn(_indicatorTileContainer);
            _indicatorTileView.Initialize(_okeyTile);
            _indicatorTileView.Setup();

            for (int i = 0; i < _handCount; i++)
            {
                Hand hand = new Hand(i, GetHandTiles(handIdWithExtraTile == i ? HandDefaultTileCount + 1 : HandDefaultTileCount));
                _hands.Add(hand);

                HandView handView = _handViewPoolManager.Spawn(_boardContainer);
                _currentHandViews.Add(handView);
                _handGridLayoutGroup.AddChild(handView.gameObject);
                handView.Initialize(hand, _tileViewPoolManager);
                handView.Setup();
            }
        }
Exemple #2
0
        public void Initialize()
        {
            _gameDeck = Deck.CreateFullDeck();

            OkeyTile    = _gameDeck.GetRandom();
            CurrentHand = CreateHand();

            _currentHandView = _handPool.Spawn();
            _currentHandView.transform.SetParent(_container);
            _currentHandView.Setup(CurrentHand);
            _currentHandView.PlayDistributeAnimation();

            _signalBus.TryFire(new BoardCreatedSignal(OkeyTile));
        }