using UnityEngine;
using System.Collections;
using Framework.Entities;
using Framework.Extensions;
using UnityEngine.UI;
using Framework.Utility;

public class DialogBehaviour : CoreBehaviour
{
    public string text;
    private UnityTimer timer = new UnityTimer(5f, false);

    public void Refresh()
    {
        this.transform.RecursivelyFindChild("Text").GetComponent<Text>().text = text;
    }

    protected override void InnerAwake()
    {
        
    }

    protected override void InnerUpdate()
    {
        this.timer.Advance();
        if (this.timer.IsComplete())
        {
            this.timer.Reset();
            this.gameObject.SetActive(false);
        }
    }
}
