upgrade to unity 6.1

This commit is contained in:
2025-07-17 15:57:56 +02:00
parent 702b766981
commit eea0e3ffad
1167 changed files with 62538 additions and 8659 deletions

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRAutoDropMagazine.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRAutomaticGun.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRBullet.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRBulletEmitter.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRCockingHandle.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRGrabMagazine.cs
uploadId: 736929

View File

@@ -15,11 +15,11 @@ namespace HurricaneVR.Framework.Weapons.Guns
{
public class HVRGunBase : HVRDamageProvider
{
public HVRGrabbable Grabbable { get; private set; }
[Header("Settings")]
public float TriggerPullThreshold = .7f;
public float TriggerResetThreshold = .6f;
[Tooltip("Cooldown before the next shot")]
@@ -27,6 +27,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
[Tooltip("Physics layers for the ray cast")]
public LayerMask HitLayerMask;
public float MuzzleFlashTime = .2f;
[Tooltip("Flexible bullet range per gun type")]
@@ -37,6 +38,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
[Tooltip("Is chambering required to shoot")]
public bool RequiresChamberedBullet = true;
public GunFireType FireType = GunFireType.Single;
[Tooltip("Speed of the bullet prefab")]
@@ -68,10 +70,10 @@ namespace HurricaneVR.Framework.Weapons.Guns
[Header("Haptics")]
public HVRGunHaptics Haptics;
public List<HVRGrabbable> HapticGrabbables = new List<HVRGrabbable>();
[Header("Objects")]
[Tooltip("Muzzle flash object")]
public GameObject MuzzleFlashObject;
@@ -82,7 +84,6 @@ namespace HurricaneVR.Framework.Weapons.Guns
public GameObject ChamberedCasing;
[Header("Required Transforms")]
[Tooltip("Optional Direction to eject Ammo - use the z axis")]
public Transform AmmoEjectDirection; //forward
@@ -91,6 +92,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
[Header("Components")]
public HVRGunEmitterBase BulletEmitter;
public HVRGunEmitterBase CasingEmitter;
public HVRCockingHandle CockingHandle;
public HVRGunBolt Bolt;
@@ -110,6 +112,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
[Header("Animation")]
public HVRTriggerAnimator TriggerAnimator;
public float CyclingTime;
public bool AnimateGun = true;
public Animator Animator;
@@ -119,12 +122,14 @@ namespace HurricaneVR.Framework.Weapons.Guns
[Header("Projectile")]
public bool SlowMotionBulletOnly;
public GameObject BulletPrefab;
public float BulletLife = 5f;
private readonly List<HVRBulletTracker> _objects = new List<HVRBulletTracker>();
private HVRGunPart[] _animatableGunParts;
private Coroutine _animationRoutine;
private HashSet<IGunHitHandler> _hitHandlers;
public UnityEvent Fired = new UnityEvent();
public HVRGunHitEvent Hit = new HVRGunHitEvent();
@@ -234,10 +239,24 @@ namespace HurricaneVR.Framework.Weapons.Guns
{
CasingEmitter.Gun = this;
}
_hitHandlers = new HashSet<IGunHitHandler>();
foreach (var handler in GetComponentsInChildren<IGunHitHandler>())
{
_hitHandlers.Add(handler);
}
}
public void AddHitHandler(IGunHitHandler handler)
{
_hitHandlers.Add(handler);
}
public void RemoveHitHandler(IGunHitHandler handler)
{
_hitHandlers.Remove(handler);
}
protected virtual void SetupPooledBullets()
{
@@ -282,7 +301,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
}
}
public bool IsTriggerReset;// { get; set; }
public bool IsTriggerReset; // { get; set; }
public bool IsTriggerPulled; //{ get; set; }
protected virtual void CheckTriggerPull()
@@ -437,7 +456,6 @@ namespace HurricaneVR.Framework.Weapons.Guns
}
protected virtual void OnAmmoSocketed(HVRGrabberBase grabber, HVRGrabbable grabbable)
{
var ammo = grabbable.GetComponent<HVRAmmo>();
@@ -484,6 +502,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
{
AfterAmmoReleased(AmmoGrabbable, Ammo);
}
Ammo = null;
AmmoGrabbable = null;
AmmoSocketReleasedHaptics();
@@ -524,7 +543,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
if (ammoGrabbable.Rigidbody)
{
ammoGrabbable.Rigidbody.velocity = direction.normalized * AmmoEjectVelocity;
ammoGrabbable.Rigidbody.linearVelocity = direction.normalized * AmmoEjectVelocity;
}
}
@@ -654,7 +673,6 @@ namespace HurricaneVR.Framework.Weapons.Guns
}
private IEnumerator RenablePhysics(HVRGrabbable grabbable, HVRHandGrabber hand)
{
yield return new WaitForSeconds(1);
@@ -854,6 +872,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
{
EjectCasing();
}
if (Bolt && BoltPushedBackAfterEmpty)
{
Bolt.PushBack();
@@ -935,12 +954,10 @@ namespace HurricaneVR.Framework.Weapons.Guns
bullet.Bullet.transform.rotation = Quaternion.FromToRotation(bullet.Bullet.transform.forward, direction) *
bullet.Bullet.transform.rotation;
bullet.SetRenderersActive(!SlowMotionBulletOnly || HVRTimeManager.Instance.IsTimeSlowed);
}
protected virtual void AfterFired()
{
}
protected virtual void MuzzleFlash()
@@ -953,7 +970,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
private IEnumerator MuzzleFlashRoutine()
{
MuzzleFlashObject.SetActive(false);/// ADDED to cancel longer fx like smoke to allow flame fx to fire again.
MuzzleFlashObject.SetActive(false); /// ADDED to cancel longer fx like smoke to allow flame fx to fire again.
MuzzleFlashObject.SetActive(true);
var elapsed = 0f;
@@ -1005,7 +1022,6 @@ namespace HurricaneVR.Framework.Weapons.Guns
Animator.enabled = false;
}
protected virtual void OnHit(RaycastHit hit, Vector3 direction)
{
var damageHandler = hit.collider.GetComponent<HVRDamageHandlerBase>();
@@ -1015,6 +1031,10 @@ namespace HurricaneVR.Framework.Weapons.Guns
damageHandler.HandleRayCastHit(DamageProvider, hit);
}
foreach (var hh in _hitHandlers)
{
hh.HandleHit(DamageProvider, hit, direction);
}
if (AddForceOnHit && hit.collider.attachedRigidbody)
{
@@ -1095,7 +1115,6 @@ namespace HurricaneVR.Framework.Weapons.Guns
}
}
}
}
private class HVRBulletTracker
@@ -1127,11 +1146,10 @@ namespace HurricaneVR.Framework.Weapons.Guns
}
}
}
[Serializable]
public class HVRGunHitEvent : UnityEvent<GunHitArgs>
{
}
public struct GunHitArgs
@@ -1155,7 +1173,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
Distance = hit.distance;
}
}
public enum GunFireType
{
Single,

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRGunBase.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRGunBolt.cs
uploadId: 736929

View File

@@ -32,7 +32,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
{
if (!rb)
return;
rb.velocity = Vector3.zero;
rb.linearVelocity = Vector3.zero;
rb.angularVelocity = Vector3.zero;
rb.transform.position = transform.position;
rb.transform.rotation = transform.rotation;
@@ -41,7 +41,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
var xy = Random.insideUnitCircle * LaunchRadius;
var launchDirection = transform.right + new Vector3(0f, xy.x, xy.y);
rb.velocity = launchDirection * Random.Range(MinVelocity, MaxVelocity);
rb.linearVelocity = launchDirection * Random.Range(MinVelocity, MaxVelocity);
rb.AddRelativeTorque(
Random.Range(MinAngularVelocity.x, MaxAngularVelocity.x),
Random.Range(MinAngularVelocity.y, MaxAngularVelocity.y),

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRGunEmitterBase.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRGunHaptics.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRGunPart.cs
uploadId: 736929

View File

@@ -68,7 +68,7 @@ namespace HurricaneVR.Framework.Weapons.Guns
while (elapsed < EjectTime && grabbable)
{
grabbable.transform.position = Vector3.MoveTowards(grabbable.transform.position, target, speed * Time.deltaTime);
grabbable.Rigidbody.velocity = Vector3.zero;
grabbable.Rigidbody.linearVelocity = Vector3.zero;
grabbable.Rigidbody.angularVelocity = Vector3.zero;
elapsed += Time.deltaTime;
yield return null;

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRMagazineSocket.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRPistol.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRPooledEmitter.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRShotgun.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/HVRTriggerAnimator.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/PartFinders/HVRChamberedCasingFinder.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/PartFinders/HVRChamberedRoundFinder.cs
uploadId: 736929

View File

@@ -9,3 +9,10 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 177300
packageName: Hurricane VR - Physics Interaction Toolkit
packageVersion: 2.9.3.a
assetPath: Assets/HurricaneVR/Framework/Scripts/Weapons/Guns/PartFinders/HVRMagazineFinder.cs
uploadId: 736929