Ejemplo n.º 1
0
    IEnumerator Conversation(string[] P, string [] text, bool direction, string top, bool plus)
    {
        bln       = balloon.GetComponent <Talk> ();
        put       = true;
        isTalking = true;
        int i = 0;

        while (i < text.Length)
        {
            if (put)
            {
                bln.Image = "globo 01";
                bln.PosX  = GameObject.Find(P[i] + "(Clone)").gameObject.transform.position.x;
                if (P[i] == "Player")
                {
                    bln.PosY = -2f;
                }
                else if (P[i] == "Adan" || P[i] == "Señora")
                {
                    bln.PosY = 0f;
                }
                else
                {
                    bln.PosY = -1f;
                }
                bln.PosY = -1f;
                bln.Size = 1.7f;
                bln.Dir  = direction;
                bln.Put();
                globoSound.Play();
                if (direction)
                {
                    StartCoroutine(GameObject.FindGameObjectWithTag("Talk").gameObject.GetComponent <Talk>().Anim(-1.5f, text[i]));
                }
                else
                {
                    StartCoroutine(GameObject.FindGameObjectWithTag("Talk").gameObject.GetComponent <Talk>().Anim(1.5f, text[i]));
                }
                put = false;
                i++;
            }
            yield return(null);
        }
        if (top != "")
        {
            while (!put)
            {
                yield return(null);
            }
            StartCoroutine(TopBall(top));
        }
        if (plus)
        {
            GeneralGameManager.advance++;
        }
        time2 = 0f;
        PutMove();
        isTalking = false;
    }