ItemContainer.cs singleton

This commit is contained in:
s-prechtl 2022-05-20 08:51:25 +02:00
parent 6836367207
commit b9030174b6

View file

@ -4,6 +4,20 @@ using System.Collections.Generic;
using UnityEngine;
public class ItemContainer : MonoBehaviour {
#region Singleton
public static ItemContainer Instance;
private void Awake() {
if(Instance != null) {
Debug.LogWarning("More than one instance of ItemContainer found");
}
Instance = this;
}
#endregion
public Item[] allItems;
// Start is called before the first frame update
public Item GetItemByName(String name) {