evelynshilosky

Item - Part 6.1

Mar 27th, 2025
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.19 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 when holding one item
  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.     // New offsets for left and right hands when holding two items
  21.     public Vector3 leftTwoPositionOffset = Vector3.zero;
  22.     public Vector3 leftTwoRotationOffset = Vector3.zero;
  23.     public Vector3 rightTwoPositionOffset = Vector3.zero;
  24.     public Vector3 rightTwoRotationOffset = Vector3.zero;
  25.  
  26.     // Edible item properties
  27.     public bool isEdible = false;
  28.     public float healthEffect = 0f;
  29.     public float hydrationEffect = 0f;
  30.     public float calorieEffect = 0f;
  31.  
  32.     // Backpack property
  33.     public bool isBackpack = false;
  34.  
  35.     public virtual void Use()
  36.     {
  37.         Debug.Log($"Using {itemName}");
  38.     }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment