示例#1
0
 public Item(Item pCopy)         //Create item by copy
 {
     ID            = pCopy.ID;
     Name          = pCopy.Name;
     Collectible   = pCopy.Collectible;
     MaxPerSlot    = pCopy.MaxPerSlot;
     Quantity      = pCopy.Quantity;
     InventorySlot = pCopy.InventorySlot;
     Type          = pCopy.Type;
 }
示例#2
0
    void OnGUI()
    {
        GUILayout.Label("New Item", EditorStyles.boldLabel);

        ItemName   = EditorGUILayout.TextField("Item Name", ItemName);
        ItemType   = (ItemData.eItemType)EditorGUILayout.EnumPopup("Type", ItemType);
        ItemSprite = EditorGUILayout.ObjectField("Sprite", ItemSprite, typeof(Sprite)) as Sprite;


        if (GUILayout.Button("Create"))
        {
            ItemData i = ScriptableObjectUtility.CreateAsset <ItemData>(ItemName) as ItemData;
            i.Name   = ItemName;
            i.Type   = ItemType;
            i.Sprite = ItemSprite;
        }
    }