added inventory and stamina system

This commit is contained in:
2026-02-17 15:38:46 +00:00
parent 8b975163a0
commit 27f2931ce1
43 changed files with 2980 additions and 250 deletions

View File

@@ -0,0 +1,29 @@
using UnityEngine;
/// <summary>
/// Add to a weapon prefab to define how it sits in the player's hands.
/// WeaponManager reads these values when the weapon is equipped.
/// </summary>
public class WeaponViewmodel : MonoBehaviour
{
[Header("View Model Transform")]
public Vector3 positionOffset = new Vector3(0.2f, -0.25f, 0.45f);
public Vector3 rotationOffset = new Vector3(0f, 0f, 0f);
public Vector3 scale = new Vector3(1f, 1f, 1f);
// Called by WeaponManager to apply these values
public void Apply()
{
transform.localPosition = positionOffset;
transform.localRotation = Quaternion.Euler(rotationOffset);
transform.localScale = scale;
}
// Called by WeaponManager to sync back after gizmo editing
public void SyncFromTransform()
{
positionOffset = transform.localPosition;
rotationOffset = transform.localRotation.eulerAngles;
scale = transform.localScale;
}
}