Advertisement
Guest User

ItemData.cs

a guest
Jan 31st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. [CreateAssetMenuAttribute] // Had to add this
  4. public class ItemData : ScriptableObject // And inherit from this, and everything started working.
  5. {
  6.     public string name; // Note: Name needs to be a unique identifier.
  7.     public string description;
  8.     public GameObject prefab;
  9.  
  10.     public ItemData Copy()
  11.     {
  12.         ItemData itemData = new ItemData();
  13.         itemData.name = name;
  14.         itemData.description = description;
  15.         itemData.prefab = prefab;
  16.         return itemData;
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement