mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 11:29:23 +00:00
Added a unity editor script to toggle ragdoll via animation on your avatar
This commit is contained in:
parent
76f9244d9c
commit
e426418806
6 changed files with 39 additions and 0 deletions
|
@ -30,6 +30,8 @@ namespace ml_prm
|
|||
Vector3 m_lastPosition = Vector3.zero;
|
||||
Vector3 m_velocity = Vector3.zero;
|
||||
|
||||
RagdollToggle m_avatarRagdollToggle = null;
|
||||
|
||||
internal RagdollController()
|
||||
{
|
||||
m_rigidBodies = new List<Rigidbody>();
|
||||
|
@ -67,6 +69,11 @@ namespace ml_prm
|
|||
|
||||
if(Settings.Hotkey && Input.GetKeyDown(KeyCode.R) && !ViewManager.Instance.isGameMenuOpen())
|
||||
SwitchRagdoll();
|
||||
|
||||
if (m_avatarRagdollToggle != null && m_avatarRagdollToggle.isActiveAndEnabled && m_avatarRagdollToggle.shouldOverride) {
|
||||
if (m_enabled != m_avatarRagdollToggle.isOn)
|
||||
SwitchRagdoll();
|
||||
}
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
|
@ -182,6 +189,8 @@ namespace ml_prm
|
|||
m_vrIK.onPostSolverUpdate.AddListener(this.OnIKPostUpdate);
|
||||
}
|
||||
|
||||
m_avatarRagdollToggle = PlayerSetup.Instance._avatar.GetComponentInChildren<RagdollToggle>(true);
|
||||
|
||||
m_avatarReady = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue