mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 11:29:23 +00:00
Reaction to CVRPointer component with ragdoll
type
This commit is contained in:
parent
dfa7da50d6
commit
faac28fb88
4 changed files with 75 additions and 1 deletions
|
@ -31,6 +31,7 @@ namespace ml_prm
|
|||
Vector3 m_velocity = Vector3.zero;
|
||||
|
||||
RagdollToggle m_avatarRagdollToggle = null;
|
||||
RagdollTrigger m_customTrigger = null;
|
||||
|
||||
internal RagdollController()
|
||||
{
|
||||
|
@ -55,6 +56,8 @@ namespace ml_prm
|
|||
m_puppetRoot.localPosition = Vector3.zero;
|
||||
m_puppetRoot.localRotation = Quaternion.identity;
|
||||
|
||||
m_customTrigger = MovementSystem.Instance.proxyCollider.gameObject.AddComponent<RagdollTrigger>();
|
||||
|
||||
Settings.SwitchChange += this.SwitchRagdoll;
|
||||
Settings.MovementDragChange += this.OnMovementDragChange;
|
||||
Settings.AngularDragChange += this.OnAngularDragChange;
|
||||
|
@ -63,6 +66,12 @@ namespace ml_prm
|
|||
|
||||
void OnDestroy()
|
||||
{
|
||||
if(m_customTrigger != null)
|
||||
{
|
||||
Object.Destroy(m_customTrigger);
|
||||
m_customTrigger = null;
|
||||
}
|
||||
|
||||
Settings.SwitchChange -= this.SwitchRagdoll;
|
||||
Settings.MovementDragChange -= this.OnMovementDragChange;
|
||||
Settings.AngularDragChange -= this.OnAngularDragChange;
|
||||
|
@ -83,6 +92,9 @@ namespace ml_prm
|
|||
|
||||
if(m_enabled && m_avatarReady && BodySystem.isCalibratedAsFullBody)
|
||||
BodySystem.TrackingPositionWeight = 0f;
|
||||
|
||||
if(!m_enabled && m_avatarReady && (m_customTrigger != null) && m_customTrigger.GetStateWithReset() && Settings.PointersReaction)
|
||||
SwitchRagdoll();
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue