mirror of
https://github.com/DerTyp7/industrialize-unity.git
synced 2025-10-30 21:07:11 +01:00
a
This commit is contained in:
7
Assets/Scripts/Items/ItemObject.cs
Normal file
7
Assets/Scripts/Items/ItemObject.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class ItemObject : ScriptableObject
|
||||
{
|
||||
public ItemSO itemSO;
|
||||
|
||||
}
|
||||
11
Assets/Scripts/Items/ItemObject.cs.meta
Normal file
11
Assets/Scripts/Items/ItemObject.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ef5c356495e3ed4c8b0df5bdb15c9d5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
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;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Items/ItemSO.cs.meta
Normal file
11
Assets/Scripts/Items/ItemSO.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91bfeda1bf899b140a446b5d5e85504c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user