evelynshilosky

Item - Part 3 & 4

Feb 7th, 2025
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class Item : MonoBehaviour
  4. {
  5.     public string itemName;
  6.     public bool isTwoHanded;
  7.     public bool isStorageItem;
  8.     public int storageCapacity;
  9.     public Sprite icon;
  10.  
  11.     public string description = "";
  12.     public string itemUses = "";
  13.  
  14.     // Separate offsets for left and right hands
  15.     public Vector3 leftPositionOffset = Vector3.zero;
  16.     public Vector3 leftRotationOffset = Vector3.zero;
  17.     public Vector3 rightPositionOffset = Vector3.zero;
  18.     public Vector3 rightRotationOffset = Vector3.zero;
  19.  
  20.     // Edible item properties
  21.     public bool isEdible = false;
  22.     public float healthEffect = 0f;
  23.     public float hydrationEffect = 0f;
  24.     public float calorieEffect = 0f;
  25.  
  26.     public virtual void Use()
  27.     {
  28.         Debug.Log($"Using {itemName}");
  29.     }
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment