42 lines
983 B
C#
42 lines
983 B
C#
using UnityEngine;
|
|
|
|
public class PrefabManager : MonoBehaviour
|
|
{
|
|
public static PrefabManager Instance;
|
|
public GameObject slotPrefab;
|
|
public GameObject itemPrefab;
|
|
public GameObject hotkeyEntryPrefab;
|
|
|
|
private void Awake()
|
|
{
|
|
Debug.Log("PrefabManager Awake");
|
|
if (Instance == null)
|
|
{
|
|
Instance = this;
|
|
DontDestroyOnLoad(gameObject);
|
|
}
|
|
else
|
|
{
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
|
|
public GameObject GetSlotPrefab()
|
|
{
|
|
Debug.Log("Getting Slot Pefab");
|
|
if (slotPrefab == null) Debug.LogWarning("SlotPrefab is null");
|
|
return slotPrefab;
|
|
}
|
|
|
|
public GameObject GetHotkeyEntryPrefab()
|
|
{
|
|
Debug.Log("Getting HotkeyEntry Pefab");
|
|
if (hotkeyEntryPrefab == null) Debug.LogWarning("HotkeyEntryPrefab is null");
|
|
return hotkeyEntryPrefab;
|
|
}
|
|
|
|
public GameObject GetItemPrefab()
|
|
{
|
|
return itemPrefab;
|
|
}
|
|
} |