Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class Item : MonoBehaviour
- {
- public string itemName;
- public bool isTwoHanded;
- public bool isStorageItem;
- public int storageCapacity;
- public Sprite icon;
- public string description = "";
- public string itemUses = "";
- // Separate offsets for left and right hands when holding one item
- public Vector3 leftPositionOffset = Vector3.zero;
- public Vector3 leftRotationOffset = Vector3.zero;
- public Vector3 rightPositionOffset = Vector3.zero;
- public Vector3 rightRotationOffset = Vector3.zero;
- // New offsets for left and right hands when holding two items
- public Vector3 leftTwoPositionOffset = Vector3.zero;
- public Vector3 leftTwoRotationOffset = Vector3.zero;
- public Vector3 rightTwoPositionOffset = Vector3.zero;
- public Vector3 rightTwoRotationOffset = Vector3.zero;
- // Edible item properties
- public bool isEdible = false;
- public float healthEffect = 0f;
- public float hydrationEffect = 0f;
- public float calorieEffect = 0f;
- // Backpack property
- public bool isBackpack = false;
- public bool isBlanket = false;
- public virtual void Use()
- {
- Debug.Log($"Using {itemName}");
- }
- private void Awake()
- {
- // Initialize properties specific to certain items
- if (itemName.ToLower().Contains("blanket"))
- {
- isBlanket = true; // Automatically set 'isBlanket' for blanket items
- }
- else
- {
- isBlanket = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment