revival/game/Assets/Scripts/Artefacts/ArtefactInventory.cs

30 lines
618 B
C#
Raw Normal View History

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ArtefactInventory : ScriptableObject
{
public static List<Artefact> artefactList = new List<Artefact>();
private static bool exists = false;
public static void addA(Artefact a)
{
//check if duplicate in the list
exists = false;
foreach (Artefact x in artefactList)
{
if (x.artefactID == a.artefactID)
exists = true;
}
if ( exists == false)
{
artefactList.Add(a);
}
}
}