Beispiel #1
0
    //**************************************************************************
    // Spawning

    public void SpawnFigure(System.Type figureType)
    {
        if (!enabled)
        {
            return;
        }

        currentFigure = FigureGenerator.CreateFigure(figureType);
        currentFigure.transform.parent = transform;
        currentFigure.fieldData        = fieldData;
        currentFigure.xPosition        = (int)START_POSITION.x;
        currentFigure.yPosition        = (int)START_POSITION.y;
    }
    //--------------------------------------------------------------------------

    private void CreateFigure(System.Type figureType)
    {
        BaseFigure figure = FigureGenerator.CreateFigure(figureType);

        figure.visualOnly              = true;
        nextFigure                     = figure.gameObject;
        figure.transform.parent        = container;
        figure.transform.localPosition = Vector3.zero;

        if (scoreBonusText.gameObject.activeInHierarchy)
        {
            nextFigure.SetActive(false);
        }
    }