projectEli/Assets/SimpleInventorySystem/Scripts/UI/AppendUI.cs

32 lines
711 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AppendUI : MonoBehaviour
{
public Transform AttachToTransform;
public GameObject PrefabUI;
private GameObject instantiatedUI;
public void AppendUIToTransform()
{
if(PrefabUI != null && AttachToTransform != null)
{
instantiatedUI = Instantiate(PrefabUI, AttachToTransform);
}
}
public void RemoveUIFromTransform()
{
if (instantiatedUI != null)
{
// TODO: May need to add more here
Destroy(instantiatedUI);
}
}
public GameObject InstantiatedUI()
{
return instantiatedUI;
}
}