using System; using System.Collections; using System.Collections.Generic; using UnityEngine; [CreateAssetMenu(menuName = "KernelPanic/Artefacts/Inventory")] public class ArtefactInventory : ScriptableObject { private readonly List artefactList = new List(); public void addA(Artefact a) { //check if duplicate in the list foreach (Artefact x in artefactList) { if (x.artefactID == a.artefactID) { Debug.LogError($"{a} already exists in inventory", this); return; } } artefactList.Add(a); } private void OnDisable() { artefactList.Clear(); } }