mirror of
https://github.com/DerTyp7/industrialize-unity.git
synced 2025-11-01 13:52:31 +01:00
17 lines
377 B
C#
17 lines
377 B
C#
using UnityEngine;
|
|
|
|
[CreateAssetMenu(menuName = "ScriptableObjects/ItemSO")]
|
|
public class ItemSO : ScriptableObject
|
|
{
|
|
public string id;
|
|
public string name;
|
|
public GameObject prefab;
|
|
public Sprite icon;
|
|
|
|
public void Spawn(Vector3 position)
|
|
{
|
|
GameObject item = Instantiate(prefab, position, Quaternion.identity);
|
|
item.name = name;
|
|
}
|
|
}
|