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

public class HUDGUIState : GuiState {

    private GameObject hudContainer;

    private Text missionDecription;

    public override void Initialize() {
        base.Initialize();

        if (GameObject.Find("r_HUDContainer")) {
            hudContainer = GameObject.Find("r_HUDContainer");
        } else {
            GameObject tmpGO = (GameObject)Resources.Load(guiRootPath + "r_HUDContainer");
            hudContainer = (GameObject)Object.Instantiate(tmpGO);
        }

        hudContainer.transform.SetParent(uiRoot, false);

        if (GameObject.Find("r_MissionText")) {
            missionDecription = GameObject.Find("r_MissionText").GetComponent<Text>();
        }

        SetGuiText("T-rubble");
    }

    public void SetGuiText(string text) {
        missionDecription.text = text;
    }

    public void Dispose() {
        Object.Destroy(hudContainer);
    }
}
