48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
// Example: GameItem.cs
|
|
|
|
|
|
// [CreateAssetMenu(fileName = "Key", menuName = "Game Data/Key")]
|
|
|
|
namespace Types.Items
|
|
{
|
|
public class KeyItemSo : GameItem
|
|
{
|
|
public string KeyType;
|
|
|
|
// set type of key on instantiation
|
|
public KeyItemSo()
|
|
{
|
|
Type = ItemType.Key;
|
|
}
|
|
|
|
// Add other key-specific properties and methods here
|
|
public new KeyItem Clone()
|
|
{
|
|
var clone = new KeyItem
|
|
{
|
|
Icon = Icon,
|
|
KeyType = KeyType,
|
|
ItemName = ItemName
|
|
};
|
|
clone.Icon = Icon;
|
|
clone.ItemValue = ItemValue;
|
|
clone.Rarity = Rarity;
|
|
clone.Quantity = Quantity;
|
|
clone.StackSize = StackSize;
|
|
clone.SellValue = SellValue;
|
|
clone.IsStackable = IsStackable;
|
|
clone.IsEquippable = IsEquippable;
|
|
clone.IsConsumable = IsConsumable;
|
|
clone.IsQuestItem = IsQuestItem;
|
|
clone.IsKeyItem = IsKeyItem;
|
|
clone.IsCraftable = IsCraftable;
|
|
clone.IsTradeable = IsTradeable;
|
|
clone.IsSellable = IsSellable;
|
|
clone.IsDroppable = IsDroppable;
|
|
clone.IsDestroyable = IsDestroyable;
|
|
// clone all fields
|
|
|
|
return clone;
|
|
}
|
|
}
|
|
} |