Files
Simulation/Assets/Scripts/UI/UIBottomInventory.cs
SullyunShin c06a65ad49 asset 추가
2025-05-26 12:53:54 +09:00

21 lines
560 B
C#

using UnityEngine;
using System.Collections.Generic;
public class UIBottomInventory : MonoBehaviour
{
public List<GameObject> inventory = new List<GameObject>();
public Transform context;
public void LoadInventory()
{
for (int i = 0; i < context.childCount; i++)
{
GameObject obj = context.GetChild(i).gameObject;
Destroy(obj);
}
for (int i = 0; i < inventory.Count; i++)
{
GameObject prefab = inventory[i];
Instantiate(prefab, context);
}
}
}