26 lines
566 B
C#
26 lines
566 B
C#
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Inventory {
|
|
|
|
public class Database : MonoBehaviour
|
|
{
|
|
public List<GameObject> items;
|
|
|
|
public Item FindItem(string name)
|
|
{
|
|
foreach (var item in items)
|
|
{
|
|
if (item.GetComponent<Item>().title == name)
|
|
{
|
|
return item.GetComponent<Item>();
|
|
}
|
|
}
|
|
|
|
print("Find item with arg: " + name + " Item not found in database");
|
|
return null;
|
|
}
|
|
}
|
|
}
|