ItemRef.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using KairoEngine.Core;
  5. using Sirenix.OdinInspector;
  6. namespace KairoEngine.Inventory
  7. {
  8. [System.Serializable]
  9. public class ItemRef
  10. {
  11. [HorizontalGroup("itemRef", 0.85f), HideLabel] public ItemBase item;
  12. [HorizontalGroup("itemRef", 0.15f), HideLabel] public int quantity = 1;
  13. [HideInInspector] public float lastUsed = 10000f;
  14. public ItemRef(ItemBase item, int quantity, float lastUsed = 0f)
  15. {
  16. this.item = item;
  17. this.quantity = quantity;
  18. this.lastUsed = lastUsed;
  19. }
  20. }
  21. [System.Serializable]
  22. public class ItemFirearmRef : ItemRef
  23. {
  24. public ItemBaseAmmo ammoType;
  25. public int ammo;
  26. public float accuracyModifier = 0f;
  27. public ItemFirearmRef(ItemBase item, int quantity, ItemBaseAmmo ammoType, int ammo, float accuracyModifier = 0f, float lastUsed = 0f) : base(item, quantity, lastUsed)
  28. {
  29. this.ammoType = ammoType;
  30. this.ammo = ammo;
  31. }
  32. }
  33. }