示例#1
0
        /// <summary>
        /// Ход противника.
        /// </summary>
        private void DoEnemyMove()
        {
            Assert.IsNotNull(_carousellPrefab);
            Assert.IsNotNull(_userCarousell);
            Assert.IsNotNull(_userCard);

            Assert.IsNull(_enemyCarousell);
            Assert.IsNull(_enemyCard);

            var carousellInstance = Instantiate(_carousellPrefab);

            _enemyCarousell = carousellInstance.GetComponent <Carousell>();
            Assert.IsNotNull(_enemyCarousell);

            UiIsLocked = true;
            _motionController.HideStartUi(true, 0).onComplete += () => UiIsLocked = false;

            _motionController.HideUserCarousell().onComplete += () =>
            {
                Destroy(_userCarousell.gameObject);
                _userCarousell = null;
            };

            _motionController.ShowEnemyCarousell(1.7f).onComplete += () =>
            {
                _enemyCard = _enemyCarousell.ExtractCard(_enemyCarousell.SelectedCard);
                Assert.IsNotNull(_enemyCard);

                var enemyCardType = _enemy.Move();
                _enemyCard.CardType          = enemyCardType;
                GameModel.Instance.EnemyCard = enemyCardType;

                _motionController.HideEnemyCarousell(0.7f).onComplete += () =>
                {
                    Destroy(_enemyCarousell.gameObject);
                    _enemyCarousell = null;

                    DoResult();
                };
            };
        }
示例#2
0
        /// <summary>
        /// Старт раунда.
        /// </summary>
        private void DoUserMove(bool initialize = true, float delay = 0, bool animateScores = false)
        {
            Assert.IsNotNull(_carousellPrefab);

            Assert.IsNull(_userCarousell);
            Assert.IsNull(_enemyCarousell);
            Assert.IsNull(_userCard);
            Assert.IsNull(_enemyCard);

            var carousellInstance = Instantiate(_carousellPrefab);

            _userCarousell = carousellInstance.GetComponent <Carousell>();
            Assert.IsNotNull(_userCarousell);

            _userCarousell.FillCards();

            UiIsLocked = true;
            _motionController.ShowStartUi(initialize, delay + 1.5f, animateScores).onComplete +=
                () => UiIsLocked = false;
            _motionController.ShowUserCarousell(delay);
        }