mirror of
https://github.com/DerTyp7/industrialize-unity.git
synced 2025-10-30 12:57:11 +01:00
a
This commit is contained in:
16
Assets/Scripts/Items/ItemSO.cs
Normal file
16
Assets/Scripts/Items/ItemSO.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user