Fix for Unity 6 branch

This commit is contained in:
SDraw 2025-02-15 18:07:58 +03:00
parent 1e0e6449d6
commit b92d54c162
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
17 changed files with 36 additions and 80 deletions

View file

@ -1,4 +1,4 @@
[assembly: MelonLoader.MelonInfo(typeof(ml_prm.PlayerRagdollMod), "PlayerRagdollMod", "1.2.1", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonInfo(typeof(ml_prm.PlayerRagdollMod), "PlayerRagdollMod", "1.2.2-u6", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
[assembly: MelonLoader.MelonPriority(2)]
[assembly: MelonLoader.MelonAdditionalDependencies("BTKUILib")]

View file

@ -123,7 +123,7 @@ namespace ml_prm
public bool IsReady() => ((m_rigidBody != null) && (collider != null) && (!m_shouldHaveInfluencer || ((m_physicsInfluencer != null) && m_physicsInfluencer.IsReady())));
public void SetInfuencerUsage(bool p_state) => m_shouldHaveInfluencer = p_state;
public void SetColliderMaterial(PhysicMaterial p_material)
public void SetColliderMaterial(PhysicsMaterial p_material)
{
if(collider != null)
{
@ -146,7 +146,7 @@ namespace ml_prm
public void SetVelocity(Vector3 p_vec)
{
if(m_rigidBody != null)
m_rigidBody.velocity = p_vec;
m_rigidBody.linearVelocity = p_vec;
}
public void SetAngularVelocity(Vector3 p_vec)
@ -167,7 +167,7 @@ namespace ml_prm
{
if(m_rigidBody != null)
{
m_rigidBody.drag = p_value;
m_rigidBody.linearDamping = p_value;
m_rigidBody.WakeUp();
}
if(m_physicsInfluencer != null)
@ -178,7 +178,7 @@ namespace ml_prm
{
if(m_rigidBody != null)
{
m_rigidBody.angularDrag = p_value;
m_rigidBody.angularDamping = p_value;
m_rigidBody.WakeUp();
}
if(m_physicsInfluencer != null)

View file

@ -40,7 +40,7 @@ namespace ml_prm
RagdollToggle m_avatarRagdollToggle = null; // Custom component available for editor
AvatarBoolParameter m_ragdolledParameter = null;
PhysicMaterial m_physicsMaterial = null;
PhysicsMaterial m_physicsMaterial = null;
bool m_inAir = false;
bool m_reachedGround = true;
@ -77,12 +77,12 @@ namespace ml_prm
{
this.gameObject.layer = LayerMask.NameToLayer("PlayerLocal");
m_physicsMaterial = new PhysicMaterial("Ragdoll");
m_physicsMaterial = new PhysicsMaterial("Ragdoll");
m_physicsMaterial.dynamicFriction = c_defaultFriction;
m_physicsMaterial.staticFriction = c_defaultFriction;
m_physicsMaterial.frictionCombine = PhysicMaterialCombine.Average;
m_physicsMaterial.frictionCombine = PhysicsMaterialCombine.Average;
m_physicsMaterial.bounciness = 0f;
m_physicsMaterial.bounceCombine = PhysicMaterialCombine.Average;
m_physicsMaterial.bounceCombine = PhysicsMaterialCombine.Average;
m_puppet = new GameObject("[Puppet]").transform;
m_puppet.parent = this.transform;
@ -583,9 +583,9 @@ namespace ml_prm
bool l_bounciness = (Settings.Bounciness && WorldManager.IsSafeWorld());
m_physicsMaterial.dynamicFriction = (l_slipperiness ? 0f : c_defaultFriction);
m_physicsMaterial.staticFriction = (l_slipperiness ? 0f : c_defaultFriction);
m_physicsMaterial.frictionCombine = (l_slipperiness ? PhysicMaterialCombine.Minimum : PhysicMaterialCombine.Average);
m_physicsMaterial.frictionCombine = (l_slipperiness ? PhysicsMaterialCombine.Minimum : PhysicsMaterialCombine.Average);
m_physicsMaterial.bounciness = (l_bounciness ? 1f : 0f);
m_physicsMaterial.bounceCombine = (l_bounciness ? PhysicMaterialCombine.Maximum : PhysicMaterialCombine.Average);
m_physicsMaterial.bounceCombine = (l_bounciness ? PhysicsMaterialCombine.Maximum : PhysicsMaterialCombine.Average);
}
}
@ -701,7 +701,7 @@ namespace ml_prm
{
if(m_avatarReady && m_ragdolled && CanUnragdoll())
{
BetterBetterCharacterController.Instance.TeleportPlayerTo(m_puppetReferences.hips.position, PlayerSetup.Instance.GetPlayerRotation().eulerAngles, false, false);
BetterBetterCharacterController.Instance.TeleportPlayerTo(m_puppetReferences.hips.position, PlayerSetup.Instance.GetPlayerRotation().eulerAngles, false, true);
TryRestoreMovement();
BodySystem.TrackingPositionWeight = 1f;
IKSystem.Instance.applyOriginalHipPosition = m_applyHipsPosition;

View file

@ -49,16 +49,12 @@ namespace ml_prm
public static bool IsLeftGrabPointerActive(this PuppetMaster p_source)
{
bool l_result = ((p_source._playerAvatarMovementDataCurrent.AnimatorGestureLeft >= 0.5f) && (p_source._playerAvatarMovementDataCurrent.AnimatorGestureLeft <= 1f));
l_result |= ((FingerSystem.GetCurlNormalized(p_source._playerAvatarMovementDataCurrent.LeftMiddle1Stretched) >= 0.5f) && (FingerSystem.GetCurlNormalized(p_source._playerAvatarMovementDataCurrent.LeftMiddle2Stretched) >= 0.5f) && (FingerSystem.GetCurlNormalized(p_source._playerAvatarMovementDataCurrent.LeftMiddle3Stretched) >= 0.5f));
return l_result;
return p_source._playerAvatarMovementDataCurrent.IsLeftHandGrabbing();
}
public static bool IsRightGrabPointerActive(this PuppetMaster p_source)
{
bool l_result = ((p_source._playerAvatarMovementDataCurrent.AnimatorGestureRight >= 0.5f) && (p_source._playerAvatarMovementDataCurrent.AnimatorGestureRight <= 1f));
l_result |= ((FingerSystem.GetCurlNormalized(p_source._playerAvatarMovementDataCurrent.RightMiddle1Stretched) >= 0.5f) && (FingerSystem.GetCurlNormalized(p_source._playerAvatarMovementDataCurrent.RightMiddle2Stretched) >= 0.5f) && (FingerSystem.GetCurlNormalized(p_source._playerAvatarMovementDataCurrent.RightMiddle3Stretched) >= 0.5f));
return l_result;
return p_source._playerAvatarMovementDataCurrent.IsRightHandGrabbing();
}
public static CVRSeat GetCurrentSeat(this BetterBetterCharacterController p_instance) => (ms_lastCVRSeat?.GetValue(p_instance) as CVRSeat);

View file

@ -4,7 +4,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<Platforms>x64</Platforms>
<PackageId>PlayerRagdollMod</PackageId>
<Version>1.2.1</Version>
<Version>1.2.2</Version>
<Authors>SDraw</Authors>
<Company>SDraw</Company>
<Product>PlayerRagdollMod</Product>