Ejemplo n.º 1
0
        private IEnumerator ShootBubble(BubbleAimTarget aimTarget, BubbleAmmoView ammoView)
        {
            if (aimTarget.Bounces())
            {
                yield return(StartCoroutine(MoveTo(aimTarget.BouncePosition(), ammoView)));
            }

            yield return(StartCoroutine(MoveTo(aimTarget.BubbleSlotView().transform.position, ammoView)));

            OnBubbleAdded(aimTarget.BubbleSlotView(), ammoView.BubbleConfig());

            yield return(null);

            Destroy(ammoView.gameObject);
        }
Ejemplo n.º 2
0
        void Update()
        {
            if (_bubbleBoard.IsLevelCompleted() || _waitForBubbleToArrive)
            {
                return;
            }

            if (IsAiming())
            {
                aimLineRenderer.positionCount = 3;

                _aimTarget = null;
                HandleAim();
            }
            else if (FinishedAiming())
            {
                if (_aimTarget != null)
                {
                    _aimTarget.BubbleSlotView().Reserve();
                    OnBubbleShot();
                    _bubbleShoot.Shoot(_aimTarget);
                    _aimTarget             = null;
                    _waitForBubbleToArrive = true;
                }

                OnNoBubbleSlotPreviewActivated();
            }
            else
            {
                aimLineRenderer.positionCount = 1;
                OnNoBubbleSlotPreviewActivated();
            }
        }