Esempio n. 1
0
        /// <summary>
        /// Добавление собственной фигуры
        /// </summary>
        /// <typeparam name="T">Тип фигуры</typeparam>
        /// <param name="figure">Фигура</param>
        /// <param name="func">Функция вычесления проперти</param>
        public void AddNewFigure <T>(T figure, Func <double[], double> func)
        {
            var newOption = new FigureOptions {
                TypeOfFigure = typeof(T), CalculatedFunction = func
            };

            _cachedNewFigures.Add(typeof(T), newOption);
        }
Esempio n. 2
0
    private void SpawnNewFigure()
    {
        _figureOptions = Instantiate(_figures[_numberCurrent], _pointSpawnFigure.position, Quaternion.identity).GetComponent <FigureOptions>();
        _figureOptions.OnFell.AddListener((_costFell) =>
        {
            _counterFeigureFell         += _costFell;
            _counterFiguresFellText.text = _counterFeigureFell.ToString();
            SpawnNewFigure();
        });

        SetRandomNumberFigure();        // номера нвоых фигнур
        SpawmNextFigure(_figures[_numberNext].GetComponent <IVector3>().GetVector3());
        _rowOfTenCubes.StartCheckRow(); // запуск проверки кубов в ряд
        _spawnerCoins.SpawnCoin();
    }