Code Examples
Complete Item System Example
using Glitch9.AIDevKit.Sheets;
using UnityEngine;
public class ItemManager : MonoBehaviour
{
private ItemTable m_ItemTable;
void Start()
{
// Load item table
m_ItemTable = SheetDatabase.Load<ItemTable>("Items");
if (m_ItemTable == null)
{
Debug.LogError("Failed to load Items table");
return;
}
// Get specific item
DisplayItem("apple");
}
void DisplayItem(string itemKey)
{
var row = m_ItemTable.GetRow(itemKey);
if (row == null)
{
Debug.LogWarning($"Item not found: {itemKey}");
return;
}
string name = row.GetString("Name_EN");
string desc = row.GetString("Description_EN");
int price = row.GetInt("Price");
float weight = row.GetFloat("Weight");
Debug.Log($"{name} - ${price}");
Debug.Log($"Weight: {weight}kg");
Debug.Log($"Description: {desc}");
}
}Shop System Example
Enemy Database Example
Quest System Example
Last updated