using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Bubble : MonoBehaviour
{

    Text _text;
    void Awake()
    {
        _text = GetComponentInChildren<Text>();
    }

    public void SetText(string text)
    {
        gameObject.SetActive(true);
        _text = GetComponentInChildren<Text>();
        _text.text = text;
        //GetComponent<Animator>().Play("Base Layer.FADE_IN");
        GetComponent<CanvasGroup>().alpha = 1f;
        Invoke("Hide", 2f);
    }
    public void Hide()
    {
        GetComponent<CanvasGroup>().alpha = 0f;
    }
}
