浏览代码

make it possible to show items of inventory in inspector

/main
circa94 4 年前
当前提交
2018a05a
共有 4 个文件被更改,包括 32 次插入24 次删除
  1. 10
      UOP1_Project/Assets/Inventory/ScriptableObjects/Items/Salad.asset
  2. 15
      UOP1_Project/Assets/Inventory/Scripts/ItemStack.cs
  3. 23
      UOP1_Project/Assets/Inventory/Scripts/ScriptableObjects/Item.cs
  4. 8
      UOP1_Project/Assets/Inventory/ScriptableObjects/Items.meta

10
UOP1_Project/Assets/Inventory/ScriptableObjects/Items/Salad.asset


m_Script: {fileID: 11500000, guid: 58a5b32581978a141a66d240261449d0, type: 3}
m_Name: Salad
m_EditorClassIdentifier:
_name: Salad
_previewImage: {fileID: 0}
_description: A green salad
_itemType: {fileID: 11400000, guid: 24ac82c7b4c359e46971d2d454d1f434, type: 2}
_prefab: {fileID: 3692601780327477930, guid: 5a54f3a933a5913478d31220031b05fc, type: 3}
Name: Salad
PreviewImage: {fileID: 0}
Description: A green salad
ItemType: {fileID: 11400000, guid: 24ac82c7b4c359e46971d2d454d1f434, type: 2}
Prefab: {fileID: 3692601780327477930, guid: 5a54f3a933a5913478d31220031b05fc, type: 3}

15
UOP1_Project/Assets/Inventory/Scripts/ItemStack.cs


public class ItemStack
using System;
using UnityEngine;
[Serializable]
public class ItemStack
public Item Item { get; }
[SerializeField]
private Item _item;
public int Amount { get; set; }
public Item Item => _item;
public int Amount;
Item = item;
_item = item;
Amount = amount;
}
}

23
UOP1_Project/Assets/Inventory/Scripts/ScriptableObjects/Item.cs


using UnityEngine;
using System;
using UnityEngine;
[Serializable]
[SerializeField]
private string _name;
public string Name;
private Sprite _previewImage;
public Sprite PreviewImage;
private string _description;
public string Description;
private ItemType _itemType;
public ItemType ItemType;
private GameObject _prefab;
public string Name => _name;
public Sprite PreviewImage => _previewImage;
public string Description => _description;
public ItemType ItemType => _itemType;
public GameObject Prefab => _prefab;
public GameObject Prefab;
}

8
UOP1_Project/Assets/Inventory/ScriptableObjects/Items.meta


fileFormatVersion: 2
guid: f7c211e5fa39cbe4aae8dc1c5f2fc325
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存