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

32 lines
625 B
C#
Raw Normal View History

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ArtefactInventory : MonoBehaviour
{
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);
}
}
}