这是第一个 Unity 开放项目的repo,是 Unity 和社区合作创建的一个小型开源游戏演示,第一款游戏是一款名为 Chop Chop 的动作冒险游戏。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

36 行
946 B

using UnityEngine;
// Created with collaboration from:
// https://forum.unity.com/threads/inventory-system.980646/
[CreateAssetMenu(fileName = "Item", menuName = "Inventory/Item", order = 51)]
public class Item : ScriptableObject
{
[Tooltip("The name of the item")]
[SerializeField]
private string _name = default;
[Tooltip("A preview image for the item")]
[SerializeField]
private Sprite _previewImage = default;
[Tooltip("A description of the item")]
[SerializeField]
[Multiline]
private string _description = default;
[Tooltip("The type of item")]
[SerializeField]
private ItemType _itemType = default;
[Tooltip("A prefab reference for the model of the item")]
[SerializeField]
private GameObject _prefab = default;
public string Name => _name;
public Sprite PreviewImage => _previewImage;
public string Description => _description;
public ItemType ItemType => _itemType;
public GameObject Prefab => _prefab;
}