Ejemplo n.º 1
0
        private GameObject SpawnBlock(Vector3 pos, Transform parent, Color color)
        {
            var block = blockFactory.Create();

            block.Reset(pos, parent, color);
            return(block.gameObject);
        }
Ejemplo n.º 2
0
    public void Spawn()
    {
        var block = _blockFactory.Create(transform.position, finishPoint.position);

        block.transform.SetParent(transform, true);
        if (_blockSizeSetter.ShouldApplySize())
        {
            _blockSizeSetter.ApplySize(block.transform);
        }
    }
Ejemplo n.º 3
0
        /// <summary>
        /// Создать новый блок по параметрам
        /// </summary>
        /// <param name="width">Ширина</param>
        /// <param name="height">Длина</param>
        /// <param name="pos">Позиция создания</param>
        /// <param name="direction">Направление</param>
        /// <returns>Созданный блок</returns>
        public Block Create(int width, int height, Vector3 pos, DirectionEnum direction = DirectionEnum.Forward)
        {
            var tiles = CreateBlock(width, height, pos, direction);

            return(_factory.Create(tiles));
        }