Exemplo n.º 1
0
    public void DisplayText(int lineNumber, int readerSpeed)
    {
        GameObject textParent  = Instantiate(defaultText, new Vector3(0, 0), transform.rotation);
        TextAppear displayText = textParent.GetComponentInChildren <TextAppear>();

        displayText.readerSpeed = readerSpeed;
        textParent.transform.SetParent(renderCanvas.transform, false);
        displayText.SetText(textLibrary.GetLine(lineNumber));
    }
Exemplo n.º 2
0
    public void DisplayUpperText(int lineNumber, int readerSpeed)
    {
        GameObject textParent  = Instantiate(upperText);
        TextAppear displayText = textParent.GetComponentInChildren <TextAppear>();

        displayText.readerSpeed = readerSpeed;
        textParent.transform.SetParent(renderCanvas.transform, false);
        displayText.SetText(textLibrary.GetLine(lineNumber));
        textParent.transform.SetAsFirstSibling();
    }
Exemplo n.º 3
0
    private void Awake()
    {
        //Singleton conditions
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Debug.LogWarning("Multiple instances of TextAppear");
        }


        //initializations
        body         = GetComponent <Rigidbody2D>();
        playerIcon1  = GameObject.FindWithTag("PlayerIcon1");
        playerIcon2  = GameObject.FindWithTag("PlayerIcon2");
        text         = GetComponentInChildren <TextMesh>();
        rendererText = GetComponentInChildren <MeshRenderer>();
        startPos     = transform.position;
    }
Exemplo n.º 4
0
    public void EnableText(TextAppear msg)
    {
        int x2 = (int)Random.Range(BorderLeft.position.x, BorderRight.position.x);
        int y2 = (int)Random.Range(BorderBottom.position.y, BorderTop.position.y);

        chancegained = Random.Range(0, 100);

        print("IDDDDDD:" + msg.id);

        if (msg.id == id && msg.id == 1)
        {
            if (chancegained >= 0 && chancegained <= 5)
            {
                Text1.text = "YAAY!";
            }
            else if (chancegained > 5 && chancegained <= 10)
            {
                Text1.text = "WOOJOO!";
            }
            else if (chancegained > 10 && chancegained <= 15)
            {
                Text1.text = "COINSSS!";
            }
            else if (chancegained > 15 && chancegained <= 20)
            {
                Text1.text = "YEEES!";
            }

            if (chancegained >= 0 && chancegained <= chance)
            {
                Text clone = Instantiate(Text1, new Vector2(x2, y2), Quaternion.identity) as Text;
                clone.transform.SetParent(Canvas.transform, false);
                Destroy(clone, 1.0f);
            }
        }
        else if (msg.id == id)
        {
            if (chancegained > chance)
            {
                switch (id)
                {
                case 15:
                    textObject.text = "Click!";
                    break;

                case 100:
                    textObject.text = "Let's goo!";
                    break;

                case 500:
                    textObject.text = "To the moon";
                    break;

                case 3000:
                    textObject.text = "Keep mining";
                    break;

                case 10000:
                    textObject.text = "go go go";
                    break;

                case 40000:
                    textObject.text = "GOOO";
                    break;

                case 200000:
                    textObject.text = "RICH";
                    break;

                case 4000:
                    textObject.text = "10/10";
                    break;

                case 5000:
                    textObject.text = "GOD";
                    break;

                case 6000:
                    textObject.text = "WOOW";
                    break;

                case 7000:
                    textObject.text = "Very very rich";
                    break;
                }
                GameObject clone = Instantiate(upgrade, new Vector2(msg.x, msg.y), Quaternion.identity) as GameObject;
                Destroy(clone, 1.0f);
            }
        }
    }