Пример #1
0
    public void UpdateUI()
    {
        if (_game != null)
        {
            score.text = _game.GetScore().ToString();
            level.text = _game.GetLevel().ToString();
            rows.text  = _game.GetRowsCleared().ToString();

            foreach (ShapeDisplay shapeCounter in shapeCounterDisplays)
            {
                shapeCounter.UpdateDisplay(_game.GetTileSet());
            }

            for (int shapeIndex = 0; shapeIndex < shapeCounterText.Length; ++shapeIndex)
            {
                shapeCounterText[shapeIndex].text = _game.GetRandomizer().GetShapeCount(shapeIndex).ToString();
            }

            nextShape.Shape = _game.GetRandomizer().PeekNextShape();
            nextShape.UpdateDisplay(_game.GetTileSet());
        }
    }