Exemple #1
0
    void SpawnImportantText(string text, Color color)
    {
        GameObject hej = Instantiate(textIM, Vector3.zero, Quaternion.identity);

        hej.transform.SetParent(fuckYou.transform);
        LifeTime script = hej.GetComponent <LifeTime>();

        script.SetPosition(new Vector3(0f + fuckYou.transform.position.x, 0f + fuckYou.transform.position.y, 0f));


        //INTE NICE MEN JAG HAR KVAR DET ÄNDÅ

        script.SetText(text);
        script.SetColor(color);
        script.SetLifeTime(240f);
    }
Exemple #2
0
    void SpawnRandomText()
    {
        GameObject hej = Instantiate(textLM, Vector3.zero, Quaternion.identity);

        hej.transform.SetParent(fuckYou.transform);
        LifeTime script = hej.GetComponent <LifeTime>();

        int     index = Random.Range(0, posList.Length);
        Vector3 extra = posList[index];

        script.SetPosition(new Vector3(0f + fuckYou.transform.position.x, 0f + fuckYou.transform.position.y, 0f) + extra);

        index = Random.Range(0, rotationList.Length);
        float rotation = rotationList[index];

        script.SetRotation(Quaternion.Euler(0f, 0f, rotation));

        index = Random.Range(0, randomQuotes.Length);
        script.SetText(randomQuotes[index]);

        script.SetLifeTime(70f);
    }