예제 #1
0
        IEnumerator ShiftToLeft()
        {
            Movable block;

            if (BoardModel.GetBlock <Movable>(_transform.position + Vector3.left, out block))
            {
                yield return(StartCoroutine(block.MoveTo(Vector3.left)));

                yield return(new WaitForSeconds(1));
            }
        }
예제 #2
0
        IEnumerator DigToLeft()
        {
            Destructible block;

            if (BoardModel.GetBlock <Destructible>(_transform.position + Vector3.left, out block))
            {
                block.Destruct(1);
                _sound.PlayRandomClip(ClipStorage.instance.drillInstrumentClips);
                yield return(new WaitForSeconds(1));
            }
        }
예제 #3
0
        /// <summary>
        /// Использовать инструмент
        /// </summary>
        /// <param name="direction">Направление движения шасси</param>
        /// <returns>Сопрограмма</returns>
        public IEnumerator Use(bool direction)
        {
            for (int x = -1; x <= 1; x++)
            {
                for (int y = -1; y <= 1; y++)
                {
                    Collected block;

                    if (BoardModel.GetBlock <Collected>(_transform.position + new Vector3(x, y, 0), out block))
                    {
                        block.Collect();
                    }
                }
            }

            yield return(null);
        }
예제 #4
0
        void Boom()
        {
            _source.PlayOneShot(boomClip);

            for (int x = -1; x <= 1; x++)
            {
                for (int y = -1; y <= 1; y++)
                {
                    Destructible block;

                    if (BoardModel.GetBlock <Destructible>(_transform.position + new Vector3(x, y, 0), out block))
                    {
                        block.Destruct(2);
                    }
                }
            }
        }