Exemplo n.º 1
0
    void Start()
    {
        // if(Text.Length!=TextScale.Length)
        //      TextScale=new float[Text.Length];
        if (parent == null)
        {
            parent = transform;
        }

        float tempZScale = parent.localScale.z;

        parent.localScale = new Vector3(parent.localScale.x, parent.localScale.y, 1f);

        letterSize = new Vector2(1.55f, 3f);
        Vector3 offSet;
        Vector3 toAdded;
        float   yOffSet = 0f;
        int     li      = Text.Length;

        for (int i = 0; i < li; i++)
        {
            if (i < TextScale.Length)
            {
                yOffSet -= letterSize.y * TextScale[i] * parent.localScale.y;
            }
            else
            {
                yOffSet -= letterSize.y * parent.localScale.y;
            };

            offSet = new Vector3(0f, 0f, yOffSet);
            int lj = Text[i].Length;
            for (int j = 0; j < lj; j++)
            {
                toAdded = getOffSet(Text[i][j], TextScale[i]);
                offSet += toAdded / 2f;
                SpawnLetter(Text[i][j], offSet, TextScale[i]);
                offSet += toAdded / 2f;
            }
        }
        if (voidhole == null)
        {
            voidhole = GetComponent <Orbital.DarkHoleEffects>();
        }
        if (voidhole != null)
        {
            voidhole.enabled = true;
        }

        parent.localScale = new Vector3(parent.localScale.x, parent.localScale.y, tempZScale);
        Destroy(this);
    }
Exemplo n.º 2
0
    void Start()
    {
        // if(Text.Length!=TextScale.Length)
        //      TextScale=new float[Text.Length];
        if (parent == null)
            parent = transform;

        float tempZScale = parent.localScale.z;
        parent.localScale = new Vector3(parent.localScale.x, parent.localScale.y, 1f);

        letterSize = new Vector2(1.55f, 3f);
        Vector3 offSet;
        Vector3 toAdded;
        float yOffSet = 0f;
        int li = Text.Length;
        for (int i = 0; i < li; i++)
        {
            if (i < TextScale.Length)
                yOffSet -= letterSize.y * TextScale[i] * parent.localScale.y;
            else
                yOffSet -= letterSize.y * parent.localScale.y; ;

            offSet = new Vector3(0f, 0f, yOffSet);
            int lj = Text[i].Length;
            for (int j = 0; j < lj; j++)
            {
                toAdded = getOffSet(Text[i][j], TextScale[i]);
                offSet += toAdded / 2f;
                SpawnLetter(Text[i][j], offSet, TextScale[i]);
                offSet += toAdded / 2f;
            }
        }
        if (voidhole == null)
            voidhole = GetComponent<Orbital.DarkHoleEffects>();
        if (voidhole != null)
            voidhole.enabled = true;

        parent.localScale = new Vector3(parent.localScale.x, parent.localScale.y, tempZScale);
        Destroy(this);
    }