using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Invector.vItemManager
{
[vClassHeader("Item Collected Display", helpBoxText = "Use this to display the name of collected items", openClose = false)]
public class vItemCollectionDisplay : vMonoBehaviour
{
private static vItemCollectionDisplay instance;
///
/// Instance of the
///
///
public static vItemCollectionDisplay Instance
{
get
{
if (instance == null) { instance = GameObject.FindObjectOfType(); }
return vItemCollectionDisplay.instance;
}
}
public vItemCollectionTextHUD itemCollectedDiplayPrefab;
///
/// Send text to display in the HUD with fade in
///
/// message to show
/// time to stay showing
/// time to fade out
public void FadeText(string message, float timeToStay, float timeToFadeOut)
{
var display = Instantiate(itemCollectedDiplayPrefab);
display.transform.SetParent(transform, false);
display.transform.SetAsFirstSibling();
display.Show(message, timeToStay, timeToFadeOut);
}
}
}