daily pastebin goal
55%
SHARE
TWEET

ItemData.cs

a guest Jan 31st, 2018 2 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top