#define DEBUG using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using DestinyScript; using FistVR; using H3MP; using H3MP.Scripts; using H3MP.Tracking; using H3VRUtils.MonoScripts.VisualModifiers; using HarmonyLib; using JerryComponent; using JerryFBT2; using JerryLegsIK; using JerryNPC; using OtherLoader; using RootMotion; using RootMotion.FinalIK; using RootMotion1.FinalIK; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.Serialization; using UnityEngine.UI; using UnityEngine.Windows.Speech; using Valve.VR; using Valve.VR.InteractionSystem.Sample; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace JerryComponent { public class ArmourDamagable : MonoBehaviour { public FVRPhysicalObject mainobj; public FVRFireArmAttachmentMount frontmount; public FVRFireArmAttachmentMount backmount; public ArmourPlate frontplate; public ArmourPlate backplate; public PMat BackPMAT; public PMat FrontPMAT; public MatDef NewMat; public MatDef UsedMat; public MatDef BrokenMat; public GameObject necksoli; public GameObject necktran; public GameObject bodynew; public GameObject bodyused; public GameObject bodybroken; public GameObject frontcoverNew; public GameObject frontcoverUsed; public GameObject frontcoverBroken; public GameObject frontcoverNewtran; public GameObject frontcoverUsedtran; public GameObject frontcoverBrokentran; private void FixedUpdate() { if ((Object)(object)mainobj.m_quickbeltSlot != (Object)null) { necksoli.SetActive(false); necktran.SetActive(true); } else if ((Object)(object)mainobj.m_quickbeltSlot == (Object)null) { necksoli.SetActive(true); necktran.SetActive(false); } if (frontmount.HasAttachmentsOnIt()) { if ((Object)(object)((Component)frontmount.AttachmentsList[0]).gameObject.GetComponentInChildren() != (Object)null) { frontplate = ((Component)frontmount.AttachmentsList[0]).gameObject.GetComponentInChildren(); } } else if (!frontmount.HasAttachmentsOnIt()) { frontplate = null; FrontPMAT.MatDef = BrokenMat; frontcoverNew.SetActive(true); frontcoverUsed.SetActive(false); frontcoverBroken.SetActive(false); frontcoverNewtran.SetActive(true); frontcoverUsedtran.SetActive(false); frontcoverBrokentran.SetActive(false); } if (backmount.HasAttachmentsOnIt()) { if ((Object)(object)((Component)backmount.AttachmentsList[0]).gameObject.GetComponentInChildren() != (Object)null) { backplate = ((Component)backmount.AttachmentsList[0]).gameObject.GetComponentInChildren(); } } else if (!backmount.HasAttachmentsOnIt()) { backplate = null; BackPMAT.MatDef = BrokenMat; } if ((Object)(object)frontplate != (Object)null) { if (frontplate.ArmourStif > frontplate.SetArmourStif * 0.5f) { FrontPMAT.MatDef = NewMat; frontcoverNew.SetActive(true); frontcoverUsed.SetActive(false); frontcoverBroken.SetActive(false); frontcoverNewtran.SetActive(true); frontcoverUsedtran.SetActive(false); frontcoverBrokentran.SetActive(false); } else if (frontplate.ArmourStif <= frontplate.SetArmourStif * 0.5f && frontplate.ArmourStif > 0f) { FrontPMAT.MatDef = UsedMat; frontcoverNew.SetActive(false); frontcoverUsed.SetActive(true); frontcoverBroken.SetActive(false); frontcoverNewtran.SetActive(false); frontcoverUsedtran.SetActive(true); frontcoverBrokentran.SetActive(false); } else if (frontplate.ArmourStif <= 0f) { FrontPMAT.MatDef = BrokenMat; frontcoverNew.SetActive(false); frontcoverUsed.SetActive(false); frontcoverBroken.SetActive(true); frontcoverNewtran.SetActive(false); frontcoverUsedtran.SetActive(false); frontcoverBrokentran.SetActive(true); } } else if ((Object)(object)frontplate == (Object)null) { FrontPMAT.MatDef = BrokenMat; frontcoverNew.SetActive(true); frontcoverUsed.SetActive(false); frontcoverBroken.SetActive(false); frontcoverNewtran.SetActive(true); frontcoverUsedtran.SetActive(false); frontcoverBrokentran.SetActive(false); } if ((Object)(object)backplate != (Object)null) { if (backplate.ArmourStif > backplate.SetArmourStif * 0.5f) { BackPMAT.MatDef = NewMat; } else if (backplate.ArmourStif <= backplate.SetArmourStif * 0.5f && backplate.ArmourStif > 0f) { BackPMAT.MatDef = UsedMat; } else if (backplate.ArmourStif <= 0f) { BackPMAT.MatDef = BrokenMat; } } else if ((Object)(object)backplate == (Object)null) { BackPMAT.MatDef = BrokenMat; } if ((Object)(object)frontplate != (Object)null && (Object)(object)backplate != (Object)null) { if ((Object)(object)FrontPMAT.MatDef == (Object)(object)BrokenMat || (Object)(object)BackPMAT.MatDef == (Object)(object)BrokenMat) { bodybroken.SetActive(true); bodynew.SetActive(false); bodyused.SetActive(false); } else if (((Object)(object)FrontPMAT.MatDef == (Object)(object)UsedMat && (Object)(object)BackPMAT.MatDef == (Object)(object)UsedMat) || ((Object)(object)FrontPMAT.MatDef == (Object)(object)UsedMat && (Object)(object)BackPMAT.MatDef == (Object)(object)NewMat) || ((Object)(object)FrontPMAT.MatDef == (Object)(object)NewMat && (Object)(object)BackPMAT.MatDef == (Object)(object)UsedMat)) { bodyused.SetActive(true); bodynew.SetActive(false); bodybroken.SetActive(false); } else if ((Object)(object)FrontPMAT.MatDef == (Object)(object)NewMat && (Object)(object)BackPMAT.MatDef == (Object)(object)NewMat) { bodyused.SetActive(false); bodynew.SetActive(true); bodybroken.SetActive(false); } } else if ((Object)(object)frontplate != (Object)null && (Object)(object)backplate == (Object)null) { if ((Object)(object)FrontPMAT.MatDef == (Object)(object)BrokenMat) { bodybroken.SetActive(true); bodynew.SetActive(false); bodyused.SetActive(false); } else if ((Object)(object)FrontPMAT.MatDef == (Object)(object)UsedMat) { bodyused.SetActive(true); bodynew.SetActive(false); bodybroken.SetActive(false); } else if ((Object)(object)FrontPMAT.MatDef == (Object)(object)NewMat) { bodyused.SetActive(false); bodynew.SetActive(true); bodybroken.SetActive(false); } } else if ((Object)(object)frontplate == (Object)null && (Object)(object)backplate != (Object)null) { if ((Object)(object)BackPMAT.MatDef == (Object)(object)BrokenMat) { bodybroken.SetActive(true); bodynew.SetActive(false); bodyused.SetActive(false); } else if ((Object)(object)BackPMAT.MatDef == (Object)(object)UsedMat) { bodyused.SetActive(true); bodynew.SetActive(false); bodybroken.SetActive(false); } else if ((Object)(object)BackPMAT.MatDef == (Object)(object)NewMat) { bodyused.SetActive(false); bodynew.SetActive(true); bodybroken.SetActive(false); } } else if ((Object)(object)frontplate == (Object)null && (Object)(object)backplate == (Object)null) { bodyused.SetActive(false); bodynew.SetActive(true); bodybroken.SetActive(false); } } } public class ArmourPlate : MonoBehaviour, IFVRDamageable { public float ArmourStif = 100000f; public float SetArmourStif = 100000f; public GameObject NewMesh; public GameObject UsedMesh; public GameObject BrokenMesh; public MatDef NewMat; public MatDef UsedMat; public MatDef BrokenMat; public PMat PMAT; public void Damage(Damage dam) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 if ((int)dam.Class == 1 || (int)dam.Class == 2) { ArmourStif -= dam.Dam_Blunt; } } private void FixedUpdate() { if (ArmourStif > SetArmourStif * 0.5f) { NewMesh.SetActive(true); UsedMesh.SetActive(false); BrokenMesh.SetActive(false); PMAT.MatDef = NewMat; } else if (ArmourStif <= SetArmourStif * 0.5f && ArmourStif > 0f) { NewMesh.SetActive(false); UsedMesh.SetActive(true); BrokenMesh.SetActive(false); PMAT.MatDef = UsedMat; } else if (ArmourStif <= 0f) { NewMesh.SetActive(false); UsedMesh.SetActive(false); BrokenMesh.SetActive(true); PMAT.MatDef = BrokenMat; } if (ArmourStif > SetArmourStif) { ArmourStif = SetArmourStif; } else if (ArmourStif < 0f) { ArmourStif = 0f; } } } public class controll_component : MonoBehaviour { public GameObject Comp; public GameObject Rot; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (Rot.transform.localEulerAngles.y > 10f && Rot.transform.localEulerAngles.y < -10f) { Comp.SetActive(false); } else { Comp.SetActive(true); } } } } public class CameraController : MonoBehaviour { public GameObject mTarget; public Vector3 mDistance; public float mSpeed = 5f; private void Update() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) ((Component)((Component)this).GetComponent()).transform.LookAt(mTarget.transform.position); ((Component)((Component)this).GetComponent()).transform.position = ((Component)((Component)this).GetComponent()).transform.position + mSpeed * Time.deltaTime * (mTarget.transform.position + mDistance - ((Component)((Component)this).GetComponent()).transform.position); } } public class IdleUpdate : StateMachineBehaviour { private float mIdleRayCast = 0.5f; public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex) { ((Component)animator).GetComponent().DisablePlant((AvatarIKGoal)0, 2f); ((Component)animator).GetComponent().DisablePlant((AvatarIKGoal)1, 2f); } public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { FootPlacementData footPlacementData = ((Component)animator).GetComponents()[0]; FootPlacementData footPlacementData2 = ((Component)animator).GetComponents()[1]; if ((Object)(object)footPlacementData != (Object)null) { if (((AnimatorStateInfo)(ref stateInfo)).normalizedTime > 0.25f) { footPlacementData.mExtraRayDistanceCheck = mIdleRayCast; } else { footPlacementData.mExtraRayDistanceCheck = 0f; } } if ((Object)(object)footPlacementData2 != (Object)null) { if (((AnimatorStateInfo)(ref stateInfo)).normalizedTime > 0.25f) { footPlacementData2.mExtraRayDistanceCheck = mIdleRayCast; } else { footPlacementData2.mExtraRayDistanceCheck = 0f; } } } } public class InputController : MonoBehaviour { public float Speed = 4f; public float TurnSpeed = 1f; public Camera mCam; protected Vector3 mLeftVec = new Vector3(-1f, 0f, 0f); protected Vector3 mFwdVec = new Vector3(0f, 0f, 1f); protected Vector3 mGOFwdVec = new Vector3(0f, 0f, 1f); protected Animator mAnim; protected float mTimePassed = 0f; protected int mMove = Animator.StringToHash("move"); protected int mSpeed = Animator.StringToHash("speed"); protected bool mMecFPActive = true; protected GUIStyle mStyle; private void Start() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) mStyle = new GUIStyle(); mAnim = ((Component)this).GetComponent(); mStyle.normal.textColor = new Color(0.5f, 0f, 0.75f, 1f); mStyle.fontSize = 20; } private void OnGUI() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) GUI.Label(new Rect(0f, 0f, 100f, 100f), "Use W, A, S, D to move around\nPress R to activate/deactivate Mec Foot Placer\nHold L to run", mStyle); } private void Update() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) Animator obj = mAnim; AnimatorStateInfo currentAnimatorStateInfo = mAnim.GetCurrentAnimatorStateInfo(0); float normalizedTime = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime; AnimatorStateInfo currentAnimatorStateInfo2 = mAnim.GetCurrentAnimatorStateInfo(0); obj.SetFloat("time", normalizedTime - Mathf.Floor(((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).normalizedTime)); if (!Input.anyKey) { float num = mAnim.GetFloat(mSpeed); num -= 1.5f * Time.deltaTime; if (num < 0f) { num = 0f; mAnim.SetBool(mMove, false); } mAnim.SetFloat(mSpeed, num); return; } bool flag = false; Vector3 val = ((Component)mCam).transform.rotation * mFwdVec; val.y = 0f; Vector3 val2 = ((Component)mCam).transform.rotation * mLeftVec; val2.y = 0f; mGOFwdVec = ((Component)this).gameObject.transform.rotation * new Vector3(0f, 0f, 1f); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(0f, 0f, 0f); float num2 = 1f; float num3 = 0f; if (Input.GetKey((KeyCode)97)) { val3 += val2; flag = true; } if (Input.GetKey((KeyCode)100)) { val3 -= val2; flag = true; } if (Input.GetKey((KeyCode)119)) { val3 += val; flag = true; } if (Input.GetKey((KeyCode)115)) { val3 -= val; flag = true; } if (Input.GetKey((KeyCode)108)) { float num4 = mAnim.GetFloat(mSpeed); if (flag) { num4 += Time.deltaTime; if (num4 > 1f) { num4 = 1f; } } else { num4 -= 2f * Time.deltaTime; if (num4 < 0f) { num4 = 0f; } } mAnim.SetFloat(mSpeed, num4); } else { float num5 = mAnim.GetFloat(mSpeed); num5 -= Time.deltaTime; if (num5 < 0f) { num5 = 0f; } mAnim.SetFloat(mSpeed, num5); } if (Input.GetKey((KeyCode)281) && mTimePassed > 0.1f) { Time.timeScale -= 0.1f; if (Time.timeScale < 0f) { Time.timeScale = 0f; } mTimePassed = 0f; Debug.Log((object)Time.timeScale); } if (Input.GetKey((KeyCode)280) && mTimePassed > 0.1f) { Time.timeScale += 0.1f; mTimePassed = 0f; Debug.Log((object)Time.timeScale); } if (Input.GetKeyDown((KeyCode)114)) { mMecFPActive = !mMecFPActive; ((Component)this).GetComponent().SetActive((AvatarIKGoal)0, mMecFPActive); ((Component)this).GetComponent().SetActive((AvatarIKGoal)1, mMecFPActive); } if (flag) { num2 = Vector3.Cross(mGOFwdVec, val3).y; if (num2 != 0f) { num2 /= Mathf.Abs(num2); } num3 = Vector3.Angle(mGOFwdVec, val3); num3 *= TurnSpeed * Time.deltaTime; ((Component)this).gameObject.transform.Rotate(new Vector3(0f, num2, 0f), num3, (Space)0); mAnim.SetBool(mMove, true); } else if (mAnim.GetFloat("speed") <= 0f) { mAnim.SetBool(mMove, false); } mTimePassed += Time.deltaTime; } } public class LocomotionUpdate : StateMachineBehaviour { public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex) { ((Component)animator).GetComponent().EnablePlant((AvatarIKGoal)0, 2f); ((Component)animator).GetComponent().EnablePlant((AvatarIKGoal)1, 2f); } public override void OnStateUpdate(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex) { float num = animator.GetFloat("speed"); float num2 = ((AnimatorStateInfo)(ref animatorStateInfo)).normalizedTime - Mathf.Floor(((AnimatorStateInfo)(ref animatorStateInfo)).normalizedTime); float num3 = 0.5f - 0.25f * num; FootPlacementData[] components = ((Component)animator).GetComponents(); FootPlacementData footPlacementData = null; for (byte b = 0; b < components.Length; b++) { switch (components[b].mFootID) { case FootPlacementData.LimbID.LEFT_FOOT: footPlacementData = components[b]; if ((double)num2 > 0.5 && num2 < 0.5f + num3) { footPlacementData.mExtraRayDistanceCheck = 0.7f; } else { footPlacementData.mExtraRayDistanceCheck = -0.2f; } break; case FootPlacementData.LimbID.RIGHT_FOOT: footPlacementData = components[b]; if (num2 < num3) { footPlacementData.mExtraRayDistanceCheck = 0.7f; } else { footPlacementData.mExtraRayDistanceCheck = -0.2f; } break; case FootPlacementData.LimbID.LEFT_HAND: footPlacementData = components[b]; break; case FootPlacementData.LimbID.RIGHT_HAND: footPlacementData = components[b]; break; } footPlacementData.mTransitionTime = 0.15f - 0.1f * num; } } } public class PelvisSet : StateMachineBehaviour { public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { ((Component)animator).GetComponent().mAdjustPelvisVertically = true; } } public class PelvisUnset : StateMachineBehaviour { public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { ((Component)animator).GetComponent().mAdjustPelvisVertically = false; } } public class FootPlacementData : MonoBehaviour { public enum LimbID { LEFT_FOOT, RIGHT_FOOT, LEFT_HAND, RIGHT_HAND } public enum Target { FOOT, TOE, HEEL } public LimbID mFootID = LimbID.LEFT_FOOT; public bool mPlantFoot = true; public Vector3 mForwardVector = new Vector3(0f, 0f, 1f); public Vector3 mIKHintOffset = new Vector3(0f, 0f, 0f); public Vector3 mUpVector = new Vector3(0f, 1f, 0f); public float mFootOffsetDist = 0.5f; public float mFootLength = 0.22f; public float mFootHalfWidth = 0.05f; public float mFootHeight = 0.1f; public float mFootRotationLimit = 45f; public float mTransitionTime = 0.2f; public float mExtraRayDistanceCheck = 0f; public bool mSetExtraRaydistanceCheckAutomatically = false; public float mErrorThreshold = 0.05f; public float mExtraRayDistanceCheckMin = 0f; public float mExtraRayDistanceCheckMax = 2f; protected bool mFootPlantIsOnTransition = false; protected float mFootPlantBlendSpeed; protected Vector3 mTargetPos = new Vector3(0f, 0f, 0f); protected Vector3 mTargetToePos = new Vector3(0f, 0f, 0f); protected Vector3 mTargetHeelPos = new Vector3(0f, 0f, 0f); protected Vector3 mRotatedFwdVec; protected Vector3 mRotatedIKHintOffset; protected float mTargetFootWeight = 0f; protected float mCurrentFootWeight = 0f; protected float mGoalBlendSpeed = 0f; protected float mPlantBlendFactor = 0f; private Vector3 mFootPlantedPos; private Quaternion mFootPlantedRot; private bool mFootPlanted = false; private Vector3 mPreviousFootPos = Vector3.zero; public void SetTargetPos(Target target, Vector3 target_pos) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) switch (target) { case Target.FOOT: mTargetPos = target_pos; break; case Target.TOE: mTargetToePos = target_pos; break; case Target.HEEL: mTargetHeelPos = target_pos; break; } } public Vector3 GetTargetPos(Target target) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) return (Vector3)(target switch { Target.FOOT => mTargetPos, Target.TOE => mTargetToePos, Target.HEEL => mTargetHeelPos, _ => Vector3.zero, }); } public void CalculateRotatedFwdVec() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) AvatarIKGoal val = (AvatarIKGoal)0; switch (mFootID) { case LimbID.RIGHT_FOOT: val = (AvatarIKGoal)1; break; case LimbID.LEFT_HAND: val = (AvatarIKGoal)2; break; case LimbID.RIGHT_HAND: val = (AvatarIKGoal)3; break; } float num = 0f; Quaternion iKRotation = ((Component)this).GetComponent().GetIKRotation(val); num = ((Quaternion)(ref iKRotation)).eulerAngles.y * (float)Math.PI / 180f; Quaternion val2 = default(Quaternion); ((Quaternion)(ref val2))..ctor(0f, Mathf.Sin(num * 0.5f), 0f, Mathf.Cos(num * 0.5f)); if (mFootPlanted && mPlantFoot) { num = ((Quaternion)(ref mFootPlantedRot)).eulerAngles.y * (float)Math.PI / 180f; val2 = Quaternion.Slerp(val2, new Quaternion(0f, Mathf.Sin(num * 0.5f), 0f, Mathf.Cos(num * 0.5f)), mPlantBlendFactor); } mRotatedFwdVec = val2 * ((Vector3)(ref mForwardVector)).normalized; } public Vector3 GetRotatedFwdVec() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return mRotatedFwdVec; } public void CalculateRotatedIKHint() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = ((Component)this).transform.rotation; float num = ((Quaternion)(ref rotation)).eulerAngles.y * (float)Math.PI / 180f; Quaternion val = default(Quaternion); ((Quaternion)(ref val))..ctor(0f, Mathf.Sin(num * 0.5f), 0f, Mathf.Cos(num * 0.5f)); mRotatedIKHintOffset = val * mIKHintOffset; } public Vector3 GetRotatedIKHint() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return mRotatedIKHintOffset; } public void SetTargetFootWeight(float weight) { mTargetFootWeight = weight; } public float GetTargetFootWeight() { return mTargetFootWeight; } public void SetCurrentFootWeight(float weight) { mCurrentFootWeight = weight; } public float GetCurrentFootWeight() { return mCurrentFootWeight; } public void SetGoalBlendSpeed(float speed) { mGoalBlendSpeed = speed; } public float GetGoalBlendSpeed() { return mGoalBlendSpeed; } public float GetPlantBlendFactor() { return mPlantBlendFactor; } public void SetPlantBlendFactor(float factor) { mPlantBlendFactor = factor; } public void EnablePlantBlend(float blend_speed) { mFootPlantBlendSpeed = Mathf.Abs(blend_speed); mFootPlantIsOnTransition = true; } public void DisablePlantBlend(float blend_speed) { mFootPlantBlendSpeed = 0f - Mathf.Abs(blend_speed); mFootPlantIsOnTransition = true; } public float GetFootPlantBlendSpeed() { return mFootPlantBlendSpeed; } public void PlantBlendTransitionEnded() { mFootPlantIsOnTransition = false; } public bool IsPlantOnTransition() { return mFootPlantIsOnTransition; } public void SetFootPlanted(bool planted) { mFootPlanted = planted; } public bool GetFootPlanted() { return mFootPlanted; } public void SetPlantedPos(Vector3 planted_pos) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) mFootPlantedPos = planted_pos; } public Vector3 GetPlantedPos() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return mFootPlantedPos; } public void SetPlantedRot(Quaternion planted_rot) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) mFootPlantedRot = planted_rot; } public Quaternion GetPlantedRot() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return mFootPlantedRot; } private void Start() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Animator component = ((Component)this).GetComponent(); if (!((Object)(object)component == (Object)null)) { HumanBodyBones val = (HumanBodyBones)5; switch (mFootID) { case LimbID.RIGHT_FOOT: val = (HumanBodyBones)6; break; case LimbID.RIGHT_HAND: val = (HumanBodyBones)18; break; case LimbID.LEFT_HAND: val = (HumanBodyBones)17; break; } mPreviousFootPos = component.GetBoneTransform(val).position; } } protected bool IsErrorHigh(HumanBodyBones bone, Vector3 current_position, Vector3 previous_pos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Vector3 val = previous_pos - current_position; float magnitude = ((Vector3)(ref val)).magnitude; float num = mErrorThreshold; if (Time.deltaTime < 0.033f) { num = mErrorThreshold * 30f * Time.deltaTime; } if (magnitude > num) { return true; } return false; } private void OnAnimatorIK() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if (!mSetExtraRaydistanceCheckAutomatically) { return; } Animator component = ((Component)this).GetComponent(); if (!((Object)(object)component == (Object)null)) { HumanBodyBones val = (HumanBodyBones)5; switch (mFootID) { case LimbID.RIGHT_FOOT: val = (HumanBodyBones)6; break; case LimbID.RIGHT_HAND: val = (HumanBodyBones)18; break; case LimbID.LEFT_HAND: val = (HumanBodyBones)17; break; } if (IsErrorHigh(val, component.GetBoneTransform(val).position, mPreviousFootPos)) { mExtraRayDistanceCheck = mExtraRayDistanceCheckMin; } else { mExtraRayDistanceCheck = mExtraRayDistanceCheckMax; } mPreviousFootPos = component.GetBoneTransform(val).position; } } } public class MecFootPlacer : MonoBehaviour { public bool mAdjustPelvisVertically = false; public bool mDampPelvis = false; public float mMaxLegLength = 1f; public float mMinLegLength = 0.2f; public float mPelvisAdjustmentSpeed = 1f; public string[] mLayersToIgnore; protected FootPlacementData mLeftFoot = null; protected FootPlacementData mRightFoot = null; protected FootPlacementData mLeftHand = null; protected FootPlacementData mRightHand = null; protected Animator mAnim; protected LayerMask mLayerMask = LayerMask.op_Implicit(-1); private const float mEpsilon = 0.005f; private float mCurrentRootVertError = 0f; private float mTargetRootVertError = 0f; private float mCurrentPelvisSpeed = 0f; private Vector3 mLeftFootContact_Ontransition_Disable; private Vector3 mLeftToeContact_Ontransition_Disable; private Vector3 mLeftHeelContact_Ontransition_Disable; private Vector3 mRightFootContact_Ontransition_Disable; private Vector3 mRightToeContact_Ontransition_Disable; private Vector3 mRightHeelContact_Ontransition_Disable; private Vector3 mLeftHandContact_Ontransition_Disable; private Vector3 mLeftHandToeContact_Ontransition_Disable; private Vector3 mLeftHandHeelContact_Ontransition_Disable; private Vector3 mRightHandContact_Ontransition_Disable; private Vector3 mRightHandToeContact_Ontransition_Disable; private Vector3 mRightHandHeelContact_Ontransition_Disable; private bool mRootPosLeftRightFoot = false; private bool mLeftFootActive = true; private bool mRightFootActive = true; private bool mLeftHandActive = true; private bool mRightHandActive = true; public void SetActive(AvatarIKGoal foot_id, bool active) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Invalid comparison between Unknown and I4 //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Invalid comparison between Unknown and I4 //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) if ((int)foot_id == 0) { if ((Object)(object)mLeftFoot == (Object)null) { return; } if (active && !mLeftFootActive) { ResetIKParams(foot_id); } mLeftFootActive = active; } if ((int)foot_id == 1) { if ((Object)(object)mRightFoot == (Object)null) { return; } if (active && !mRightFootActive) { ResetIKParams(foot_id); } mRightFootActive = active; } if ((int)foot_id == 2) { if ((Object)(object)mRightHand == (Object)null) { return; } if (active && !mLeftHandActive) { ResetIKParams(foot_id); } mLeftHandActive = active; } if ((int)foot_id == 3 && !((Object)(object)mRightHand == (Object)null)) { if (active && !mRightHandActive) { ResetIKParams(foot_id); } mRightHandActive = active; } } public bool IsActive(AvatarIKGoal foot_id) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Invalid comparison between Unknown and I4 //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 if ((int)foot_id == 0) { return mLeftFootActive; } if ((int)foot_id == 1) { return mRightFootActive; } if ((int)foot_id == 2) { return mLeftHandActive; } if ((int)foot_id == 3) { return mRightHandActive; } return false; } public void SetLayerMask(LayerMask layer_mask) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) mLayerMask = layer_mask; } public LayerMask GetLayerMask() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return mLayerMask; } public float GetPlantBlendWeight(AvatarIKGoal foot_id) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected I4, but got Unknown FootPlacementData footPlacementData; switch ((int)foot_id) { case 0: footPlacementData = mLeftFoot; break; case 1: footPlacementData = mRightFoot; break; case 2: footPlacementData = mLeftHand; break; case 3: footPlacementData = mRightHand; break; default: return -1f; } return footPlacementData.GetPlantBlendFactor(); } public void SetPlantBlendWeight(AvatarIKGoal foot_id, float weight) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected I4, but got Unknown FootPlacementData footPlacementData; switch ((int)foot_id) { default: return; case 0: footPlacementData = mLeftFoot; break; case 1: footPlacementData = mRightFoot; break; case 2: footPlacementData = mLeftHand; break; case 3: footPlacementData = mRightHand; break; } footPlacementData.SetPlantBlendFactor(weight); } public void EnablePlant(AvatarIKGoal foot_id, float blend_speed) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected I4, but got Unknown FootPlacementData footPlacementData; switch ((int)foot_id) { default: return; case 0: footPlacementData = mLeftFoot; break; case 1: footPlacementData = mRightFoot; break; case 2: footPlacementData = mLeftHand; break; case 3: footPlacementData = mRightHand; break; } footPlacementData.EnablePlantBlend(blend_speed); } public void DisablePlant(AvatarIKGoal foot_id, float blend_speed) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected I4, but got Unknown FootPlacementData footPlacementData; switch ((int)foot_id) { default: return; case 0: footPlacementData = mLeftFoot; break; case 1: footPlacementData = mRightFoot; break; case 2: footPlacementData = mLeftHand; break; case 3: footPlacementData = mRightHand; break; } footPlacementData.DisablePlantBlend(blend_speed); } private void ResetIKParams(AvatarIKGoal foot_id) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Invalid comparison between Unknown and I4 //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Invalid comparison between Unknown and I4 //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) if ((int)foot_id == 0) { Vector3 position = mAnim.GetBoneTransform((HumanBodyBones)5).position; mLeftFoot.SetTargetFootWeight(0f); mLeftFoot.SetCurrentFootWeight(0f); mLeftFoot.SetGoalBlendSpeed(0f); mLeftFoot.SetFootPlanted(planted: false); mLeftFootContact_Ontransition_Disable = position; mLeftToeContact_Ontransition_Disable = mLeftFoot.mUpVector * mLeftFoot.mFootOffsetDist + mLeftFoot.GetRotatedFwdVec() * mLeftFoot.mFootLength; mLeftHeelContact_Ontransition_Disable = position + new Quaternion(0f, 0.7071f, 0f, 0.7071f) * mLeftFoot.GetRotatedFwdVec() * mLeftFoot.mFootHalfWidth; } if ((int)foot_id == 1) { Vector3 position2 = mAnim.GetBoneTransform((HumanBodyBones)6).position; mRightFoot.SetTargetFootWeight(0f); mRightFoot.SetCurrentFootWeight(0f); mRightFoot.SetGoalBlendSpeed(0f); mRightFoot.SetFootPlanted(planted: false); mRightFootContact_Ontransition_Disable = position2; mRightToeContact_Ontransition_Disable = mRightFoot.mUpVector * mRightFoot.mFootOffsetDist + mRightFoot.GetRotatedFwdVec() * mRightFoot.mFootLength; mRightHeelContact_Ontransition_Disable = position2 + new Quaternion(0f, 0.7017f, 0f, 0.7071f) * mRightFoot.GetRotatedFwdVec() * mRightFoot.mFootHalfWidth; } if ((int)foot_id == 2) { Vector3 position3 = mAnim.GetBoneTransform((HumanBodyBones)17).position; mLeftHand.SetTargetFootWeight(0f); mLeftHand.SetCurrentFootWeight(0f); mLeftHand.SetGoalBlendSpeed(0f); mLeftHand.SetFootPlanted(planted: false); mLeftHandContact_Ontransition_Disable = position3; mLeftHandToeContact_Ontransition_Disable = mLeftHand.mUpVector * mLeftHand.mFootOffsetDist + mLeftHand.GetRotatedFwdVec() * mLeftHand.mFootLength; mLeftHandHeelContact_Ontransition_Disable = position3 + new Quaternion(0f, 0.7017f, 0f, 0.7071f) * mLeftHand.GetRotatedFwdVec() * mLeftHand.mFootHalfWidth; } if ((int)foot_id == 3) { Vector3 position4 = mAnim.GetBoneTransform((HumanBodyBones)18).position; mRightHand.SetTargetFootWeight(0f); mRightHand.SetCurrentFootWeight(0f); mRightHand.SetGoalBlendSpeed(0f); mRightHand.SetFootPlanted(planted: false); mRightHandContact_Ontransition_Disable = position4; mRightHandToeContact_Ontransition_Disable = mRightHand.mUpVector * mRightHand.mFootOffsetDist + mRightHand.GetRotatedFwdVec() * mRightHand.mFootLength; mRightHandHeelContact_Ontransition_Disable = position4 + new Quaternion(0f, 0.7017f, 0f, 0.7071f) * mRightHand.GetRotatedFwdVec() * mRightHand.mFootHalfWidth; } } protected void SetIKWeight(AvatarIKGoal foot_id, float target_weight, float transition_time) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected I4, but got Unknown switch ((int)foot_id) { case 0: if (Mathf.Abs(target_weight - mLeftFoot.GetTargetFootWeight()) > 0.005f) { if (transition_time != 0f) { mLeftFoot.SetGoalBlendSpeed((target_weight - mLeftFoot.GetCurrentFootWeight()) / transition_time); } else { mLeftFoot.SetGoalBlendSpeed(0.1f); mLeftFoot.SetCurrentFootWeight(target_weight); } } mLeftFoot.SetTargetFootWeight(target_weight); break; case 1: if (Mathf.Abs(target_weight - mRightFoot.GetTargetFootWeight()) > 0.005f) { if (transition_time != 0f) { mRightFoot.SetGoalBlendSpeed((target_weight - mRightFoot.GetCurrentFootWeight()) / transition_time); } else { mRightFoot.SetGoalBlendSpeed(0.1f); mRightFoot.SetCurrentFootWeight(target_weight); } } mRightFoot.SetTargetFootWeight(target_weight); break; case 2: if (Mathf.Abs(target_weight - mLeftHand.GetTargetFootWeight()) > 0.005f) { if (transition_time != 0f) { mLeftHand.SetGoalBlendSpeed((target_weight - mLeftHand.GetCurrentFootWeight()) / transition_time); } else { mLeftHand.SetGoalBlendSpeed(0.1f); mLeftHand.SetCurrentFootWeight(target_weight); } } mLeftHand.SetTargetFootWeight(target_weight); break; case 3: if (Mathf.Abs(target_weight - mRightHand.GetTargetFootWeight()) > 0.005f) { if (transition_time != 0f) { mRightHand.SetGoalBlendSpeed((target_weight - mRightHand.GetCurrentFootWeight()) / transition_time); } else { mRightHand.SetGoalBlendSpeed(0.1f); mRightHand.SetCurrentFootWeight(target_weight); } } mRightHand.SetTargetFootWeight(target_weight); break; } } protected void CalculateIKGoalWeights(AvatarIKGoal foot_id) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected I4, but got Unknown FootPlacementData footPlacementData; switch ((int)foot_id) { default: return; case 0: footPlacementData = mLeftFoot; break; case 1: footPlacementData = mRightFoot; break; case 2: footPlacementData = mLeftHand; break; case 3: footPlacementData = mRightHand; break; } float num = Mathf.Sign(footPlacementData.GetTargetFootWeight() - footPlacementData.GetCurrentFootWeight()); footPlacementData.SetCurrentFootWeight(footPlacementData.GetCurrentFootWeight() + footPlacementData.GetGoalBlendSpeed() * Time.deltaTime); if (num * Mathf.Sign(footPlacementData.GetTargetFootWeight() - footPlacementData.GetCurrentFootWeight()) < 1f || Mathf.Abs(footPlacementData.GetCurrentFootWeight() - footPlacementData.GetTargetFootWeight()) < 0.005f) { footPlacementData.SetCurrentFootWeight(footPlacementData.GetTargetFootWeight()); } else if (footPlacementData.GetCurrentFootWeight() > 1f || footPlacementData.GetCurrentFootWeight() < 0f) { footPlacementData.SetCurrentFootWeight(Mathf.Clamp(footPlacementData.GetTargetFootWeight(), 0f, 1f)); } } protected void CheckForLimits(AvatarIKGoal foot_id) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected I4, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) FootPlacementData footPlacementData; switch ((int)foot_id) { default: return; case 0: footPlacementData = mLeftFoot; break; case 1: footPlacementData = mRightFoot; break; case 2: footPlacementData = mLeftHand; break; case 3: footPlacementData = mRightHand; break; } Vector3 zero = Vector3.zero; Vector3 rotatedFwdVec = footPlacementData.GetRotatedFwdVec(); if (Vector3.Angle(rotatedFwdVec, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE)) > footPlacementData.mFootRotationLimit) { zero = footPlacementData.mUpVector * footPlacementData.mFootLength * Mathf.Tan(footPlacementData.mFootRotationLimit * ((float)Math.PI / 180f)); if (Vector3.Angle(footPlacementData.mUpVector, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE)) > 90f) { zero = -zero; } footPlacementData.SetTargetPos(FootPlacementData.Target.TOE, rotatedFwdVec * footPlacementData.mFootLength + zero); } Quaternion val = default(Quaternion); ((Quaternion)(ref val))..ctor(0f, 0.7071f, 0f, 0.7071f); if (Vector3.Angle(val * rotatedFwdVec, footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL)) > footPlacementData.mFootRotationLimit) { zero = footPlacementData.mUpVector * footPlacementData.mFootHalfWidth * Mathf.Tan(footPlacementData.mFootRotationLimit * ((float)Math.PI / 180f)); if (Vector3.Angle(footPlacementData.mUpVector, footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL)) > 90f) { zero = -zero; } footPlacementData.SetTargetPos(FootPlacementData.Target.HEEL, val * rotatedFwdVec * footPlacementData.mFootHalfWidth + zero); } } protected void UpdateFootPlantBlendWeights(AvatarIKGoal foot_id) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected I4, but got Unknown FootPlacementData footPlacementData; switch ((int)foot_id) { default: return; case 0: footPlacementData = mLeftFoot; break; case 1: footPlacementData = mRightFoot; break; case 2: footPlacementData = mLeftHand; break; case 3: footPlacementData = mRightHand; break; } if (!footPlacementData.IsPlantOnTransition()) { return; } footPlacementData.SetPlantBlendFactor(footPlacementData.GetPlantBlendFactor() + footPlacementData.GetFootPlantBlendSpeed() * Time.deltaTime); if (footPlacementData.GetFootPlantBlendSpeed() > 0f) { if (footPlacementData.GetPlantBlendFactor() > 1f) { footPlacementData.SetPlantBlendFactor(1f); footPlacementData.PlantBlendTransitionEnded(); } } else if (footPlacementData.GetPlantBlendFactor() < 0f) { footPlacementData.SetPlantBlendFactor(0f); footPlacementData.PlantBlendTransitionEnded(); } } protected void FindContactPoints(AvatarIKGoal foot_id) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected I4, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected I4, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected I4, but got Unknown //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Expected I4, but got Unknown //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Expected I4, but got Unknown //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_061a: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Expected I4, but got Unknown //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_0653: Unknown result type (might be due to invalid IL or missing references) //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_0672: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Expected I4, but got Unknown //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0608: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) Vector3 iKPosition = mAnim.GetIKPosition(foot_id); bool flag = true; FootPlacementData footPlacementData; switch ((int)foot_id) { default: return; case 0: footPlacementData = mLeftFoot; break; case 1: footPlacementData = mRightFoot; break; case 2: footPlacementData = mLeftHand; break; case 3: footPlacementData = mRightHand; break; } RaycastHit val = default(RaycastHit); if (Physics.Raycast(iKPosition + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootHeight + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask))) { SetIKWeight(foot_id, 1f, footPlacementData.mTransitionTime); Vector3 val2 = ((RaycastHit)(ref val)).point; if (footPlacementData.mPlantFoot && footPlacementData.GetFootPlanted() && Physics.Raycast(footPlacementData.GetPlantedPos() + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootHeight + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask))) { val2 = Vector3.Lerp(val2, ((RaycastHit)(ref val)).point, footPlacementData.GetPlantBlendFactor()); } footPlacementData.SetTargetPos(FootPlacementData.Target.FOOT, val2); switch ((int)foot_id) { case 0: mLeftFootContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT); break; case 1: mRightFootContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT); break; case 2: mLeftHandContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT); break; case 3: mRightHandContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT); break; } flag = true; } else { SetIKWeight(foot_id, 0f, footPlacementData.mTransitionTime); footPlacementData.SetTargetPos(FootPlacementData.Target.FOOT, Vector3.Lerp(iKPosition, (Vector3)((int)foot_id switch { 0 => mLeftFootContact_Ontransition_Disable, 1 => mRightFootContact_Ontransition_Disable, 2 => mLeftHandContact_Ontransition_Disable, 3 => mRightHandContact_Ontransition_Disable, _ => Vector3.zero, }), footPlacementData.GetCurrentFootWeight())); flag = false; } if (Physics.Raycast(iKPosition + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist + footPlacementData.GetRotatedFwdVec() * footPlacementData.mFootLength, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootLength + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask)) && flag) { Vector3 val3 = ((RaycastHit)(ref val)).point; if (footPlacementData.mPlantFoot && footPlacementData.GetFootPlanted() && Physics.Raycast(footPlacementData.GetPlantedPos() + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist + footPlacementData.GetRotatedFwdVec() * footPlacementData.mFootLength, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootLength + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask))) { val3 = Vector3.Lerp(val3, ((RaycastHit)(ref val)).point, footPlacementData.GetPlantBlendFactor()); } footPlacementData.SetTargetPos(FootPlacementData.Target.TOE, val3 - footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT)); switch ((int)foot_id) { case 0: mLeftToeContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.TOE); break; case 1: mRightToeContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.TOE); break; case 2: mLeftHandToeContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.TOE); break; case 3: mRightHandToeContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.TOE); break; } } else { Vector3 val4 = (Vector3)((int)foot_id switch { 0 => mLeftToeContact_Ontransition_Disable, 1 => mRightToeContact_Ontransition_Disable, 2 => mLeftHandToeContact_Ontransition_Disable, 3 => mRightHandToeContact_Ontransition_Disable, _ => Vector3.zero, }); footPlacementData.SetTargetPos(FootPlacementData.Target.TOE, Vector3.Slerp(footPlacementData.GetRotatedFwdVec() * footPlacementData.mFootLength, val4, footPlacementData.GetCurrentFootWeight())); } Quaternion val5 = default(Quaternion); ((Quaternion)(ref val5))..ctor(0f, 0.7071f, 0f, 0.7071f); Vector3 val6 = iKPosition + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist; Vector3 val7 = val5 * footPlacementData.GetRotatedFwdVec(); if (Physics.Raycast(val6 + ((Vector3)(ref val7)).normalized * footPlacementData.mFootHalfWidth, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootLength + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask)) && flag) { Vector3 val8 = ((RaycastHit)(ref val)).point; if (footPlacementData.mPlantFoot && footPlacementData.GetFootPlanted()) { Vector3 val9 = footPlacementData.GetPlantedPos() + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist; Vector3 val10 = val5 * footPlacementData.GetRotatedFwdVec(); if (Physics.Raycast(val9 + ((Vector3)(ref val10)).normalized * footPlacementData.mFootHalfWidth, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootLength + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask))) { val8 = Vector3.Lerp(val8, ((RaycastHit)(ref val)).point, footPlacementData.GetPlantBlendFactor()); } } footPlacementData.SetTargetPos(FootPlacementData.Target.HEEL, val8 - footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT)); switch ((int)foot_id) { case 0: mLeftHeelContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL); break; case 1: mRightHeelContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL); break; case 2: mLeftHandHeelContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL); break; case 3: mRightHeelContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL); break; default: { Vector3 val4 = Vector3.zero; break; } } } else { Vector3 val4 = (Vector3)((int)foot_id switch { 0 => mLeftHeelContact_Ontransition_Disable, 1 => mRightHeelContact_Ontransition_Disable, 2 => mLeftHandHeelContact_Ontransition_Disable, 3 => mRightHandHeelContact_Ontransition_Disable, _ => Vector3.zero, }); footPlacementData.SetTargetPos(FootPlacementData.Target.HEEL, Vector3.Slerp(val5 * footPlacementData.GetRotatedFwdVec() * footPlacementData.mFootHalfWidth, val4, footPlacementData.GetCurrentFootWeight())); } } protected void RootPositioningCheck() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) AnimateRootVertError(); if (mAdjustPelvisVertically) { Vector3 val = mAnim.GetBoneTransform((HumanBodyBones)2).position - mAnim.GetIKPosition((AvatarIKGoal)1); float magnitude = ((Vector3)(ref val)).magnitude; FootPlacementData footPlacementData = mRightFoot; mRootPosLeftRightFoot = true; Vector3 val2 = mAnim.GetBoneTransform((HumanBodyBones)1).position - mAnim.GetIKPosition((AvatarIKGoal)0); float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; Vector3 val3 = mAnim.GetBoneTransform((HumanBodyBones)2).position - mAnim.GetIKPosition((AvatarIKGoal)1); if (sqrMagnitude > ((Vector3)(ref val3)).sqrMagnitude) { Vector3 val4 = mAnim.GetBoneTransform((HumanBodyBones)1).position - mAnim.GetIKPosition((AvatarIKGoal)0); magnitude = ((Vector3)(ref val4)).magnitude; footPlacementData = mLeftFoot; mRootPosLeftRightFoot = false; } if (magnitude > mMaxLegLength) { mTargetRootVertError = magnitude - mMaxLegLength; float num = 0f; float num2 = 0f; Vector3 val5 = mAnim.GetBoneTransform((HumanBodyBones)1).position - (mAnim.GetIKPosition((AvatarIKGoal)0) + mLeftFoot.mUpVector * mTargetRootVertError); float magnitude2 = ((Vector3)(ref val5)).magnitude; if (magnitude2 < mMinLegLength) { num = mMinLegLength - magnitude2; } Vector3 val6 = mAnim.GetBoneTransform((HumanBodyBones)2).position - (mAnim.GetIKPosition((AvatarIKGoal)1) + mLeftFoot.mUpVector * mTargetRootVertError); magnitude2 = ((Vector3)(ref val6)).magnitude; if (magnitude2 < mMinLegLength) { num2 = mMinLegLength - magnitude2; } if (num2 != 0f || num != 0f) { if (num2 > num) { mTargetRootVertError -= num2; } else { mTargetRootVertError -= num; } } } else { mTargetRootVertError = 0f; mCurrentPelvisSpeed = 0f; } mAnim.SetIKPosition((AvatarIKGoal)0, mAnim.GetIKPosition((AvatarIKGoal)0) + footPlacementData.mUpVector * mCurrentRootVertError); mAnim.SetIKPosition((AvatarIKGoal)1, mAnim.GetIKPosition((AvatarIKGoal)1) + footPlacementData.mUpVector * mCurrentRootVertError); mAnim.SetIKPosition((AvatarIKGoal)2, mAnim.GetIKPosition((AvatarIKGoal)2) + footPlacementData.mUpVector * mCurrentRootVertError); mAnim.SetIKPosition((AvatarIKGoal)3, mAnim.GetIKPosition((AvatarIKGoal)3) + footPlacementData.mUpVector * mCurrentRootVertError); return; } mTargetRootVertError = 0f; mCurrentPelvisSpeed = 0f; if (Mathf.Abs(mCurrentRootVertError) >= 0.005f) { if (mRootPosLeftRightFoot) { mAnim.SetIKPosition((AvatarIKGoal)0, mAnim.GetIKPosition((AvatarIKGoal)0) + mRightFoot.mUpVector * mCurrentRootVertError); mAnim.SetIKPosition((AvatarIKGoal)1, mAnim.GetIKPosition((AvatarIKGoal)1) + mRightFoot.mUpVector * mCurrentRootVertError); mAnim.SetIKPosition((AvatarIKGoal)2, mAnim.GetIKPosition((AvatarIKGoal)2) + mRightFoot.mUpVector * mCurrentRootVertError); mAnim.SetIKPosition((AvatarIKGoal)3, mAnim.GetIKPosition((AvatarIKGoal)3) + mRightFoot.mUpVector * mCurrentRootVertError); } else { mAnim.SetIKPosition((AvatarIKGoal)0, mAnim.GetIKPosition((AvatarIKGoal)0) + mRightFoot.mUpVector * mCurrentRootVertError); mAnim.SetIKPosition((AvatarIKGoal)1, mAnim.GetIKPosition((AvatarIKGoal)1) + mRightFoot.mUpVector * mCurrentRootVertError); mAnim.SetIKPosition((AvatarIKGoal)2, mAnim.GetIKPosition((AvatarIKGoal)2) + mRightFoot.mUpVector * mCurrentRootVertError); mAnim.SetIKPosition((AvatarIKGoal)3, mAnim.GetIKPosition((AvatarIKGoal)3) + mRightFoot.mUpVector * mCurrentRootVertError); } } } protected void AnimateRootVertError() { float num = Mathf.Abs(mCurrentRootVertError - mTargetRootVertError); if (num < 0.005f) { mCurrentRootVertError = mTargetRootVertError; mCurrentPelvisSpeed = 0f; return; } float num2 = Mathf.Sign(mTargetRootVertError - mCurrentRootVertError); if (mDampPelvis) { if (num < mTargetRootVertError * 0.3f) { mCurrentPelvisSpeed -= mPelvisAdjustmentSpeed * Time.deltaTime; if (mCurrentPelvisSpeed < mPelvisAdjustmentSpeed * 0.5f) { mCurrentPelvisSpeed = mPelvisAdjustmentSpeed * 0.5f; } mCurrentRootVertError += num2 * mCurrentPelvisSpeed * Time.deltaTime; } else { mCurrentRootVertError += num2 * mPelvisAdjustmentSpeed * Time.deltaTime; } } else { mCurrentRootVertError += num2 * mPelvisAdjustmentSpeed * Time.deltaTime; mCurrentPelvisSpeed = 0f; } if (Mathf.Sign(mTargetRootVertError - mCurrentRootVertError) * num2 <= 0f) { mCurrentRootVertError = mTargetRootVertError; } } public void FootPlacement(AvatarIKGoal foot_id) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected I4, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Invalid comparison between Unknown and I4 //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) FootPlacementData footPlacementData = null; switch ((int)foot_id) { default: return; case 0: if (!mLeftFootActive) { return; } footPlacementData = mLeftFoot; break; case 1: if (!mRightFootActive) { return; } footPlacementData = mRightFoot; break; case 2: if (!mLeftHandActive) { return; } footPlacementData = mLeftHand; break; case 3: if (!mRightHandActive) { return; } footPlacementData = mRightHand; break; } ((Vector3)(ref footPlacementData.mUpVector)).Normalize(); ((Vector3)(ref footPlacementData.mForwardVector)).Normalize(); footPlacementData.CalculateRotatedIKHint(); footPlacementData.CalculateRotatedFwdVec(); footPlacementData.SetTargetPos(FootPlacementData.Target.FOOT, mAnim.GetIKPosition(foot_id)); UpdateFootPlantBlendWeights(foot_id); FindContactPoints(foot_id); CheckForLimits(foot_id); CalculateIKGoalWeights(foot_id); mAnim.SetIKRotationWeight(foot_id, footPlacementData.GetCurrentFootWeight()); float num = Vector3.Angle(footPlacementData.GetRotatedFwdVec(), footPlacementData.mForwardVector); Quaternion val = default(Quaternion); ((Quaternion)(ref val))..ctor(0f, 0.7071f, 0f, 0.7071f); Quaternion val2 = Quaternion.FromToRotation(footPlacementData.mForwardVector, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE)); Vector3 eulerAngles = ((Quaternion)(ref val2)).eulerAngles; eulerAngles.z = 0f; Quaternion val3 = Quaternion.Euler(eulerAngles); if ((num > 90f && num < 180f) || (num > 270f && num < 360f)) { Quaternion val4 = Quaternion.FromToRotation(footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL), val * footPlacementData.GetRotatedFwdVec()); eulerAngles = ((Quaternion)(ref val4)).eulerAngles; } else { Quaternion val5 = Quaternion.FromToRotation(val * footPlacementData.GetRotatedFwdVec(), footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL)); eulerAngles = ((Quaternion)(ref val5)).eulerAngles; } eulerAngles.x = 0f; eulerAngles.y = 0f; val3 *= Quaternion.Euler(eulerAngles); mAnim.SetIKRotation(foot_id, val3); Vector3 zero = Vector3.zero; if ((int)foot_id == 0) { zero = mAnim.GetBoneTransform((HumanBodyBones)3).position - mAnim.GetIKPosition((AvatarIKGoal)0); mAnim.SetIKHintPositionWeight((AvatarIKHint)0, footPlacementData.GetCurrentFootWeight()); mAnim.SetIKHintPosition((AvatarIKHint)0, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE) + footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT) + footPlacementData.GetRotatedIKHint() + zero); } if ((int)foot_id == 1) { zero = mAnim.GetBoneTransform((HumanBodyBones)4).position - mAnim.GetBoneTransform((HumanBodyBones)6).position; mAnim.SetIKHintPositionWeight((AvatarIKHint)1, footPlacementData.GetCurrentFootWeight()); mAnim.SetIKHintPosition((AvatarIKHint)1, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE) + footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT) + footPlacementData.GetRotatedIKHint() + zero); } Vector3 val6 = footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT) + footPlacementData.mUpVector * footPlacementData.mFootHeight; mAnim.SetIKPositionWeight(foot_id, footPlacementData.GetCurrentFootWeight()); mAnim.SetIKPosition(foot_id, val6); if (footPlacementData.GetCurrentFootWeight() <= 0f) { footPlacementData.SetFootPlanted(planted: false); } else if (footPlacementData.mPlantFoot && !footPlacementData.GetFootPlanted() && Mathf.Abs(footPlacementData.GetTargetFootWeight() - footPlacementData.GetCurrentFootWeight()) < 0.005f) { footPlacementData.SetPlantedPos(mAnim.GetIKPosition(foot_id)); footPlacementData.SetPlantedRot(mAnim.GetIKRotation(foot_id)); footPlacementData.SetFootPlanted(planted: true); } } private void UpdateLayerMask() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) for (byte b = 0; b < mLayersToIgnore.Length; b++) { int num = LayerMask.NameToLayer(mLayersToIgnore[b]); if (num != -1) { mLayerMask = LayerMask.op_Implicit(LayerMask.op_Implicit(mLayerMask) & ~Mathf.RoundToInt(Mathf.Pow(2f, (float)num))); } } } private void Start() { mAnim = ((Component)this).GetComponent(); bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; FootPlacementData[] components = ((Component)this).GetComponents(); for (byte b = 0; b < components.Length; b++) { switch (components[b].mFootID) { case FootPlacementData.LimbID.LEFT_FOOT: flag = true; mLeftFoot = components[b]; break; case FootPlacementData.LimbID.RIGHT_FOOT: flag2 = true; mRightFoot = components[b]; break; case FootPlacementData.LimbID.RIGHT_HAND: flag4 = true; mLeftHand = components[b]; break; case FootPlacementData.LimbID.LEFT_HAND: flag3 = true; mRightHand = components[b]; break; } if (flag && flag2 && flag3 && flag4) { break; } } } private void OnAnimatorIK() { UpdateLayerMask(); if ((Object)(object)mLeftFoot != (Object)null) { FootPlacement((AvatarIKGoal)0); } if ((Object)(object)mRightFoot != (Object)null) { FootPlacement((AvatarIKGoal)1); } if ((Object)(object)mLeftHand != (Object)null) { FootPlacement((AvatarIKGoal)2); } if ((Object)(object)mRightHand != (Object)null) { FootPlacement((AvatarIKGoal)3); } RootPositioningCheck(); } private void LateUpdate() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (mCurrentRootVertError != 0f) { if (mRootPosLeftRightFoot) { Transform boneTransform = mAnim.GetBoneTransform((HumanBodyBones)0); boneTransform.position -= mRightFoot.mUpVector * mCurrentRootVertError; } else { Transform boneTransform2 = mAnim.GetBoneTransform((HumanBodyBones)0); boneTransform2.position -= mLeftFoot.mUpVector * mCurrentRootVertError; } } } } namespace JerryComponent { public class DarwfSmall : MonoBehaviour { public GameObject Rot; private GameObject store; private void Start() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) store.transform.localScale = ((Component)GM.CurrentPlayerRoot).transform.localScale; } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (Rot.transform.localEulerAngles.x > 45f) { ((Component)GM.CurrentPlayerRoot).transform.localScale = new Vector3(1f, 0.6f, 1f); } if (Rot.transform.localEulerAngles.x < 45f) { ((Component)GM.CurrentPlayerRoot).transform.localScale = store.transform.localScale; } } } public class Fourpositiontoggle : MonoBehaviour { public GameObject Raiser; public GameObject obj0; public GameObject obj1; public GameObject obj2; public GameObject obj3; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) if (Raiser.transform.localPosition.y == 0f) { obj0.transform.localEulerAngles = new Vector3(90f, 0f, 0f); obj1.transform.localEulerAngles = new Vector3(0f, 0f, 0f); obj2.transform.localEulerAngles = new Vector3(0f, 0f, 0f); obj3.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } else if (Raiser.transform.localPosition.y == 1f) { obj0.transform.localEulerAngles = new Vector3(0f, 0f, 0f); obj1.transform.localEulerAngles = new Vector3(90f, 0f, 0f); obj2.transform.localEulerAngles = new Vector3(0f, 0f, 0f); obj3.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } else if (Raiser.transform.localPosition.y == 2f) { obj0.transform.localEulerAngles = new Vector3(0f, 0f, 0f); obj1.transform.localEulerAngles = new Vector3(0f, 0f, 0f); obj2.transform.localEulerAngles = new Vector3(90f, 0f, 0f); obj3.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } else if (Raiser.transform.localPosition.y == 3f) { obj0.transform.localEulerAngles = new Vector3(0f, 0f, 0f); obj1.transform.localEulerAngles = new Vector3(0f, 0f, 0f); obj2.transform.localEulerAngles = new Vector3(0f, 0f, 0f); obj3.transform.localEulerAngles = new Vector3(90f, 0f, 0f); } else if (Raiser.transform.localPosition.y == 4f) { obj0.transform.localEulerAngles = new Vector3(90f, 0f, 0f); obj1.transform.localEulerAngles = new Vector3(0f, 0f, 0f); obj2.transform.localEulerAngles = new Vector3(0f, 0f, 0f); obj3.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } } } namespace DestinyScript1 { public class HPRPro : MonoBehaviour { [Header("需要跟随VR设备的位置")] [Tooltip("(可选)头部的VR头显跟随与旋转位置")] public GameObject _head; public GameObject _neck; [Tooltip("双手跟随VR手柄的位置")] public Transform _ZuoShouWeiZhi; [Tooltip("双手跟随VR手柄的位置")] public Transform _YouShouWeiZhi; public GameObject HandGeoL; public GameObject HandGeoR; public Transform tarL; public Transform tarR; [Tooltip("(如果VRIK 为空 此处可以不添加)手部IK跟踪位置: 0 = VR手柄跟踪位, 1 = 武器抓握, 2 = 弹匣抓握, 3 = 护木抓握, 4 = 枪栓抓握,5 = 手枪滑套抓握, 6 = 子弹抓握, 7 = 手雷抓握, 8 = 手枪战术握法, 9 = 机枪机匣盖抓握位置, 10 = 护木抓握主手, 11=武器抓握扳机微调")] public Transform[] _leftHandTarget; [Tooltip("(如果VRIK 为空 此处可以不添加)手部IK跟踪位置: 0 = VR手柄跟踪位, 1 = 武器抓握, 2 = 弹匣抓握, 3 = 护木抓握, 4 = 枪栓抓握,5 = 手枪滑套抓握, 6 = 子弹抓握, 7 = 手雷抓握, 8 = 手枪战术握法, 9 = 机枪机匣盖抓握位置, 10 = 护木抓握主手, 11=武器抓握扳机微调")] public Transform[] _rightHandTarget; [Header("(可选)移动动画控制器")] public Animator playerAnime; [Header("(可选)左右手动画控制器")] public Animator leftHandAT; public Animator rightHandAT; [Header("移动动画float过渡条件名称")] public string AnimatorControllerName_X; public string AnimatorControllerName_Y; [Header("(如果左右手动画控制器为空 此处可以为空)动画bool过渡条件名称")] public string _gun; public string _mag; public string _grab; public string _bolt; public string _slide; public string _ammo; public string _trigger; public string _grenade; public string _HGCB; public string _gunCurved; [Header("双手手指动画开关控制")] public AngryNoob_FingerTracking _leftFingerTraking; public AngryNoob_FingerTracking _ringtFingerTraking; private GameObject _player; private FVRViveHand leftHand; private FVRViveHand rightHand; private FVRInteractiveObject _gameObejctOnHands; private bool _leftContinuousGrip = false; private bool _rightContinuousGrip = false; private bool _gripCut = false; private bool _fier; [NonSerialized] private FVRFireArm gun; [NonSerialized] private Vector3 gunAngle; [NonSerialized] private Vector3 gunAngle_Touch; private bool curved; private bool verticle; public GameObject HPL; public GameObject CGL; public GameObject DML; public GameObject HDML; public GameObject HPR; public GameObject CGR; public GameObject DMR; public GameObject HDMR; public bool cleared = false; public bool laststate = true; public GameObject tempPosL; public GameObject tempPosR; private void Awake() { _player = ((Component)GM.CurrentPlayerBody).gameObject; } private void Start() { leftHand = GM.CurrentMovementManager.Hands[0]; rightHand = GM.CurrentMovementManager.Hands[1]; } private void Update() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) HandGeoL.transform.SetParent((Transform)null); HandGeoR.transform.SetParent((Transform)null); ((Component)_ZuoShouWeiZhi).transform.SetParent((Transform)null); ((Component)_YouShouWeiZhi).transform.SetParent((Transform)null); if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null) { ((Component)_ZuoShouWeiZhi).transform.position = ((Component)GM.CurrentMovementManager.Hands[0]).gameObject.transform.position; ((Component)_ZuoShouWeiZhi).transform.eulerAngles = ((Component)GM.CurrentMovementManager.Hands[0]).gameObject.transform.eulerAngles; } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null) { ((Component)_YouShouWeiZhi).transform.position = ((Component)GM.CurrentMovementManager.Hands[1]).gameObject.transform.position; ((Component)_YouShouWeiZhi).transform.eulerAngles = ((Component)GM.CurrentMovementManager.Hands[1]).gameObject.transform.eulerAngles; } HandGeoL.transform.position = tarL.position; HandGeoL.transform.eulerAngles = tarL.eulerAngles; HandGeoR.transform.position = tarR.position; HandGeoR.transform.eulerAngles = tarR.eulerAngles; HandFollow(leftHand, rightHand, _leftFingerTraking, ref _leftContinuousGrip, leftHandAT, rightHandAT, _leftHandTarget, _ZuoShouWeiZhi); HandFollow(rightHand, leftHand, _ringtFingerTraking, ref _rightContinuousGrip, rightHandAT, leftHandAT, _rightHandTarget, _YouShouWeiZhi); if ((Object)(object)_head != (Object)null && (Object)(object)_neck != (Object)null) { HeadFollowPlayerBody(); } if ((Object)(object)playerAnime != (Object)null) { PlayerAnimC(); } } private void OnDestroy() { if ((Object)(object)HandGeoL != (Object)null) { Object.Destroy((Object)(object)HandGeoL.gameObject); } if ((Object)(object)HandGeoR != (Object)null) { Object.Destroy((Object)(object)HandGeoR.gameObject); } if ((Object)(object)_ZuoShouWeiZhi != (Object)null) { Object.Destroy((Object)(object)((Component)_ZuoShouWeiZhi).gameObject); } if ((Object)(object)_YouShouWeiZhi != (Object)null) { Object.Destroy((Object)(object)((Component)_YouShouWeiZhi).gameObject); } } private void HeadFollowPlayerBody() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) _head.transform.position = GM.CurrentPlayerBody.Head.position; _neck.transform.rotation = GM.CurrentPlayerBody.Head.rotation; if (leftHand.Input.Secondary2AxisInputAxes.x >= 0.01f || leftHand.Input.Secondary2AxisInputAxes.y >= 0.01f || rightHand.Input.Secondary2AxisInputAxes.x >= 0.01f || rightHand.Input.Secondary2AxisInputAxes.y >= 0.01f) { Vector3 forward = _head.transform.forward; forward.y = 0f; ((Component)this).transform.rotation = Quaternion.LookRotation(forward, Vector3.up); } } private void HandFollow(FVRViveHand _hands, FVRViveHand _otherHand, AngryNoob_FingerTracking _fingerT, ref bool _Grip, Animator _handAnimator, Animator _otherHandAnim, Transform[] _handTarget, Transform _handPos) { //IL_2ba5: Unknown result type (might be due to invalid IL or missing references) //IL_2bc9: Unknown result type (might be due to invalid IL or missing references) //IL_2bed: Unknown result type (might be due to invalid IL or missing references) //IL_2c11: Unknown result type (might be due to invalid IL or missing references) //IL_2c35: Unknown result type (might be due to invalid IL or missing references) //IL_2c59: Unknown result type (might be due to invalid IL or missing references) //IL_2c7d: Unknown result type (might be due to invalid IL or missing references) //IL_2ca1: Unknown result type (might be due to invalid IL or missing references) //IL_2cc5: Unknown result type (might be due to invalid IL or missing references) //IL_2ce9: Unknown result type (might be due to invalid IL or missing references) //IL_2d0d: Unknown result type (might be due to invalid IL or missing references) //IL_2d4f: Unknown result type (might be due to invalid IL or missing references) //IL_2d73: Unknown result type (might be due to invalid IL or missing references) //IL_2d97: Unknown result type (might be due to invalid IL or missing references) //IL_2dbb: Unknown result type (might be due to invalid IL or missing references) //IL_2ddf: Unknown result type (might be due to invalid IL or missing references) //IL_2e03: Unknown result type (might be due to invalid IL or missing references) //IL_2e27: Unknown result type (might be due to invalid IL or missing references) //IL_2e4b: Unknown result type (might be due to invalid IL or missing references) //IL_2e6f: Unknown result type (might be due to invalid IL or missing references) //IL_2e93: Unknown result type (might be due to invalid IL or missing references) //IL_2eb7: Unknown result type (might be due to invalid IL or missing references) //IL_3045: Unknown result type (might be due to invalid IL or missing references) //IL_3057: Unknown result type (might be due to invalid IL or missing references) //IL_2ef7: Unknown result type (might be due to invalid IL or missing references) //IL_1a03: Unknown result type (might be due to invalid IL or missing references) //IL_1a27: Unknown result type (might be due to invalid IL or missing references) //IL_1a4b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_2f31: Unknown result type (might be due to invalid IL or missing references) //IL_2f36: Unknown result type (might be due to invalid IL or missing references) //IL_2f3c: Unknown result type (might be due to invalid IL or missing references) //IL_2f41: Unknown result type (might be due to invalid IL or missing references) //IL_2f25: Unknown result type (might be due to invalid IL or missing references) //IL_1a8d: Unknown result type (might be due to invalid IL or missing references) //IL_1ab1: Unknown result type (might be due to invalid IL or missing references) //IL_1ad5: Unknown result type (might be due to invalid IL or missing references) //IL_084b: Unknown result type (might be due to invalid IL or missing references) //IL_086f: Unknown result type (might be due to invalid IL or missing references) //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_08d5: Unknown result type (might be due to invalid IL or missing references) //IL_08f9: Unknown result type (might be due to invalid IL or missing references) //IL_091d: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_1b0c: Unknown result type (might be due to invalid IL or missing references) //IL_1b23: Unknown result type (might be due to invalid IL or missing references) //IL_1618: Unknown result type (might be due to invalid IL or missing references) //IL_163c: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07fc: Unknown result type (might be due to invalid IL or missing references) //IL_071b: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_1b5a: Unknown result type (might be due to invalid IL or missing references) //IL_1b6c: Unknown result type (might be due to invalid IL or missing references) //IL_167e: Unknown result type (might be due to invalid IL or missing references) //IL_16a2: Unknown result type (might be due to invalid IL or missing references) //IL_10bd: Unknown result type (might be due to invalid IL or missing references) //IL_10de: Unknown result type (might be due to invalid IL or missing references) //IL_1058: Unknown result type (might be due to invalid IL or missing references) //IL_1079: Unknown result type (might be due to invalid IL or missing references) //IL_073e: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_1db5: Unknown result type (might be due to invalid IL or missing references) //IL_1dc7: Unknown result type (might be due to invalid IL or missing references) //IL_16da: Unknown result type (might be due to invalid IL or missing references) //IL_16fa: Unknown result type (might be due to invalid IL or missing references) //IL_171a: Unknown result type (might be due to invalid IL or missing references) //IL_173a: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_1bcb: Unknown result type (might be due to invalid IL or missing references) //IL_1bdd: Unknown result type (might be due to invalid IL or missing references) //IL_1c01: Unknown result type (might be due to invalid IL or missing references) //IL_1c25: Unknown result type (might be due to invalid IL or missing references) //IL_1c49: Unknown result type (might be due to invalid IL or missing references) //IL_1c6d: Unknown result type (might be due to invalid IL or missing references) //IL_1c91: Unknown result type (might be due to invalid IL or missing references) //IL_1cb5: Unknown result type (might be due to invalid IL or missing references) //IL_177b: Unknown result type (might be due to invalid IL or missing references) //IL_179f: Unknown result type (might be due to invalid IL or missing references) //IL_17c3: Unknown result type (might be due to invalid IL or missing references) //IL_17e7: Unknown result type (might be due to invalid IL or missing references) //IL_180b: Unknown result type (might be due to invalid IL or missing references) //IL_182f: Unknown result type (might be due to invalid IL or missing references) //IL_1853: Unknown result type (might be due to invalid IL or missing references) //IL_1877: Unknown result type (might be due to invalid IL or missing references) //IL_0789: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_1e09: Unknown result type (might be due to invalid IL or missing references) //IL_1e20: Unknown result type (might be due to invalid IL or missing references) //IL_1cf1: Unknown result type (might be due to invalid IL or missing references) //IL_1d15: Unknown result type (might be due to invalid IL or missing references) //IL_11c3: Unknown result type (might be due to invalid IL or missing references) //IL_11d8: Expected O, but got Unknown //IL_07c6: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_246f: Unknown result type (might be due to invalid IL or missing references) //IL_248b: Unknown result type (might be due to invalid IL or missing references) //IL_1e4f: Unknown result type (might be due to invalid IL or missing references) //IL_1e66: Unknown result type (might be due to invalid IL or missing references) //IL_1d57: Unknown result type (might be due to invalid IL or missing references) //IL_1d7b: Unknown result type (might be due to invalid IL or missing references) //IL_18ae: Unknown result type (might be due to invalid IL or missing references) //IL_18c5: Unknown result type (might be due to invalid IL or missing references) //IL_13e1: Unknown result type (might be due to invalid IL or missing references) //IL_1401: Unknown result type (might be due to invalid IL or missing references) //IL_1421: Unknown result type (might be due to invalid IL or missing references) //IL_1441: Unknown result type (might be due to invalid IL or missing references) //IL_12d3: Unknown result type (might be due to invalid IL or missing references) //IL_12e8: Expected O, but got Unknown //IL_1214: Unknown result type (might be due to invalid IL or missing references) //IL_0e41: Unknown result type (might be due to invalid IL or missing references) //IL_0e67: Unknown result type (might be due to invalid IL or missing references) //IL_0d62: Unknown result type (might be due to invalid IL or missing references) //IL_0d83: Unknown result type (might be due to invalid IL or missing references) //IL_24b2: Unknown result type (might be due to invalid IL or missing references) //IL_24c4: Unknown result type (might be due to invalid IL or missing references) //IL_24e8: Unknown result type (might be due to invalid IL or missing references) //IL_250c: Unknown result type (might be due to invalid IL or missing references) //IL_2530: Unknown result type (might be due to invalid IL or missing references) //IL_2554: Unknown result type (might be due to invalid IL or missing references) //IL_2578: Unknown result type (might be due to invalid IL or missing references) //IL_259c: Unknown result type (might be due to invalid IL or missing references) //IL_1956: Unknown result type (might be due to invalid IL or missing references) //IL_1972: Unknown result type (might be due to invalid IL or missing references) //IL_1901: Unknown result type (might be due to invalid IL or missing references) //IL_1918: Unknown result type (might be due to invalid IL or missing references) //IL_1482: Unknown result type (might be due to invalid IL or missing references) //IL_14a6: Unknown result type (might be due to invalid IL or missing references) //IL_14ca: Unknown result type (might be due to invalid IL or missing references) //IL_14ee: Unknown result type (might be due to invalid IL or missing references) //IL_1512: Unknown result type (might be due to invalid IL or missing references) //IL_1536: Unknown result type (might be due to invalid IL or missing references) //IL_1324: Unknown result type (might be due to invalid IL or missing references) //IL_1256: Unknown result type (might be due to invalid IL or missing references) //IL_0f80: Unknown result type (might be due to invalid IL or missing references) //IL_0fa6: Unknown result type (might be due to invalid IL or missing references) //IL_0ecd: Unknown result type (might be due to invalid IL or missing references) //IL_0ef3: Unknown result type (might be due to invalid IL or missing references) //IL_09ec: Unknown result type (might be due to invalid IL or missing references) //IL_0a01: Expected O, but got Unknown //IL_2aee: Unknown result type (might be due to invalid IL or missing references) //IL_2b00: Unknown result type (might be due to invalid IL or missing references) //IL_25d8: Unknown result type (might be due to invalid IL or missing references) //IL_25fc: Unknown result type (might be due to invalid IL or missing references) //IL_1ea6: Unknown result type (might be due to invalid IL or missing references) //IL_1eb8: Unknown result type (might be due to invalid IL or missing references) //IL_1995: Unknown result type (might be due to invalid IL or missing references) //IL_19a7: Unknown result type (might be due to invalid IL or missing references) //IL_1366: Unknown result type (might be due to invalid IL or missing references) //IL_1298: Unknown result type (might be due to invalid IL or missing references) //IL_1007: Unknown result type (might be due to invalid IL or missing references) //IL_102d: Unknown result type (might be due to invalid IL or missing references) //IL_0b56: Unknown result type (might be due to invalid IL or missing references) //IL_0b6b: Expected O, but got Unknown //IL_0a5b: Unknown result type (might be due to invalid IL or missing references) //IL_263e: Unknown result type (might be due to invalid IL or missing references) //IL_2662: Unknown result type (might be due to invalid IL or missing references) //IL_15d5: Unknown result type (might be due to invalid IL or missing references) //IL_1577: Unknown result type (might be due to invalid IL or missing references) //IL_13a8: Unknown result type (might be due to invalid IL or missing references) //IL_0d2f: Unknown result type (might be due to invalid IL or missing references) //IL_0cc7: Unknown result type (might be due to invalid IL or missing references) //IL_0bc5: Unknown result type (might be due to invalid IL or missing references) //IL_0abb: Unknown result type (might be due to invalid IL or missing references) //IL_26b1: Unknown result type (might be due to invalid IL or missing references) //IL_26c6: Expected O, but got Unknown //IL_22bc: Unknown result type (might be due to invalid IL or missing references) //IL_22d8: Unknown result type (might be due to invalid IL or missing references) //IL_2214: Unknown result type (might be due to invalid IL or missing references) //IL_2230: Unknown result type (might be due to invalid IL or missing references) //IL_15b8: Unknown result type (might be due to invalid IL or missing references) //IL_0d08: Unknown result type (might be due to invalid IL or missing references) //IL_0c25: Unknown result type (might be due to invalid IL or missing references) //IL_0b1b: Unknown result type (might be due to invalid IL or missing references) //IL_27c1: Unknown result type (might be due to invalid IL or missing references) //IL_27d6: Expected O, but got Unknown //IL_2702: Unknown result type (might be due to invalid IL or missing references) //IL_23b5: Unknown result type (might be due to invalid IL or missing references) //IL_23d1: Unknown result type (might be due to invalid IL or missing references) //IL_232f: Unknown result type (might be due to invalid IL or missing references) //IL_234b: Unknown result type (might be due to invalid IL or missing references) //IL_1f61: Unknown result type (might be due to invalid IL or missing references) //IL_1f76: Expected O, but got Unknown //IL_0c85: Unknown result type (might be due to invalid IL or missing references) //IL_292c: Unknown result type (might be due to invalid IL or missing references) //IL_2950: Unknown result type (might be due to invalid IL or missing references) //IL_2974: Unknown result type (might be due to invalid IL or missing references) //IL_2998: Unknown result type (might be due to invalid IL or missing references) //IL_29bc: Unknown result type (might be due to invalid IL or missing references) //IL_29e0: Unknown result type (might be due to invalid IL or missing references) //IL_2a04: Unknown result type (might be due to invalid IL or missing references) //IL_28d8: Unknown result type (might be due to invalid IL or missing references) //IL_2812: Unknown result type (might be due to invalid IL or missing references) //IL_2744: Unknown result type (might be due to invalid IL or missing references) //IL_241e: Unknown result type (might be due to invalid IL or missing references) //IL_243a: Unknown result type (might be due to invalid IL or missing references) //IL_2071: Unknown result type (might be due to invalid IL or missing references) //IL_2086: Expected O, but got Unknown //IL_1fb2: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_2a40: Unknown result type (might be due to invalid IL or missing references) //IL_2a64: Unknown result type (might be due to invalid IL or missing references) //IL_2919: Unknown result type (might be due to invalid IL or missing references) //IL_2854: Unknown result type (might be due to invalid IL or missing references) //IL_2786: Unknown result type (might be due to invalid IL or missing references) //IL_21e6: Unknown result type (might be due to invalid IL or missing references) //IL_2188: Unknown result type (might be due to invalid IL or missing references) //IL_20c2: Unknown result type (might be due to invalid IL or missing references) //IL_1ff4: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_2aa6: Unknown result type (might be due to invalid IL or missing references) //IL_2aca: Unknown result type (might be due to invalid IL or missing references) //IL_2896: Unknown result type (might be due to invalid IL or missing references) //IL_21c9: Unknown result type (might be due to invalid IL or missing references) //IL_2104: Unknown result type (might be due to invalid IL or missing references) //IL_2036: Unknown result type (might be due to invalid IL or missing references) //IL_06ba: Unknown result type (might be due to invalid IL or missing references) //IL_2146: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)_hands.CurrentInteractable == (Object)null && (Object)(object)tempPosL != (Object)null) { Object.Destroy((Object)(object)tempPosL); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)_hands.CurrentInteractable == (Object)null && (Object)(object)tempPosR != (Object)null) { Object.Destroy((Object)(object)tempPosR); } if ((Object)(object)_hands.CurrentInteractable != (Object)null) { _gameObejctOnHands = ((Component)_hands.CurrentInteractable).GetComponent(); _fingerT._handGrap = true; if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch == (Object)null && _hands.m_timeGripButtonHasBeenHeld > 0f && !_Grip) { _Grip = true; } if ((Object)(object)_handAnimator != (Object)null) { HandsAnimationControll(_handAnimator, _otherHandAnim, _handTarget, _hands, _otherHand); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)gun == (Object)null) { gun = ((Component)_hands.CurrentInteractable).GetComponent(); if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride != (Object)null) { gunAngle = ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles; if (((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x >= 310f && ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x <= 360f) { if ((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } } else { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } curved = true; } else if (((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x < 310f && ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x >= 180f) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } curved = false; } } else if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride == (Object)null) { gunAngle = Vector3.zero; } if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch != (Object)null) { gunAngle_Touch = ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles; if (((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x >= 310f && ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x <= 360f) { if ((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } } else { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } curved = true; } else if (((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x < 310f && ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x >= 180f) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } curved = false; } } else if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch == (Object)null) { gunAngle_Touch = Vector3.zero; } } if (((FVRPhysicalObject)((Component)_hands.CurrentInteractable).GetComponent()).IsAltHeld) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip != (Object)null) { if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent() != (Object)null) { if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip == (Object)null) { if (!((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent()).PoseOverride != (Object)null)) { return; } if (verticle) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL == (Object)null) { tempPosL = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).GetComponent().Foregrip.gameObject.gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).GetComponent().Foregrip.gameObject.gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR == (Object)null) { tempPosR = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL != (Object)null) { _handPos.position = tempPosL.transform.position; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR != (Object)null) { _handPos.position = tempPosR.transform.position; } _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } else if (!verticle) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.rotation; } } else { if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip != (Object)null)) { return; } if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment != (Object)null) { if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).Attachment).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment).PoseOverride == (Object)null) { _handPos.position = ((Component)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } } else if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment == (Object)null) { if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).PoseOverride == (Object)null) { _handPos.position = ((Component)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } } } } else { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip == (Object)null) { _handPos.position = ((Component)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent()).PoseOverride).transform.position; _handPos.rotation = ((Component)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent()).PoseOverride).transform.rotation; } } else { if (((FVRPhysicalObject)((Component)_hands.CurrentInteractable).GetComponent()).IsAltHeld) { return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { cleared = false; } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { cleared = true; } if (cleared != laststate) { if (_gripCut) { _gripCut = false; } laststate = cleared; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL == (Object)null) { tempPosL = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR == (Object)null) { tempPosR = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL != (Object)null) { _handPos.position = tempPosL.transform.position; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR != (Object)null) { _handPos.position = tempPosR.transform.position; } _handPos.rotation = ((Component)_gameObejctOnHands).gameObject.transform.rotation; } else { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride_Touch.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride_Touch.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride_Touch.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride_Touch.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); HDMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } } } else { if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() == (Object)null)) { return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (!_gameObejctOnHands.UseGripRotInterp && (Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null && (Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() == (Object)null) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } } else if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { _handPos.position = ((Component)_gameObejctOnHands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 1) { if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { _handPos.position = _gameObejctOnHands.PoseOverride.position; _handPos.rotation = _gameObejctOnHands.PoseOverride.rotation; } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch == (Object)null && (Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if (HandAnimControll(_otherHand) == 2) { if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null)) { return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip == (Object)null && (Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent()).PoseOverride != (Object)null) { if (verticle) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL == (Object)null) { tempPosL = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR == (Object)null) { tempPosR = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL != (Object)null) { _handPos.position = tempPosL.transform.position; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR != (Object)null) { _handPos.position = tempPosR.transform.position; } _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else if (!verticle) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } } if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip != (Object)null)) { return; } if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment != (Object)null) { if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).PoseOverride == (Object)null) { _handPos.position = ((Component)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } } else if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment == (Object)null) { if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).PoseOverride == (Object)null) { _handPos.position = ((Component)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } } } else if (HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else if (HandAnimControll(_otherHand) == 12) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } } else if (HandAnimControll(_otherHand) == 13) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL == (Object)null) { tempPosL = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR == (Object)null) { tempPosR = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL != (Object)null) { _handPos.position = tempPosL.transform.position; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR != (Object)null) { _handPos.position = tempPosR.transform.position; } _handPos.rotation = ((Component)_hands).transform.rotation; HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } return; } if ((Object)(object)_otherHand.CurrentInteractable != (Object)null && (Object)(object)_hands.CurrentInteractable == (Object)null && DoubleHandPistol(_otherHand)) { if ((Object)(object)((Component)_otherHand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { _fingerT._handGrap = true; } return; } cleared = false; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); HDMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); HDMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)gun != (Object)null) { if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride != (Object)null) { ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles = gunAngle; } if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch != (Object)null) { ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles = gunAngle_Touch; } gunAngle = Vector3.zero; gunAngle_Touch = Vector3.zero; gun = null; } _gameObejctOnHands = null; if ((Object)(object)_handAnimator != (Object)null) { _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hands).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handTarget[0]; } else { tarR = _handTarget[0]; } } _fingerT._handGrap = false; _Grip = false; _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } private void HandsAnimationControll(Animator _handAnimator, Animator _otherHandAnim, Transform[] _handFollowPos, FVRViveHand _hand, FVRViveHand _otherHand) { //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_101d: Unknown result type (might be due to invalid IL or missing references) //IL_1022: Unknown result type (might be due to invalid IL or missing references) //IL_104b: Unknown result type (might be due to invalid IL or missing references) //IL_1050: Unknown result type (might be due to invalid IL or missing references) //IL_0d4a: Unknown result type (might be due to invalid IL or missing references) //IL_0d4f: Unknown result type (might be due to invalid IL or missing references) //IL_0d78: Unknown result type (might be due to invalid IL or missing references) //IL_0d7d: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_107e: Unknown result type (might be due to invalid IL or missing references) //IL_1083: Unknown result type (might be due to invalid IL or missing references) //IL_0dab: Unknown result type (might be due to invalid IL or missing references) //IL_0db0: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_10ce: Unknown result type (might be due to invalid IL or missing references) //IL_10d3: Unknown result type (might be due to invalid IL or missing references) //IL_10fc: Unknown result type (might be due to invalid IL or missing references) //IL_1101: Unknown result type (might be due to invalid IL or missing references) //IL_0dfb: Unknown result type (might be due to invalid IL or missing references) //IL_0e00: Unknown result type (might be due to invalid IL or missing references) //IL_0e29: Unknown result type (might be due to invalid IL or missing references) //IL_0e2e: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_112f: Unknown result type (might be due to invalid IL or missing references) //IL_1134: Unknown result type (might be due to invalid IL or missing references) //IL_0e5c: Unknown result type (might be due to invalid IL or missing references) //IL_0e61: Unknown result type (might be due to invalid IL or missing references) switch (HandAnimControll(_otherHand)) { case 1: _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_mag, true); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handFollowPos[2]; } else { tarR = _handFollowPos[2]; } break; case 2: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grab, true); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y / ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z >= 0.75f) { tarL = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y / ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z < 0.75f) { tarL = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 1) { tarL = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 2) { tarL = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { tarL = _handFollowPos[10]; verticle = true; } else { tarL = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip != (Object)null) { tarL = _handFollowPos[11]; verticle = true; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y >= 0.075f) { tarR = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y < 0.075f) { tarR = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 1) { tarR = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 2) { tarR = _handFollowPos[3]; verticle = false; } } else { tarR = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip != (Object)null) { tarR = _handFollowPos[11]; verticle = true; } break; case 3: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); if (curved) { _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_gunCurved, true); } else if (!curved) { _handAnimator.SetBool(_gun, true); _handAnimator.SetBool(_gunCurved, false); } _handAnimator.SetBool(_trigger, HandGunFier(_hand)); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handFollowPos[1]; } else { tarR = _handFollowPos[1]; } break; case 4: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_bolt, true); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handFollowPos[4]; } else { tarR = _handFollowPos[4]; } break; case 5: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_slide, true); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handFollowPos[5]; } else { tarR = _handFollowPos[5]; } break; case 6: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, true); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handFollowPos[2]; } else { tarR = _handFollowPos[2]; } break; case 7: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_grenade, true); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handFollowPos[7]; } else { tarR = _handFollowPos[7]; } break; case 8: _otherHandAnim.SetBool(_ammo, false); _handAnimator.SetBool(_trigger, HandGunFier(_hand)); _otherHandAnim.SetBool(_trigger, false); _otherHandAnim.SetBool(_grab, false); _otherHandAnim.SetBool(_gun, false); _otherHandAnim.SetBool(_slide, false); _otherHandAnim.SetBool(_bolt, false); _otherHandAnim.SetBool(_mag, false); _otherHandAnim.SetBool(_grenade, false); _otherHandAnim.SetBool(_HGCB, true); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarR = _handFollowPos[8]; } else { tarL = _handFollowPos[8]; } break; case 9: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_mag, true); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handFollowPos[9]; } else { tarR = _handFollowPos[9]; } break; case 10: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grab, true); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y >= 0.075f) { tarL = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y < 0.075f) { tarL = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 1) { tarL = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 2) { tarL = _handFollowPos[3]; verticle = false; } } else { tarL = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip != (Object)null) { tarL = _handFollowPos[11]; verticle = true; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y >= 0.075f) { tarR = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y < 0.075f) { tarR = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 1) { tarR = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 2) { tarR = _handFollowPos[3]; verticle = false; } } else { tarR = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip != (Object)null) { tarR = _handFollowPos[11]; verticle = true; } break; case 11: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); if (curved) { _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_gunCurved, true); } else if (!curved) { _handAnimator.SetBool(_gun, true); _handAnimator.SetBool(_gunCurved, false); } _handAnimator.SetBool(_trigger, HandGunFier(_hand)); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handFollowPos[12]; } else { tarR = _handFollowPos[12]; } break; case 12: _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_mag, true); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handFollowPos[1]; } else { tarR = _handFollowPos[1]; } break; case 13: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_bolt, true); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handFollowPos[4]; } else { tarR = _handFollowPos[4]; } break; default: _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_gun, true); _handAnimator.SetBool(_gunCurved, false); if (((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { tarL = _handFollowPos[1]; } else { tarR = _handFollowPos[1]; } break; } } private int HandAnimControll(FVRViveHand _otherHand) { int result = 1; if (typeof(FVRFireArm).IsAssignableFrom(((object)_gameObejctOnHands).GetType())) { if (((FVRPhysicalObject)((Component)_gameObejctOnHands).GetComponent()).IsAltHeld && (Object)(object)((Component)_gameObejctOnHands).GetComponent().Foregrip != (Object)null) { result = 10; } else if (!((FVRPhysicalObject)((Component)_gameObejctOnHands).GetComponent()).IsAltHeld || (Object)(object)((Component)_gameObejctOnHands).GetComponent().Foregrip == (Object)null) { result = ((!((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null)) ? 11 : 11); } } if (typeof(FVRFireArm).IsAssignableFrom(((object)_gameObejctOnHands).GetType()) && DoubleHandPistol(_otherHand) && (Object)(object)_otherHand.CurrentInteractable == (Object)null) { result = 8; } if ((object)typeof(FVRFireArmMagazine) == ((object)_gameObejctOnHands).GetType()) { result = 1; } if ((object)typeof(ClosedBoltHandle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(ClosedBolt) == ((object)_gameObejctOnHands).GetType() || (object)typeof(BoltActionRifle_Handle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(OpenBoltChargingHandle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(OpenBoltReceiverBolt) == ((object)_gameObejctOnHands).GetType()) { result = 4; } if ((object)typeof(FVRAlternateGrip) == ((object)_gameObejctOnHands).GetType() || (object)typeof(TubeFedShotgunHandle) == ((object)_gameObejctOnHands).GetType()) { result = 2; } if ((object)typeof(FVRFireArmRound) == ((object)_gameObejctOnHands).GetType()) { result = 6; } if ((object)typeof(HandgunSlide) == ((object)_gameObejctOnHands).GetType()) { result = 5; } if ((object)typeof(PinnedGrenade) == ((object)_gameObejctOnHands).GetType() || (object)typeof(FVRCappedGrenade) == ((object)_gameObejctOnHands).GetType()) { result = 7; } if ((object)typeof(FVRFireArmTopCover) == ((object)_gameObejctOnHands).GetType()) { result = 9; } if ((object)typeof(FVRHandGrabPoint) == ((object)_gameObejctOnHands).GetType()) { result = 12; } if ((object)typeof(CarlGustafLatch) == ((object)_gameObejctOnHands).GetType()) { result = 13; } return result; } private bool HandGunFier(FVRViveHand _hand) { if (_hand.Input.TriggerFloat >= 0.7f) { _fier = true; } else { _fier = false; } return _fier; } private bool DoubleHandPistol(FVRViveHand _otherHand) { if (HandsDistance() <= 0.15f && (Object)(object)_otherHand.CurrentInteractable == (Object)null && _otherHand.Input.TriggerDown && (Object)(object)_gameObejctOnHands != (Object)null && (Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { _gripCut = !_gripCut; } if (HandsDistance() > 0.175f) { _gripCut = false; } return _gripCut; } private float HandsDistance() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return Vector3.Distance(GM.CurrentMovementManager.LeftHand.position, GM.CurrentMovementManager.RightHand.position); } private void PlayerAnimC() { playerAnime.SetFloat(AnimatorControllerName_X, leftHand.Input.Secondary2AxisInputAxes.x); playerAnime.SetFloat(AnimatorControllerName_Y, leftHand.Input.Secondary2AxisInputAxes.y); } } public class HPRold : MonoBehaviour { [Header("需要跟随VR设备的位置")] [Tooltip("(可选)头部的VR头显跟随与旋转位置")] public GameObject _head; public GameObject _neck; [Tooltip("双手跟随VR手柄的位置")] public Transform _ZuoShouWeiZhi; [Tooltip("双手跟随VR手柄的位置")] public Transform _YouShouWeiZhi; [Tooltip("(可选)VRIk脚本, 用来替换手部IK跟随位置")] public VRIK _VRIKCon; [Tooltip("(如果VRIK 为空 此处可以不添加)手部IK跟踪位置: 0 = VR手柄跟踪位, 1 = 武器抓握, 2 = 弹匣抓握, 3 = 护木抓握, 4 = 枪栓抓握,5 = 手枪滑套抓握, 6 = 子弹抓握, 7 = 手雷抓握, 8 = 手枪战术握法, 9 = 机枪机匣盖抓握位置, 10 = 护木抓握主手, 11=武器抓握扳机微调")] public Transform[] _leftHandTarget; [Tooltip("(如果VRIK 为空 此处可以不添加)手部IK跟踪位置: 0 = VR手柄跟踪位, 1 = 武器抓握, 2 = 弹匣抓握, 3 = 护木抓握, 4 = 枪栓抓握,5 = 手枪滑套抓握, 6 = 子弹抓握, 7 = 手雷抓握, 8 = 手枪战术握法, 9 = 机枪机匣盖抓握位置, 10 = 护木抓握主手, 11=武器抓握扳机微调")] public Transform[] _rightHandTarget; [Header("(可选)移动动画控制器")] public Animator playerAnime; [Header("(可选)左右手动画控制器")] public Animator leftHandAT; public Animator rightHandAT; [Header("移动动画float过渡条件名称")] public string AnimatorControllerName_X; public string AnimatorControllerName_Y; [Header("(如果左右手动画控制器为空 此处可以为空)动画bool过渡条件名称")] public string _gun; public string _mag; public string _grab; public string _bolt; public string _slide; public string _ammo; public string _trigger; public string _grenade; public string _HGCB; public string _gunCurved; public string _revolverSpin; [Header("双手手指动画开关控制")] public AngryNoob_FingerTracking _leftFingerTraking; public AngryNoob_FingerTracking _ringtFingerTraking; private GameObject _player; private FVRViveHand leftHand; private FVRViveHand rightHand; private FVRInteractiveObject _gameObejctOnHands; private bool _leftContinuousGrip = false; private bool _rightContinuousGrip = false; private bool _gripCut = false; private bool _fier; [NonSerialized] private FVRFireArm gun; [NonSerialized] private Vector3 gunAngle; [NonSerialized] private Vector3 gunAngle_Touch; private bool curved; private bool verticle; public GameObject HPL; public GameObject CGL; public GameObject DML; public GameObject HDML; public GameObject HPR; public GameObject CGR; public GameObject DMR; public GameObject HDMR; public bool cleared = false; public bool laststate = true; public GameObject tempPosL; public GameObject tempPosR; public float cddet = 1f; public GameObject SpinnL; public GameObject SpinnR; public bool SpinL; public bool SpinR; public Transform IndexFL; public Transform IndexFR; private void Awake() { _player = ((Component)GM.CurrentPlayerBody).gameObject; } private void Start() { leftHand = GM.CurrentMovementManager.Hands[0]; rightHand = GM.CurrentMovementManager.Hands[1]; } private void FixedUpdate() { cddet -= Time.deltaTime; if (cddet <= 0f) { cddet = 1f; if ((Object)(object)SpinnL == (Object)null) { SpinnL = GameObject.Find("SpinnLH(Clone)"); } if ((Object)(object)SpinnR == (Object)null) { SpinnR = GameObject.Find("SpinnRH(Clone)"); } } } private void Update() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) if (SpinL) { ((Behaviour)_leftFingerTraking).enabled = false; } else { ((Behaviour)_leftFingerTraking).enabled = true; } if ((Object)(object)SpinnL != (Object)null) { if (SpinL) { SpinnL.transform.position = IndexFL.position; SpinnL.transform.eulerAngles = IndexFL.eulerAngles; } else { SpinnL.transform.localPosition = Vector3.zero; SpinnL.transform.localEulerAngles = Vector3.zero; } if ((Object)(object)SpinnL.GetComponent() != (Object)null) { if (SpinnL.GetComponent().angleLimitLeft > 100f && SpinnL.GetComponent().angleLimitRight > 100f) { SpinL = true; } if (SpinnL.GetComponent().angleLimitLeft <= 100f && SpinnL.GetComponent().angleLimitRight < 100f) { SpinL = false; } } else { SpinL = false; } } else { SpinL = false; } if (SpinR) { ((Behaviour)_ringtFingerTraking).enabled = false; } else { ((Behaviour)_ringtFingerTraking).enabled = true; } if ((Object)(object)SpinnR != (Object)null) { if (SpinR) { SpinnR.transform.position = IndexFR.position; SpinnR.transform.eulerAngles = IndexFR.eulerAngles; } else { SpinnR.transform.localPosition = Vector3.zero; SpinnR.transform.localEulerAngles = Vector3.zero; } if ((Object)(object)SpinnR.GetComponent() != (Object)null) { if (SpinnR.GetComponent().angleLimitLeft > 100f && SpinnR.GetComponent().angleLimitRight > 100f) { SpinR = true; } if (SpinnR.GetComponent().angleLimitLeft <= 100f && SpinnR.GetComponent().angleLimitRight < 100f) { SpinR = false; } } else { SpinR = false; } } else { SpinR = false; } HandFollow(leftHand, rightHand, _leftFingerTraking, ref _leftContinuousGrip, leftHandAT, rightHandAT, _leftHandTarget, _ZuoShouWeiZhi); HandFollow(rightHand, leftHand, _ringtFingerTraking, ref _rightContinuousGrip, rightHandAT, leftHandAT, _rightHandTarget, _YouShouWeiZhi); if ((Object)(object)_head != (Object)null && (Object)(object)_neck != (Object)null) { HeadFollowPlayerBody(); } if ((Object)(object)playerAnime != (Object)null) { PlayerAnimC(); } } private void HeadFollowPlayerBody() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) _head.transform.position = GM.CurrentPlayerBody.Head.position; _neck.transform.rotation = GM.CurrentPlayerBody.Head.rotation; if (leftHand.Input.Secondary2AxisInputAxes.x >= 0.01f || leftHand.Input.Secondary2AxisInputAxes.y >= 0.01f || rightHand.Input.Secondary2AxisInputAxes.x >= 0.01f || rightHand.Input.Secondary2AxisInputAxes.y >= 0.01f) { Vector3 forward = _head.transform.forward; forward.y = 0f; ((Component)this).transform.rotation = Quaternion.LookRotation(forward, Vector3.up); } } private void HandFollow(FVRViveHand _hands, FVRViveHand _otherHand, AngryNoob_FingerTracking _fingerT, ref bool _Grip, Animator _handAnimator, Animator _otherHandAnim, Transform[] _handTarget, Transform _handPos) { //IL_2c9f: Unknown result type (might be due to invalid IL or missing references) //IL_2cc3: Unknown result type (might be due to invalid IL or missing references) //IL_2ce7: Unknown result type (might be due to invalid IL or missing references) //IL_2d0b: Unknown result type (might be due to invalid IL or missing references) //IL_2d2f: Unknown result type (might be due to invalid IL or missing references) //IL_2d53: Unknown result type (might be due to invalid IL or missing references) //IL_2d77: Unknown result type (might be due to invalid IL or missing references) //IL_2d9b: Unknown result type (might be due to invalid IL or missing references) //IL_2dbf: Unknown result type (might be due to invalid IL or missing references) //IL_2de3: Unknown result type (might be due to invalid IL or missing references) //IL_2e07: Unknown result type (might be due to invalid IL or missing references) //IL_2e49: Unknown result type (might be due to invalid IL or missing references) //IL_2e6d: Unknown result type (might be due to invalid IL or missing references) //IL_2e91: Unknown result type (might be due to invalid IL or missing references) //IL_2eb5: Unknown result type (might be due to invalid IL or missing references) //IL_2ed9: Unknown result type (might be due to invalid IL or missing references) //IL_2efd: Unknown result type (might be due to invalid IL or missing references) //IL_2f21: Unknown result type (might be due to invalid IL or missing references) //IL_2f45: Unknown result type (might be due to invalid IL or missing references) //IL_2f69: Unknown result type (might be due to invalid IL or missing references) //IL_2f8d: Unknown result type (might be due to invalid IL or missing references) //IL_2fb1: Unknown result type (might be due to invalid IL or missing references) //IL_316e: Unknown result type (might be due to invalid IL or missing references) //IL_3180: Unknown result type (might be due to invalid IL or missing references) //IL_2ff1: Unknown result type (might be due to invalid IL or missing references) //IL_1afd: Unknown result type (might be due to invalid IL or missing references) //IL_1b21: Unknown result type (might be due to invalid IL or missing references) //IL_1b45: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_302b: Unknown result type (might be due to invalid IL or missing references) //IL_3030: Unknown result type (might be due to invalid IL or missing references) //IL_3036: Unknown result type (might be due to invalid IL or missing references) //IL_303b: Unknown result type (might be due to invalid IL or missing references) //IL_301f: Unknown result type (might be due to invalid IL or missing references) //IL_1b87: Unknown result type (might be due to invalid IL or missing references) //IL_1bab: Unknown result type (might be due to invalid IL or missing references) //IL_1bcf: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Unknown result type (might be due to invalid IL or missing references) //IL_0969: Unknown result type (might be due to invalid IL or missing references) //IL_098d: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_09cf: Unknown result type (might be due to invalid IL or missing references) //IL_09f3: Unknown result type (might be due to invalid IL or missing references) //IL_0a17: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_1c06: Unknown result type (might be due to invalid IL or missing references) //IL_1c1d: Unknown result type (might be due to invalid IL or missing references) //IL_1712: Unknown result type (might be due to invalid IL or missing references) //IL_1736: Unknown result type (might be due to invalid IL or missing references) //IL_08f1: Unknown result type (might be due to invalid IL or missing references) //IL_08f6: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_081a: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Unknown result type (might be due to invalid IL or missing references) //IL_1c54: Unknown result type (might be due to invalid IL or missing references) //IL_1c66: Unknown result type (might be due to invalid IL or missing references) //IL_1778: Unknown result type (might be due to invalid IL or missing references) //IL_179c: Unknown result type (might be due to invalid IL or missing references) //IL_11b7: Unknown result type (might be due to invalid IL or missing references) //IL_11d8: Unknown result type (might be due to invalid IL or missing references) //IL_1152: Unknown result type (might be due to invalid IL or missing references) //IL_1173: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_083d: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_1eaf: Unknown result type (might be due to invalid IL or missing references) //IL_1ec1: Unknown result type (might be due to invalid IL or missing references) //IL_17d4: Unknown result type (might be due to invalid IL or missing references) //IL_17f4: Unknown result type (might be due to invalid IL or missing references) //IL_1814: Unknown result type (might be due to invalid IL or missing references) //IL_1834: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_1cc5: Unknown result type (might be due to invalid IL or missing references) //IL_1cd7: Unknown result type (might be due to invalid IL or missing references) //IL_1cfb: Unknown result type (might be due to invalid IL or missing references) //IL_1d1f: Unknown result type (might be due to invalid IL or missing references) //IL_1d43: Unknown result type (might be due to invalid IL or missing references) //IL_1d67: Unknown result type (might be due to invalid IL or missing references) //IL_1d8b: Unknown result type (might be due to invalid IL or missing references) //IL_1daf: Unknown result type (might be due to invalid IL or missing references) //IL_1875: Unknown result type (might be due to invalid IL or missing references) //IL_1899: Unknown result type (might be due to invalid IL or missing references) //IL_18bd: Unknown result type (might be due to invalid IL or missing references) //IL_18e1: Unknown result type (might be due to invalid IL or missing references) //IL_1905: Unknown result type (might be due to invalid IL or missing references) //IL_1929: Unknown result type (might be due to invalid IL or missing references) //IL_194d: Unknown result type (might be due to invalid IL or missing references) //IL_1971: Unknown result type (might be due to invalid IL or missing references) //IL_0883: Unknown result type (might be due to invalid IL or missing references) //IL_0733: Unknown result type (might be due to invalid IL or missing references) //IL_1f03: Unknown result type (might be due to invalid IL or missing references) //IL_1f1a: Unknown result type (might be due to invalid IL or missing references) //IL_1deb: Unknown result type (might be due to invalid IL or missing references) //IL_1e0f: Unknown result type (might be due to invalid IL or missing references) //IL_12bd: Unknown result type (might be due to invalid IL or missing references) //IL_12d2: Expected O, but got Unknown //IL_08c0: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Unknown result type (might be due to invalid IL or missing references) //IL_2569: Unknown result type (might be due to invalid IL or missing references) //IL_2585: Unknown result type (might be due to invalid IL or missing references) //IL_1f49: Unknown result type (might be due to invalid IL or missing references) //IL_1f60: Unknown result type (might be due to invalid IL or missing references) //IL_1e51: Unknown result type (might be due to invalid IL or missing references) //IL_1e75: Unknown result type (might be due to invalid IL or missing references) //IL_19a8: Unknown result type (might be due to invalid IL or missing references) //IL_19bf: Unknown result type (might be due to invalid IL or missing references) //IL_14db: Unknown result type (might be due to invalid IL or missing references) //IL_14fb: Unknown result type (might be due to invalid IL or missing references) //IL_151b: Unknown result type (might be due to invalid IL or missing references) //IL_153b: Unknown result type (might be due to invalid IL or missing references) //IL_13cd: Unknown result type (might be due to invalid IL or missing references) //IL_13e2: Expected O, but got Unknown //IL_130e: Unknown result type (might be due to invalid IL or missing references) //IL_0f3b: Unknown result type (might be due to invalid IL or missing references) //IL_0f61: Unknown result type (might be due to invalid IL or missing references) //IL_0e5c: Unknown result type (might be due to invalid IL or missing references) //IL_0e7d: Unknown result type (might be due to invalid IL or missing references) //IL_25ac: Unknown result type (might be due to invalid IL or missing references) //IL_25be: Unknown result type (might be due to invalid IL or missing references) //IL_25e2: Unknown result type (might be due to invalid IL or missing references) //IL_2606: Unknown result type (might be due to invalid IL or missing references) //IL_262a: Unknown result type (might be due to invalid IL or missing references) //IL_264e: Unknown result type (might be due to invalid IL or missing references) //IL_2672: Unknown result type (might be due to invalid IL or missing references) //IL_2696: Unknown result type (might be due to invalid IL or missing references) //IL_1a50: Unknown result type (might be due to invalid IL or missing references) //IL_1a6c: Unknown result type (might be due to invalid IL or missing references) //IL_19fb: Unknown result type (might be due to invalid IL or missing references) //IL_1a12: Unknown result type (might be due to invalid IL or missing references) //IL_157c: Unknown result type (might be due to invalid IL or missing references) //IL_15a0: Unknown result type (might be due to invalid IL or missing references) //IL_15c4: Unknown result type (might be due to invalid IL or missing references) //IL_15e8: Unknown result type (might be due to invalid IL or missing references) //IL_160c: Unknown result type (might be due to invalid IL or missing references) //IL_1630: Unknown result type (might be due to invalid IL or missing references) //IL_141e: Unknown result type (might be due to invalid IL or missing references) //IL_1350: Unknown result type (might be due to invalid IL or missing references) //IL_107a: Unknown result type (might be due to invalid IL or missing references) //IL_10a0: Unknown result type (might be due to invalid IL or missing references) //IL_0fc7: Unknown result type (might be due to invalid IL or missing references) //IL_0fed: Unknown result type (might be due to invalid IL or missing references) //IL_0ae6: Unknown result type (might be due to invalid IL or missing references) //IL_0afb: Expected O, but got Unknown //IL_2be8: Unknown result type (might be due to invalid IL or missing references) //IL_2bfa: Unknown result type (might be due to invalid IL or missing references) //IL_26d2: Unknown result type (might be due to invalid IL or missing references) //IL_26f6: Unknown result type (might be due to invalid IL or missing references) //IL_1fa0: Unknown result type (might be due to invalid IL or missing references) //IL_1fb2: Unknown result type (might be due to invalid IL or missing references) //IL_1a8f: Unknown result type (might be due to invalid IL or missing references) //IL_1aa1: Unknown result type (might be due to invalid IL or missing references) //IL_1460: Unknown result type (might be due to invalid IL or missing references) //IL_1392: Unknown result type (might be due to invalid IL or missing references) //IL_1101: Unknown result type (might be due to invalid IL or missing references) //IL_1127: Unknown result type (might be due to invalid IL or missing references) //IL_0c50: Unknown result type (might be due to invalid IL or missing references) //IL_0c65: Expected O, but got Unknown //IL_0b55: Unknown result type (might be due to invalid IL or missing references) //IL_2738: Unknown result type (might be due to invalid IL or missing references) //IL_275c: Unknown result type (might be due to invalid IL or missing references) //IL_16cf: Unknown result type (might be due to invalid IL or missing references) //IL_1671: Unknown result type (might be due to invalid IL or missing references) //IL_14a2: Unknown result type (might be due to invalid IL or missing references) //IL_0e29: Unknown result type (might be due to invalid IL or missing references) //IL_0dc1: Unknown result type (might be due to invalid IL or missing references) //IL_0cbf: Unknown result type (might be due to invalid IL or missing references) //IL_0bb5: Unknown result type (might be due to invalid IL or missing references) //IL_27ab: Unknown result type (might be due to invalid IL or missing references) //IL_27c0: Expected O, but got Unknown //IL_23b6: Unknown result type (might be due to invalid IL or missing references) //IL_23d2: Unknown result type (might be due to invalid IL or missing references) //IL_230e: Unknown result type (might be due to invalid IL or missing references) //IL_232a: Unknown result type (might be due to invalid IL or missing references) //IL_16b2: Unknown result type (might be due to invalid IL or missing references) //IL_0e02: Unknown result type (might be due to invalid IL or missing references) //IL_0d1f: Unknown result type (might be due to invalid IL or missing references) //IL_0c15: Unknown result type (might be due to invalid IL or missing references) //IL_28bb: Unknown result type (might be due to invalid IL or missing references) //IL_28d0: Expected O, but got Unknown //IL_27fc: Unknown result type (might be due to invalid IL or missing references) //IL_24af: Unknown result type (might be due to invalid IL or missing references) //IL_24cb: Unknown result type (might be due to invalid IL or missing references) //IL_2429: Unknown result type (might be due to invalid IL or missing references) //IL_2445: Unknown result type (might be due to invalid IL or missing references) //IL_205b: Unknown result type (might be due to invalid IL or missing references) //IL_2070: Expected O, but got Unknown //IL_0d7f: Unknown result type (might be due to invalid IL or missing references) //IL_2a26: Unknown result type (might be due to invalid IL or missing references) //IL_2a4a: Unknown result type (might be due to invalid IL or missing references) //IL_2a6e: Unknown result type (might be due to invalid IL or missing references) //IL_2a92: Unknown result type (might be due to invalid IL or missing references) //IL_2ab6: Unknown result type (might be due to invalid IL or missing references) //IL_2ada: Unknown result type (might be due to invalid IL or missing references) //IL_2afe: Unknown result type (might be due to invalid IL or missing references) //IL_29d2: Unknown result type (might be due to invalid IL or missing references) //IL_290c: Unknown result type (might be due to invalid IL or missing references) //IL_283e: Unknown result type (might be due to invalid IL or missing references) //IL_2518: Unknown result type (might be due to invalid IL or missing references) //IL_2534: Unknown result type (might be due to invalid IL or missing references) //IL_216b: Unknown result type (might be due to invalid IL or missing references) //IL_2180: Expected O, but got Unknown //IL_20ac: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_2b3a: Unknown result type (might be due to invalid IL or missing references) //IL_2b5e: Unknown result type (might be due to invalid IL or missing references) //IL_2a13: Unknown result type (might be due to invalid IL or missing references) //IL_294e: Unknown result type (might be due to invalid IL or missing references) //IL_2880: Unknown result type (might be due to invalid IL or missing references) //IL_22e0: Unknown result type (might be due to invalid IL or missing references) //IL_2282: Unknown result type (might be due to invalid IL or missing references) //IL_21bc: Unknown result type (might be due to invalid IL or missing references) //IL_20ee: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_2ba0: Unknown result type (might be due to invalid IL or missing references) //IL_2bc4: Unknown result type (might be due to invalid IL or missing references) //IL_2990: Unknown result type (might be due to invalid IL or missing references) //IL_22c3: Unknown result type (might be due to invalid IL or missing references) //IL_21fe: Unknown result type (might be due to invalid IL or missing references) //IL_2130: Unknown result type (might be due to invalid IL or missing references) //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_2240: Unknown result type (might be due to invalid IL or missing references) //IL_07f1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)_hands.CurrentInteractable == (Object)null && (Object)(object)tempPosL != (Object)null) { Object.Destroy((Object)(object)tempPosL); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)_hands.CurrentInteractable == (Object)null && (Object)(object)tempPosR != (Object)null) { Object.Destroy((Object)(object)tempPosR); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { if ((Object)(object)_hands.m_currentInteractable == (Object)null) { if (SpinL) { leftHandAT.SetBool(_revolverSpin, true); } else { leftHandAT.SetBool(_revolverSpin, false); } } else { leftHandAT.SetBool(_revolverSpin, false); } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { if ((Object)(object)_hands.m_currentInteractable == (Object)null) { if (SpinR) { rightHandAT.SetBool(_revolverSpin, true); } else { rightHandAT.SetBool(_revolverSpin, false); } } else { rightHandAT.SetBool(_revolverSpin, false); } } if ((Object)(object)_hands.CurrentInteractable != (Object)null) { _gameObejctOnHands = ((Component)_hands.CurrentInteractable).GetComponent(); _fingerT._handGrap = true; if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch == (Object)null && _hands.m_timeGripButtonHasBeenHeld > 0f && !_Grip) { _Grip = true; } if ((Object)(object)_handAnimator != (Object)null) { HandsAnimationControll(_handAnimator, _otherHandAnim, _handTarget, _hands, _otherHand); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)gun == (Object)null) { gun = ((Component)_hands.CurrentInteractable).GetComponent(); if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride != (Object)null) { gunAngle = ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles; if (((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x >= 310f && ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x <= 360f) { if ((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } } else { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } curved = true; } else if (((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x < 310f && ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x >= 180f) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } curved = false; } } else if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride == (Object)null) { gunAngle = Vector3.zero; } if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch != (Object)null) { gunAngle_Touch = ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles; if (((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x >= 310f && ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x <= 360f) { if ((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } } else { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } curved = true; } else if (((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x < 310f && ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x >= 180f) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } curved = false; } } else if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch == (Object)null) { gunAngle_Touch = Vector3.zero; } } if (((FVRPhysicalObject)((Component)_hands.CurrentInteractable).GetComponent()).IsAltHeld) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip != (Object)null) { if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent() != (Object)null) { if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip == (Object)null) { if (!((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent()).PoseOverride != (Object)null)) { return; } if (verticle) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL == (Object)null) { tempPosL = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).GetComponent().Foregrip.gameObject.gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).GetComponent().Foregrip.gameObject.gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR == (Object)null) { tempPosR = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().Foregrip.gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL != (Object)null) { _handPos.position = tempPosL.transform.position; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR != (Object)null) { _handPos.position = tempPosR.transform.position; } _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } else if (!verticle) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.rotation; } } else { if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip != (Object)null)) { return; } if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment != (Object)null) { if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).Attachment).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment).PoseOverride == (Object)null) { _handPos.position = ((Component)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } } else if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment == (Object)null) { if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).PoseOverride == (Object)null) { _handPos.position = ((Component)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } } } } else { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip == (Object)null) { _handPos.position = ((Component)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent()).PoseOverride).transform.position; _handPos.rotation = ((Component)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent()).PoseOverride).transform.rotation; } } else { if (((FVRPhysicalObject)((Component)_hands.CurrentInteractable).GetComponent()).IsAltHeld) { return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { cleared = false; } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { cleared = true; } if (cleared != laststate) { if (_gripCut) { _gripCut = false; } laststate = cleared; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL == (Object)null) { tempPosL = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR == (Object)null) { tempPosR = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL != (Object)null) { _handPos.position = tempPosL.transform.position; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR != (Object)null) { _handPos.position = tempPosR.transform.position; } _handPos.rotation = ((Component)_gameObejctOnHands).gameObject.transform.rotation; } else { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride_Touch.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride_Touch.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride_Touch.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride_Touch.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); HDMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } } } else { if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() == (Object)null)) { return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (!_gameObejctOnHands.UseGripRotInterp && (Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null && (Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() == (Object)null) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } } else if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { _handPos.position = ((Component)_gameObejctOnHands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 1) { if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { _handPos.position = _gameObejctOnHands.PoseOverride.position; _handPos.rotation = _gameObejctOnHands.PoseOverride.rotation; } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch == (Object)null && (Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if (HandAnimControll(_otherHand) == 2) { if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null)) { return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip == (Object)null && (Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent()).PoseOverride != (Object)null) { if (verticle) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL == (Object)null) { tempPosL = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR == (Object)null) { tempPosR = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL != (Object)null) { _handPos.position = tempPosL.transform.position; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR != (Object)null) { _handPos.position = tempPosR.transform.position; } _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else if (!verticle) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } } if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip != (Object)null)) { return; } if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment != (Object)null) { if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).PoseOverride == (Object)null) { _handPos.position = ((Component)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } } else if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment == (Object)null) { if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).PoseOverride == (Object)null) { _handPos.position = ((Component)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } } } else if (HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else if (HandAnimControll(_otherHand) == 12) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } } else if (HandAnimControll(_otherHand) == 13) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL == (Object)null) { tempPosL = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosL.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR == (Object)null) { tempPosR = Object.Instantiate(new GameObject("TempPos"), ((Component)_gameObejctOnHands).transform); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { tempPosR.transform.localPosition = ((Component)_gameObejctOnHands).gameObject.GetComponent().center; } } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0] && (Object)(object)tempPosL != (Object)null) { _handPos.position = tempPosL.transform.position; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1] && (Object)(object)tempPosR != (Object)null) { _handPos.position = tempPosR.transform.position; } _handPos.rotation = ((Component)_hands).transform.rotation; HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } return; } if ((Object)(object)_otherHand.CurrentInteractable != (Object)null && (Object)(object)_hands.CurrentInteractable == (Object)null && DoubleHandPistol(_otherHand)) { if ((Object)(object)((Component)_otherHand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { _fingerT._handGrap = true; } return; } cleared = false; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); HDMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); HDMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)gun != (Object)null) { if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride != (Object)null) { ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles = gunAngle; } if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch != (Object)null) { ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles = gunAngle_Touch; } gunAngle = Vector3.zero; gunAngle_Touch = Vector3.zero; gun = null; } _gameObejctOnHands = null; if ((Object)(object)_handAnimator != (Object)null) { _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hands).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handTarget[0]; } else { _VRIKCon.solver.rightArm.target = _handTarget[0]; } } _fingerT._handGrap = false; _Grip = false; _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } private void HandsAnimationControll(Animator _handAnimator, Animator _otherHandAnim, Transform[] _handFollowPos, FVRViveHand _hand, FVRViveHand _otherHand) { //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_1356: Unknown result type (might be due to invalid IL or missing references) //IL_135b: Unknown result type (might be due to invalid IL or missing references) //IL_1384: Unknown result type (might be due to invalid IL or missing references) //IL_1389: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_13b7: Unknown result type (might be due to invalid IL or missing references) //IL_13bc: Unknown result type (might be due to invalid IL or missing references) //IL_1029: Unknown result type (might be due to invalid IL or missing references) //IL_102e: Unknown result type (might be due to invalid IL or missing references) //IL_1057: Unknown result type (might be due to invalid IL or missing references) //IL_105c: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_1416: Unknown result type (might be due to invalid IL or missing references) //IL_141b: Unknown result type (might be due to invalid IL or missing references) //IL_1444: Unknown result type (might be due to invalid IL or missing references) //IL_1449: Unknown result type (might be due to invalid IL or missing references) //IL_108a: Unknown result type (might be due to invalid IL or missing references) //IL_108f: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_1477: Unknown result type (might be due to invalid IL or missing references) //IL_147c: Unknown result type (might be due to invalid IL or missing references) //IL_10e9: Unknown result type (might be due to invalid IL or missing references) //IL_10ee: Unknown result type (might be due to invalid IL or missing references) //IL_1117: Unknown result type (might be due to invalid IL or missing references) //IL_111c: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_114a: Unknown result type (might be due to invalid IL or missing references) //IL_114f: Unknown result type (might be due to invalid IL or missing references) switch (HandAnimControll(_otherHand)) { case 1: _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_mag, true); _handAnimator.SetBool(_gunCurved, false); _handAnimator.SetBool(_revolverSpin, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[2]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[2]; } break; case 2: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grab, true); _handAnimator.SetBool(_gunCurved, false); _handAnimator.SetBool(_revolverSpin, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y / ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z >= 0.75f) { _VRIKCon.solver.leftArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y / ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z < 0.75f) { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 1) { _VRIKCon.solver.leftArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 2) { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { _VRIKCon.solver.leftArm.target = _handFollowPos[10]; verticle = true; } else { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip != (Object)null) { _VRIKCon.solver.leftArm.target = _handFollowPos[11]; verticle = true; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y >= 0.075f) { _VRIKCon.solver.rightArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y < 0.075f) { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 1) { _VRIKCon.solver.rightArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 2) { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip != (Object)null) { _VRIKCon.solver.rightArm.target = _handFollowPos[11]; verticle = true; } break; case 3: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_revolverSpin, false); if (curved) { _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_gunCurved, true); } else if (!curved) { _handAnimator.SetBool(_gun, true); _handAnimator.SetBool(_gunCurved, false); } _handAnimator.SetBool(_trigger, HandGunFier(_hand)); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[1]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[1]; } break; case 4: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_bolt, true); _handAnimator.SetBool(_gunCurved, false); _handAnimator.SetBool(_revolverSpin, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[4]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[4]; } break; case 5: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_slide, true); _handAnimator.SetBool(_gunCurved, false); _handAnimator.SetBool(_revolverSpin, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[5]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[5]; } break; case 6: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, true); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_gunCurved, false); _handAnimator.SetBool(_revolverSpin, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[2]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[2]; } break; case 7: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_grenade, true); _handAnimator.SetBool(_gunCurved, false); _handAnimator.SetBool(_revolverSpin, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[7]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[7]; } break; case 8: _otherHandAnim.SetBool(_ammo, false); _handAnimator.SetBool(_trigger, HandGunFier(_hand)); _otherHandAnim.SetBool(_trigger, false); _otherHandAnim.SetBool(_grab, false); _otherHandAnim.SetBool(_gun, false); _otherHandAnim.SetBool(_slide, false); _otherHandAnim.SetBool(_bolt, false); _otherHandAnim.SetBool(_mag, false); _otherHandAnim.SetBool(_grenade, false); _otherHandAnim.SetBool(_HGCB, true); _handAnimator.SetBool(_gunCurved, false); _handAnimator.SetBool(_revolverSpin, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.rightArm.target = _handFollowPos[8]; } else { _VRIKCon.solver.leftArm.target = _handFollowPos[8]; } break; case 9: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_mag, true); _handAnimator.SetBool(_gunCurved, false); _handAnimator.SetBool(_revolverSpin, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[9]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[9]; } break; case 10: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grab, true); _handAnimator.SetBool(_gunCurved, false); _handAnimator.SetBool(_revolverSpin, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y >= 0.075f) { _VRIKCon.solver.leftArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y < 0.075f) { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 1) { _VRIKCon.solver.leftArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 2) { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip != (Object)null) { _VRIKCon.solver.leftArm.target = _handFollowPos[11]; verticle = true; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y >= 0.075f) { _VRIKCon.solver.rightArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y < 0.075f) { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 1) { _VRIKCon.solver.rightArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 2) { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip != (Object)null) { _VRIKCon.solver.rightArm.target = _handFollowPos[11]; verticle = true; } break; case 11: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_revolverSpin, false); if (curved) { _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_gunCurved, true); } else if (!curved) { _handAnimator.SetBool(_gun, true); _handAnimator.SetBool(_gunCurved, false); } _handAnimator.SetBool(_trigger, HandGunFier(_hand)); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[12]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[12]; } break; case 12: _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_mag, true); _handAnimator.SetBool(_gunCurved, false); _handAnimator.SetBool(_revolverSpin, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[1]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[1]; } break; case 13: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_bolt, true); _handAnimator.SetBool(_gunCurved, false); _handAnimator.SetBool(_revolverSpin, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[4]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[4]; } break; default: _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_gun, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[1]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[1]; } break; } } private int HandAnimControll(FVRViveHand _otherHand) { int result = 1; if (typeof(FVRFireArm).IsAssignableFrom(((object)_gameObejctOnHands).GetType())) { if (((FVRPhysicalObject)((Component)_gameObejctOnHands).GetComponent()).IsAltHeld && (Object)(object)((Component)_gameObejctOnHands).GetComponent().Foregrip != (Object)null) { result = 10; } else if (!((FVRPhysicalObject)((Component)_gameObejctOnHands).GetComponent()).IsAltHeld || (Object)(object)((Component)_gameObejctOnHands).GetComponent().Foregrip == (Object)null) { result = ((!((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null)) ? 11 : 11); } } if (typeof(FVRFireArm).IsAssignableFrom(((object)_gameObejctOnHands).GetType()) && DoubleHandPistol(_otherHand) && (Object)(object)_otherHand.CurrentInteractable == (Object)null) { result = 8; } if ((object)typeof(FVRFireArmMagazine) == ((object)_gameObejctOnHands).GetType()) { result = 1; } if ((object)typeof(ClosedBoltHandle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(ClosedBolt) == ((object)_gameObejctOnHands).GetType() || (object)typeof(BoltActionRifle_Handle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(OpenBoltChargingHandle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(OpenBoltReceiverBolt) == ((object)_gameObejctOnHands).GetType()) { result = 4; } if ((object)typeof(FVRAlternateGrip) == ((object)_gameObejctOnHands).GetType() || (object)typeof(TubeFedShotgunHandle) == ((object)_gameObejctOnHands).GetType()) { result = 2; } if ((object)typeof(FVRFireArmRound) == ((object)_gameObejctOnHands).GetType()) { result = 6; } if ((object)typeof(HandgunSlide) == ((object)_gameObejctOnHands).GetType()) { result = 5; } if ((object)typeof(PinnedGrenade) == ((object)_gameObejctOnHands).GetType() || (object)typeof(FVRCappedGrenade) == ((object)_gameObejctOnHands).GetType()) { result = 7; } if ((object)typeof(FVRFireArmTopCover) == ((object)_gameObejctOnHands).GetType()) { result = 9; } if ((object)typeof(FVRHandGrabPoint) == ((object)_gameObejctOnHands).GetType()) { result = 12; } if ((object)typeof(CarlGustafLatch) == ((object)_gameObejctOnHands).GetType()) { result = 13; } return result; } private bool HandGunFier(FVRViveHand _hand) { if (_hand.Input.TriggerFloat >= 0.7f) { _fier = true; } else { _fier = false; } return _fier; } private bool DoubleHandPistol(FVRViveHand _otherHand) { if (HandsDistance() <= 0.15f && (Object)(object)_otherHand.CurrentInteractable == (Object)null && _otherHand.Input.TriggerDown && (Object)(object)_gameObejctOnHands != (Object)null && (Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { _gripCut = !_gripCut; } if (HandsDistance() > 0.175f) { _gripCut = false; } return _gripCut; } private float HandsDistance() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return Vector3.Distance(GM.CurrentMovementManager.LeftHand.position, GM.CurrentMovementManager.RightHand.position); } private void PlayerAnimC() { playerAnime.SetFloat(AnimatorControllerName_X, leftHand.Input.Secondary2AxisInputAxes.x); playerAnime.SetFloat(AnimatorControllerName_Y, leftHand.Input.Secondary2AxisInputAxes.y); } } } namespace JerryComponent { public class RockAndStone : MonoBehaviour { public Kick kick; public GameObject rot; public GameObject sound; public float time; private void Start() { } private void Update() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) time += Time.deltaTime; if (time > 5f && rot.transform.localEulerAngles.x > 45f && kick.speedR >= 2f) { sound.SetActive(true); time = 0f; } else if (rot.transform.localEulerAngles.x < 45f) { sound.SetActive(false); } } } [ExecuteInEditMode] [RequireComponent(typeof(Camera))] public class DeferredNightVisionEffect : MonoBehaviour { [SerializeField] [Tooltip("The main color of the NV effect")] public Color m_NVColor = new Color(0f, 1f, 0.1724138f, 0f); [SerializeField] [Tooltip("The color that the NV effect will 'bleach' towards (white = default)")] public Color m_TargetBleachColor = new Color(1f, 1f, 1f, 0f); [Range(0f, 0.1f)] [Tooltip("How much base lighting does the NV effect pick up")] public float m_baseLightingContribution = 0.025f; [Range(0f, 128f)] [Tooltip("The higher this value, the more bright areas will get 'bleached out'")] public float m_LightSensitivityMultiplier = 100f; private Material m_Material; private Shader m_Shader; [Tooltip("Do we want to apply a vignette to the edges of the screen?")] public bool useVignetting = true; public Shader NightVisionShader => m_Shader; private void DestroyMaterial(Material mat) { if (Object.op_Implicit((Object)(object)mat)) { Object.DestroyImmediate((Object)(object)mat); mat = null; } } private void CreateMaterials() { if ((Object)(object)m_Shader == (Object)null) { m_Shader = Shader.Find("Custom/DeferredNightVisionShader"); } if ((Object)(object)m_Material == (Object)null && (Object)(object)m_Shader != (Object)null && m_Shader.isSupported) { m_Material = CreateMaterial(m_Shader); } } private Material CreateMaterial(Shader shader) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)shader)) { return null; } Material val = new Material(shader); ((Object)val).hideFlags = (HideFlags)61; return val; } private void OnDisable() { DestroyMaterial(m_Material); m_Material = null; m_Shader = null; } [ContextMenu("UpdateShaderValues")] public void UpdateShaderValues() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)m_Material == (Object)null)) { m_Material.SetVector("_NVColor", Color.op_Implicit(m_NVColor)); m_Material.SetVector("_TargetWhiteColor", Color.op_Implicit(m_TargetBleachColor)); m_Material.SetFloat("_BaseLightingContribution", m_baseLightingContribution); m_Material.SetFloat("_LightSensitivityMultiplier", m_LightSensitivityMultiplier); m_Material.shaderKeywords = null; if (useVignetting) { Shader.EnableKeyword("USE_VIGNETTE"); } else { Shader.DisableKeyword("USE_VIGNETTE"); } } } private void OnEnable() { CreateMaterials(); UpdateShaderValues(); } public void ReloadShaders() { OnDisable(); } private void OnRenderImage(RenderTexture source, RenderTexture destination) { UpdateShaderValues(); CreateMaterials(); Graphics.Blit((Texture)(object)source, destination, m_Material); } } public class BEARMouthSync : MonoBehaviour { private AudioClip micRecord; private string device; public SkinnedMeshRenderer smr; public int msmile = 7; public int mA = 0; public int mE = 3; public int mI = 2; public int mO = 4; public int mU = 1; public int mS = 5; public int mfrown = 6; private string microphoneName; private float mouthClosedV = 0.0011f; private float smileFrownV = 0.0701f; private float partialOpenV = 0.0201f; private float normalOpenv = 0.0301f; private int pitchSwap = 1; private float lastActiveTime; private float lastChosenMouth; private float talkDuration = 0.05f; private float silenceDuration = 0.25f; private void Awake() { lastChosenMouth = Time.deltaTime; InitializeMicrophone(); } private void Start() { } private void InitializeMicrophone() { string[] devices = Microphone.devices; foreach (string text in devices) { Debug.Log((object)("Microphone detected: " + text)); } if (Microphone.devices.Length != 0) { microphoneName = Microphone.devices[0]; micRecord = Microphone.Start(microphoneName, true, 1, 44100); } else { Debug.Log((object)"No microphones detected at all!"); } } private void Update() { if ((Object)(object)smr == (Object)null) { return; } if (Microphone.IsRecording(microphoneName)) { float[] array = new float[16]; micRecord.GetData(array, Microphone.GetPosition(microphoneName)); float num = 0f; int num2 = 0; for (int i = 1; i < array.Length; i++) { num += Mathf.Abs(array[i]); if (array[i - 1] < 0f && array[i] > 0f) { num2++; } } num /= (float)array.Length; float num3 = num2; if (num < mouthClosedV) { smr.SetBlendShapeWeight(msmile, 0f); smr.SetBlendShapeWeight(mfrown, 0f); smr.SetBlendShapeWeight(mA, 0f); smr.SetBlendShapeWeight(mE, 0f); smr.SetBlendShapeWeight(mI, 0f); smr.SetBlendShapeWeight(mO, 0f); smr.SetBlendShapeWeight(mU, 0f); smr.SetBlendShapeWeight(mS, 0f); } else { if (num < smileFrownV) { if (num3 < (float)pitchSwap) { smr.SetBlendShapeWeight(msmile, 0f); smr.SetBlendShapeWeight(mfrown, 10f); } else { smr.SetBlendShapeWeight(msmile, 10f); smr.SetBlendShapeWeight(mfrown, 0f); } } if (num < partialOpenV) { smr.SetBlendShapeWeight(mA, 5f); smr.SetBlendShapeWeight(mE, 0f); smr.SetBlendShapeWeight(mI, 20f); smr.SetBlendShapeWeight(mO, 0f); smr.SetBlendShapeWeight(mU, 20f); smr.SetBlendShapeWeight(mS, 0f); } else if (num < normalOpenv) { smr.SetBlendShapeWeight(mA, 10f); smr.SetBlendShapeWeight(mE, 20f); smr.SetBlendShapeWeight(mI, 20f); smr.SetBlendShapeWeight(mO, 0f); smr.SetBlendShapeWeight(mU, 0f); smr.SetBlendShapeWeight(mS, 20f); } else { smr.SetBlendShapeWeight(mA, 20f); smr.SetBlendShapeWeight(mE, 20f); smr.SetBlendShapeWeight(mI, 50f); smr.SetBlendShapeWeight(mO, 0f); smr.SetBlendShapeWeight(mU, 0f); smr.SetBlendShapeWeight(mS, 50f); } } lastActiveTime = Time.time; if (Time.time - lastChosenMouth > talkDuration) { lastChosenMouth = Time.time; } } if (Time.time - lastActiveTime > silenceDuration) { smr.SetBlendShapeWeight(msmile, 0f); smr.SetBlendShapeWeight(mfrown, 0f); smr.SetBlendShapeWeight(mA, 0f); smr.SetBlendShapeWeight(mE, 0f); smr.SetBlendShapeWeight(mI, 0f); smr.SetBlendShapeWeight(mO, 0f); smr.SetBlendShapeWeight(mU, 0f); smr.SetBlendShapeWeight(mS, 0f); } } } } public class Damageablecol : MonoBehaviour, IFVRDamageable { public float parthealth = 1000f; public float idealhealth = 1000f; public Ragdoll R; public void Damage(Damage dam) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 if (((int)dam.Class == 1 || (int)dam.Class == 2) && R.conscious) { parthealth -= Random.Range(100, 250); if (parthealth <= 0f && !R.dead) { R.RagdollTransition(); R.dead = true; parthealth = idealhealth; } } } public void FixedUpdate() { if (parthealth <= 0.25f * idealhealth) { R.isLowHealth = true; } } } namespace JerryComponent { public class DeathBody : MonoBehaviour { public GameObject body; public Transform spawnpoint; public GameObject player; public bool dead = false; private DropItems deadbody; public FVRQuickBeltSlot headslotalive; public FVRQuickBeltSlot bodyslotalive; public FVRQuickBeltSlot maskslotalive; public FVRQuickBeltSlot armorslotalive; public FVRQuickBeltSlot beltslotalive; private FVRPhysicalObject helmet; private FVRPhysicalObject vest; private FVRPhysicalObject mask; private FVRPhysicalObject armor; private FVRPhysicalObject belt; public GameObject armband; private void Start() { } private void Update() { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05e2: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)deadbody == (Object)null || !dead || (Object)(object)helmet == (Object)null || (Object)(object)vest == (Object)null || (Object)(object)mask == (Object)null || (Object)(object)armor == (Object)null || (Object)(object)belt == (Object)null) { } if ((Object)(object)deadbody != (Object)null && dead) { deadbody.dc.isdead = true; if ((Object)(object)helmet != (Object)null) { ((Component)helmet).gameObject.transform.position = deadbody.headslot.position; ((Component)helmet).gameObject.transform.eulerAngles = deadbody.headslot.eulerAngles; } if ((Object)(object)vest != (Object)null) { ((Component)vest).gameObject.transform.position = deadbody.bodyslot.position; ((Component)vest).gameObject.transform.eulerAngles = deadbody.bodyslot.eulerAngles; } if ((Object)(object)mask != (Object)null) { ((Component)mask).gameObject.transform.position = deadbody.maskslot.position; ((Component)mask).gameObject.transform.eulerAngles = deadbody.maskslot.eulerAngles; } if ((Object)(object)armor != (Object)null) { ((Component)armor).gameObject.transform.position = deadbody.armorslot.position; ((Component)armor).gameObject.transform.eulerAngles = deadbody.armorslot.eulerAngles; } if ((Object)(object)belt != (Object)null) { ((Component)belt).gameObject.transform.position = deadbody.beltslot.position; ((Component)belt).gameObject.transform.eulerAngles = deadbody.beltslot.eulerAngles; } if ((Object)(object)headslotalive.CurObject != (Object)null) { helmet = headslotalive.CurObject; headslotalive.CurObject.ClearQuickbeltState(); } if ((Object)(object)maskslotalive.CurObject != (Object)null) { mask = maskslotalive.CurObject; maskslotalive.CurObject.ClearQuickbeltState(); } if ((Object)(object)bodyslotalive.CurObject != (Object)null) { vest = bodyslotalive.CurObject; bodyslotalive.CurObject.ClearQuickbeltState(); } if ((Object)(object)armorslotalive.CurObject != (Object)null) { armor = armorslotalive.CurObject; armorslotalive.CurObject.ClearQuickbeltState(); } if ((Object)(object)beltslotalive.CurObject != (Object)null) { belt = beltslotalive.CurObject; beltslotalive.CurObject.ClearQuickbeltState(); } } if (GM.IsDead()) { for (int num = GM.CurrentPlayerBody.QuickbeltSlots.Count - 1; num >= 0; num--) { if ((Object)(object)GM.CurrentPlayerBody.QuickbeltSlots[num] != (Object)null && (Object)(object)GM.CurrentPlayerBody.QuickbeltSlots[num].CurObject != (Object)null) { FVRPhysicalObject curObject = GM.CurrentPlayerBody.QuickbeltSlots[num].CurObject; curObject.ClearQuickbeltState(); curObject.DeRegisterQuickbeltSlots(); curObject.SetIsKinematicLocked(false); curObject.SetQuickBeltSlot((FVRQuickBeltSlot)null); curObject.SetParentage((Transform)null); ((FVRInteractiveObject)curObject).SetAllCollidersToLayer(false, "Default"); ((FVRInteractiveObject)curObject).BeginInteraction(GM.CurrentMovementManager.Hands[0]); ((FVRInteractiveObject)curObject).EndInteraction(GM.CurrentMovementManager.Hands[0]); GM.CurrentPlayerBody.QuickbeltSlots[num].CurObject = null; } } if ((Object)(object)GM.CurrentMovementManager.Hands[0].CurrentInteractable != (Object)null) { GM.CurrentMovementManager.Hands[0].CurrentInteractable.IsHeld = false; GM.CurrentMovementManager.Hands[0].CurrentInteractable.EndInteraction(GM.CurrentMovementManager.Hands[0]); GM.CurrentMovementManager.Hands[0].EndInteractionIfHeld(GM.CurrentMovementManager.Hands[0].CurrentInteractable); } if ((Object)(object)GM.CurrentMovementManager.Hands[1].CurrentInteractable != (Object)null) { GM.CurrentMovementManager.Hands[1].CurrentInteractable.IsHeld = false; GM.CurrentMovementManager.Hands[1].CurrentInteractable.EndInteraction(GM.CurrentMovementManager.Hands[1]); GM.CurrentMovementManager.Hands[1].EndInteractionIfHeld(GM.CurrentMovementManager.Hands[1].CurrentInteractable); } DropQuickbeltContents(); armband.SetActive(false); player.SetActive(false); if (!dead) { int quickbeltPreset = GM.Options.QuickbeltOptions.QuickbeltPreset; GM.CurrentPlayerBody.ConfigureQuickbelt(quickbeltPreset + 1); GM.CurrentPlayerBody.ConfigureQuickbelt(quickbeltPreset); deadbody = Object.Instantiate(body, ((Component)spawnpoint).transform.position, ((Component)spawnpoint).transform.rotation).GetComponent(); dead = true; } } if (!GM.IsDead()) { if ((Object)(object)deadbody != (Object)null) { deadbody.dc.cam.SetActive(false); deadbody.dc.isdead = false; } if ((Object)(object)helmet != (Object)null) { ((Component)helmet).transform.SetParent((Transform)null); } if ((Object)(object)vest != (Object)null) { ((Component)vest).transform.SetParent((Transform)null); } if ((Object)(object)mask != (Object)null) { ((Component)mask).transform.SetParent((Transform)null); } if ((Object)(object)armor != (Object)null) { ((Component)armor).transform.SetParent((Transform)null); } if ((Object)(object)belt != (Object)null) { ((Component)belt).transform.SetParent((Transform)null); } helmet = null; vest = null; mask = null; armor = null; belt = null; armband.SetActive(true); player.SetActive(true); dead = false; } } public void DropQuickbeltContents() { } } } public class DeathMap : MonoBehaviour { public GameObject rot; private void OnTriggerStay(Collider other) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (((Object)((Component)other).gameObject).name == "EscapeBal") { rot.transform.localEulerAngles = new Vector3(90f, 0f, 0f); } } private void Start() { } private void Update() { } } namespace JerryComponent { public class DropItems : MonoBehaviour { public DeathCamera dc; public Rigidbody head; public Rigidbody pelvis; public Rigidbody spine; public Rigidbody thighL; public Rigidbody thighR; public Rigidbody calfL; public Rigidbody calfR; public Rigidbody upperarmL; public Rigidbody upperarmR; public Rigidbody forearmL; public Rigidbody forearmR; public Transform headslot; public Transform bodyslot; public Transform maskslot; public Transform armorslot; public Transform beltslot; private void Start() { } private void Update() { head.isKinematic = false; pelvis.isKinematic = false; spine.isKinematic = false; thighL.isKinematic = false; thighR.isKinematic = false; calfL.isKinematic = false; calfR.isKinematic = false; upperarmL.isKinematic = false; upperarmR.isKinematic = false; forearmL.isKinematic = false; forearmR.isKinematic = false; } } public class HandColToggle : MonoBehaviour { public Collider handcoll; public Collider handcolr; private FVRViveHand handl; private FVRViveHand handr; private void Start() { } private void Update() { handl = ((Component)GM.CurrentPlayerBody.LeftHand).gameObject.GetComponent(); handr = ((Component)GM.CurrentPlayerBody.RightHand).gameObject.GetComponent(); if ((Object)(object)handl == (Object)null || (Object)(object)handr == (Object)null) { } if ((Object)(object)handl != (Object)null) { if (handl.m_hasInit) { handcoll.enabled = false; } else { handcoll.enabled = true; } } if ((Object)(object)handr != (Object)null) { if (handr.m_hasInit) { handcolr.enabled = false; } else { handcolr.enabled = true; } } } } } public class HumanoidTwister : MonoBehaviour { private void Start() { } private void Update() { } } namespace JerryComponent { public class QBslotToPlayer : MonoBehaviour { public FVRQuickBeltSlot slot1; public FVRQuickBeltSlot slot2; public FVRQuickBeltSlot slot3; public FVRQuickBeltSlot slot4; public FVRQuickBeltSlot slot5; private void Start() { } private void Update() { if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { if (GM.CurrentPlayerBody.QBSlots_Added.Contains(slot1)) { GM.CurrentPlayerBody.QBSlots_Added.Remove(slot1); } if (GM.CurrentPlayerBody.QBSlots_Added.Contains(slot2)) { GM.CurrentPlayerBody.QBSlots_Added.Remove(slot2); } if (GM.CurrentPlayerBody.QBSlots_Added.Contains(slot3)) { GM.CurrentPlayerBody.QBSlots_Added.Remove(slot3); } if (GM.CurrentPlayerBody.QBSlots_Added.Contains(slot4)) { GM.CurrentPlayerBody.QBSlots_Added.Remove(slot4); } if (GM.CurrentPlayerBody.QBSlots_Added.Contains(slot5)) { GM.CurrentPlayerBody.QBSlots_Added.Remove(slot5); } if (!GM.CurrentPlayerBody.QBSlots_Internal.Contains(slot1)) { GM.CurrentPlayerBody.QBSlots_Internal.Add(slot1); Debug.Log((object)"slotadded"); } if (!GM.CurrentPlayerBody.QBSlots_Internal.Contains(slot2)) { GM.CurrentPlayerBody.QBSlots_Internal.Add(slot2); Debug.Log((object)"slotadded"); } if (!GM.CurrentPlayerBody.QBSlots_Internal.Contains(slot3)) { GM.CurrentPlayerBody.QBSlots_Internal.Add(slot3); Debug.Log((object)"slotadded"); } if (!GM.CurrentPlayerBody.QBSlots_Internal.Contains(slot4)) { GM.CurrentPlayerBody.QBSlots_Internal.Add(slot4); Debug.Log((object)"slotadded"); } if (!GM.CurrentPlayerBody.QBSlots_Internal.Contains(slot5)) { GM.CurrentPlayerBody.QBSlots_Internal.Add(slot5); Debug.Log((object)"slotadded"); } } } private void OnDestroy() { if (GM.CurrentPlayerBody.QBSlots_Internal.Contains(slot1)) { GM.CurrentPlayerBody.QBSlots_Internal.Remove(slot1); } if (GM.CurrentPlayerBody.QBSlots_Internal.Contains(slot2)) { GM.CurrentPlayerBody.QBSlots_Internal.Remove(slot2); } if (GM.CurrentPlayerBody.QBSlots_Internal.Contains(slot3)) { GM.CurrentPlayerBody.QBSlots_Internal.Remove(slot3); } if (GM.CurrentPlayerBody.QBSlots_Internal.Contains(slot4)) { GM.CurrentPlayerBody.QBSlots_Internal.Remove(slot4); } if (GM.CurrentPlayerBody.QBSlots_Internal.Contains(slot5)) { GM.CurrentPlayerBody.QBSlots_Internal.Remove(slot5); } } } public class WristTwist : MonoBehaviour { public GameObject wl; public GameObject wl2; public GameObject wr; public GameObject wr2; public GameObject hl; public GameObject hr; public float rotl; public float rotr; private void Start() { } private void Update() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) rotl = hl.transform.localEulerAngles.y; rotr = hr.transform.localEulerAngles.y; if (rotl < 180f) { wl.transform.localEulerAngles = new Vector3((180f - rotl) / 2f, 0f, 0f); wl2.transform.localEulerAngles = new Vector3((180f - rotl) / 3f, 0f, 0f); } if (rotr < 180f) { wr.transform.localEulerAngles = new Vector3((180f - rotr) / 2f, 0f, 0f); wr2.transform.localEulerAngles = new Vector3((180f - rotr) / 4f, 0f, 0f); } if (rotl > 180f) { wl.transform.localEulerAngles = new Vector3((180f - rotl) / 2f, 0f, 0f); wl2.transform.localEulerAngles = new Vector3((180f - rotl) / 3f, 0f, 0f); } if (rotr > 180f) { wr.transform.localEulerAngles = new Vector3(rotr / 2f, 0f, 0f); wr2.transform.localEulerAngles = new Vector3(rotr / 4f, 0f, 0f); } } } public class RandomSpawn : MonoBehaviour { public GameObject[] _Outfits; public GameObject _Selected; public Random Rand; public int _MaxNum; public void Awake() { Rand = new Random(); Rand.Next(_MaxNum); _Selected = _Outfits[Rand.Next(_MaxNum)]; _Selected.SetActive(true); } private void Start() { } private void Update() { } } public class HumanoidAI_DontTellAnton : MonoBehaviour { public FVRObject id; public void OnTriggerEnter(Collider other) { if (((Object)((Component)other).gameObject).name == "Sosig_Torso" && (Object)(object)((Component)other).GetComponent() != (Object)null && ((Component)other).GetComponent().S.Renderers[0].enabled && (Object)(object)((Component)other).GetComponent().S.Links[0] != (Object)null) { Object.Instantiate(((AnvilAsset)id).GetGameObject(), ((Component)((Component)other).GetComponent().S.Links[0]).gameObject.transform); } } } public class Humansig : MonoBehaviour { public GameObject USECmesh; public GameObject BEARmesh; public GameObject handL; public GameObject handR; public Sosig sosig; public GameObject bodyprefab; public bool isFriendly = false; public GameObject bodyUSEC; public GameObject bodyBEAR; public bool bodyspawned = false; private void OnTriggerEnter(Collider other) { if ((Object)(object)((Component)other).gameObject.GetComponent() != (Object)null) { sosig = ((Component)other).gameObject.GetComponent().S; } } private void Start() { } private void Update() { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)sosig == (Object)null) { } if (!((Object)(object)sosig != (Object)null)) { return; } if (sosig.m_originalIFFTeam == GM.CurrentPlayerBody.m_playerIFF && !bodyspawned) { isFriendly = true; BEARmesh.SetActive(true); bodyspawned = true; } else if (sosig.m_originalIFFTeam != GM.CurrentPlayerBody.m_playerIFF && !bodyspawned) { isFriendly = false; USECmesh.SetActive(true); bodyspawned = true; } if ((int)sosig.BodyState != 0) { sosig.Mustard = 0f; sosig.UsesGibs = false; if (!isFriendly) { Object.Instantiate(bodyUSEC, ((Component)sosig).gameObject.transform.position, ((Component)sosig).gameObject.transform.rotation); } else if (isFriendly) { Object.Instantiate(bodyBEAR, ((Component)sosig).gameObject.transform.position, ((Component)sosig).gameObject.transform.rotation); } sosig.KillSosig(); if ((Object)(object)sosig.Links[0] != (Object)null) { sosig.Links[0].LinkExplodes((DamageClass)0); } if ((Object)(object)sosig.Links[1] != (Object)null) { sosig.Links[1].LinkExplodes((DamageClass)0); } if ((Object)(object)sosig.Links[2] != (Object)null) { sosig.Links[2].LinkExplodes((DamageClass)0); } if ((Object)(object)sosig.Links[3] != (Object)null) { sosig.Links[3].LinkExplodes((DamageClass)0); } Object.Destroy((Object)(object)bodyprefab); Object.Destroy((Object)(object)this); } sosig.Renderers[0].enabled = false; sosig.Renderers[1].enabled = false; sosig.Renderers[2].enabled = false; sosig.Renderers[3].enabled = false; if ((Object)(object)sosig.Links[0] != (Object)null) { sosig.Links[0].DisableWearables(); } if ((Object)(object)sosig.Links[1] != (Object)null) { sosig.Links[1].DisableWearables(); } if ((Object)(object)sosig.Links[2] != (Object)null) { sosig.Links[2].DisableWearables(); } if ((Object)(object)sosig.Links[3] != (Object)null) { sosig.Links[3].DisableWearables(); } if (sosig.Hand_Primary != null) { handR.transform.position = ((Component)sosig.Hand_Primary.Target).transform.position; handR.transform.eulerAngles = ((Component)sosig.Hand_Primary.Target).transform.eulerAngles; } if (sosig.Hand_Secondary != null) { handL.transform.position = ((Component)sosig.Hand_Secondary.Target).transform.position; handL.transform.eulerAngles = ((Component)sosig.Hand_Secondary.Target).transform.eulerAngles; } } } public class DrawDecal : MonoBehaviour { private void OnTriggerEnter(Collider other) { if (((Object)((Component)other).gameObject).name == "MarkeTail") { Object.Destroy((Object)(object)this); } } private void Start() { } private void Update() { } } public class DrawingTool : MonoBehaviour { public GameObject penref; public GameObject decal; private void OnTriggerStay(Collider other) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (((Object)((Component)other).gameObject).name == "MarkerTip") { penref.transform.position = ((Component)other).gameObject.transform.position; Object.Instantiate(decal, penref.transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } } private void Start() { } private void FixedUpdate() { } } public class OnlyOne : MonoBehaviour { private void Start() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown int num = 0; Object[] array = Object.FindObjectsOfType(typeof(FVRPhysicalObject)); for (int i = 0; i < array.Length; i++) { FVRPhysicalObject val = (FVRPhysicalObject)array[i]; num++; if (((Object)((Component)val).gameObject).name == ((Object)((Component)this).gameObject).name && !((Object)(object)((Component)val).gameObject == (Object)(object)((Component)this).gameObject) && (Object)(object)((Component)val).gameObject != (Object)(object)((Component)this).gameObject) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } private void Update() { } } public class SCAVing : MonoBehaviour { public Humansig humansig; public GameObject backpack; public GameObject currentbackpack; private void Start() { } private void OnTriggerStay(Collider other) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && (int)humansig.sosig.BodyState == 0 && (int)((Component)other).gameObject.GetComponent().QBSlotType == 1 && !((Component)other).gameObject.GetComponent().isKinematic && (Object)(object)((Component)other).gameObject.GetComponent().m_quickbeltSlot == (Object)null) { ((FVRInteractiveObject)((Component)other).gameObject.GetComponent()).SetAllCollidersToLayer(false, "NoCol"); ((Component)other).gameObject.transform.position = backpack.transform.position; ((Component)other).gameObject.transform.eulerAngles = backpack.transform.eulerAngles; currentbackpack = ((Component)other).gameObject; } } private void OnTriggerEnter(Collider other) { if ((Object)(object)((Component)other).gameObject == (Object)(object)currentbackpack) { ((FVRInteractiveObject)((Component)other).gameObject.GetComponent()).SetAllCollidersToLayer(false, "Default"); currentbackpack = null; } } private void Update() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)currentbackpack == (Object)null) { } if ((Object)(object)currentbackpack != (Object)null && (Object)(object)humansig.sosig != (Object)null && (int)humansig.sosig.BodyState != 0) { ((FVRInteractiveObject)currentbackpack.gameObject.GetComponent()).SetAllCollidersToLayer(false, "Default"); } } } } namespace JerryNPC { public class SOSIGHMGUNNER : MonoBehaviour { private enum CombatState { Idle, Aiming, Shooting, Reloading, Suppressed } private class SoundEvent { public Vector3 position; public float loudness; public float timestamp; public float duration; public float priority; public SoundEvent(Vector3 pos, float loud, float dur, float prio) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) position = pos; loudness = loud; timestamp = Time.time; duration = dur; priority = prio; } public bool IsValid() { return Time.time - timestamp < duration; } } public GameObject heightref; public GameObject heightslope; public float lastnmay; public float curnmay; public float cdlost = 10f; public AudioEvent curses; public AudioEvent wanning; public AudioEvent hurt; public AudioEvent sure; public bool isHurt = false; public LayerMask lm; public LayerMask lmfire; public GameObject chest; public npcBasic NB; public ArmIK ArmL; public ArmIK ArmR; public LegIK LegL; public LegIK LegR; public GameObject body; public Ragdoll R; [NonSerialized] public GameObject itemTar; public ActiveRagdoll AR; public float fireCD = 0f; public bool isContious = true; public NavMeshAgent NMA; [NonSerialized] public SimpleLauncher2 curMortar; public FVRFireArmRound curShell; [NonSerialized] public FVRFireArm curGun; [NonSerialized] public FVRFireArmMagazine curMag; [NonSerialized] public FVRFireArmMagazine newMag; public Transform handL; public Vector3 refHandL; public Transform handR; public Vector3 refHandR; public Collider detectCol; public Transform aimPos; public Transform reloadPos; public Transform idlePos; public Transform magPouch; public Transform backpackpos; [NonSerialized] public List currentAI = new List(); [NonSerialized] public Transform nearestAI; public bool cocked = false; public bool pouched = false; public Transform aimRoot; public Vector3 refSlide; public Transform l; public Transform r; public float cd = 10f; public float speechCD = 0f; private KeywordRecognizer keyword; private Dictionary dic = new Dictionary(); public GameObject chestrefX; public GameObject chestrefY; public bool follow = false; public bool fire = true; public GameObject aimingpoint; public bool isSCAV; public bool isBEAR; public bool isUSEC; public bool playerIsBEAR = false; public bool playerIsUSEC = false; public FVRQuickBeltSlot SlotHead; public FVRQuickBeltSlot SlotTorso; public Transform headsight; public Transform headtoplayer; public LayerMask LMMASK; public bool sawPlayer; [Header("Combat Settings")] public float accuracySpread = 2f; public float aimDuration = 0.5f; private float currentAimTime = 0f; private Vector3 aimError = Vector3.zero; private float lastAimUpdate = 0f; [Header("Detection Settings")] public float detectionRange = 30f; public float hearingRange = 40f; public float fieldOfView = 90f; public float loseTargetTime = 5f; private float currentLoseTime = 0f; private Transform lastKnownPosition = null; private Vector3 lastSeenPosition; private float lastSeenTime = 0f; [Header("Suppression Settings")] public float suppressionRecoveryTime = 2f; private float suppressionLevel = 0f; [Header("Hearing System")] public float minSoundLoudness = 0.3f; public float attentionDuration = 3f; public float maxLookAtSoundTime = 2f; private Dictionary activeSounds = new Dictionary(); private Vector3 currentSoundInterest = Vector3.zero; private float timeLookingAtSound = 0f; private bool isInvestigatingSound = false; public bool isLowHealth = false; [Header("Head Rotation Limits")] public float headYawLimit = 70f; public float headPitchUpLimit = 40f; public float headPitchDownLimit = 50f; public float headRollLimit = 30f; public float headRotationSpeed = 8f; public float headRestoreSpeed = 4f; private Quaternion headInitialLocalRot; private Quaternion headTargetLocalRot; private Vector3 currentHeadAngles; private Vector3 targetHeadAngles; [Header("Head-Body Sync")] public float bodyFollowHeadSpeed = 5f; public float bodyFollowHeadThreshold = 45f; public float bodyTurnTorque = 8f; private Quaternion targetBodyRotation; private Quaternion smoothHeadRotation; private float currentBodyYaw = 0f; private float targetBodyYaw = 0f; [Header("Sosig Detection")] public bool detectSosigs = true; public float sosigDetectionRange = 25f; public LayerMask sosigLayer; public float sosigPriority = 0.8f; private List detectedSosigs = new List(); private Transform currentSosigTarget; private float lastSosigScanTime = 0f; private float sosigScanInterval = 0.5f; private CombatState currentCombatState = CombatState.Idle; private float timeSinceLastShot = 0f; [Header("Slope Behavior")] public bool adaptPostureOnSlope = true; public float crouchSpeedMultiplier = 0.7f; private float originalStandHeight; private float currentSlopeAngle = 0f; [Header("Arm Control")] public bool enableArmControlSwitch = true; public float armControlTransitionSpeed = 3f; private bool isArmControlledByRagdoll = false; private float currentArmBlend = 0f; private Vector3 originalLeftHandPos; private Vector3 originalRightHandPos; private Quaternion originalLeftHandRot; private Quaternion originalRightHandRot; private bool isGaitControlling = false; public GameObject MortarTarg; public GameObject MortarStand; public GameObject mortarHips; public AnimationCurve mortarCurve; public LayerMask mortarLM; public Transform mortarAimTargetY; public GameObject rangeBallRef; public bool isShellGrab = false; public Transform leftFoot; public Transform rightFoot; public Transform leftFootTar; public Transform rightFootTar; public bool hasMortar = false; private void UpdateCombatState() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)nearestAI == (Object)null) { currentCombatState = CombatState.Idle; return; } bool flag = (Object)(object)((Component)nearestAI).GetComponentInParent() != (Object)null; switch (currentCombatState) { case CombatState.Idle: if (Vector3.Distance(((Component)this).transform.position, nearestAI.position) < detectionRange) { currentCombatState = CombatState.Aiming; } break; case CombatState.Aiming: currentAimTime += Time.deltaTime; if (currentAimTime >= aimDuration) { currentCombatState = CombatState.Shooting; } break; case CombatState.Shooting: if (flag) { currentCombatState = CombatState.Shooting; currentAimTime = aimDuration; if (timeSinceLastShot > 0.4f) { UpdateShooting(); timeSinceLastShot = 0f; } timeSinceLastShot += Time.deltaTime; } break; } } private void DetectSosigs() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (!detectSosigs || Time.time - lastSosigScanTime < sosigScanInterval) { return; } lastSosigScanTime = Time.time; detectedSosigs.Clear(); Sosig[] array = Object.FindObjectsOfType(); Sosig[] array2 = array; foreach (Sosig val in array2) { if (Vector3.Distance(((Component)val).gameObject.transform.position, ((Component)this).gameObject.transform.position) < 30f && IsValidSosigTarget(val)) { Transform sosigTargetTransform = GetSosigTargetTransform(val); if ((Object)(object)sosigTargetTransform != (Object)null && !detectedSosigs.Contains(sosigTargetTransform)) { detectedSosigs.Add(sosigTargetTransform); } } } } private Transform GetSosigTargetTransform(Sosig sosig) { if ((Object)(object)sosig == (Object)null) { return null; } if ((Object)(object)sosig.Links[0] != (Object)null && (Object)(object)((Component)sosig.Links[0]).gameObject.transform != (Object)null) { return ((Component)sosig.Links[0]).gameObject.transform; } if ((Object)(object)sosig.Links[1] != (Object)null && (Object)(object)((Component)sosig.Links[1]).gameObject.transform != (Object)null) { return ((Component)sosig.Links[1]).gameObject.transform; } return ((Component)sosig).transform; } private bool IsValidSosigTarget(Sosig sosig) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)sosig == (Object)null) { return false; } if ((int)sosig.BodyState == 3) { return false; } if (!IsEnemySosig(sosig)) { return false; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)sosig).transform.position); Vector3 val = ((Component)sosig).transform.position - headsight.position; Vector3 normalized = ((Vector3)(ref val)).normalized; float num2 = Vector3.Angle(headsight.forward, normalized); if (!(num < 15f) && num2 > fieldOfView && num > hearingRange) { return false; } RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(headsight.position, normalized, ref val2, num, LayerMask.op_Implicit(LMMASK))) { SosigLink componentInParent = ((Component)((RaycastHit)(ref val2)).collider).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null) { return num < 10f; } if ((Object)(object)componentInParent.S != (Object)null && (Object)(object)componentInParent.S != (Object)(object)sosig) { return false; } } return true; } private bool IsEnemySosig(Sosig sosig) { if ((Object)(object)sosig == (Object)null) { return false; } if (sosig.GetIFF() == GM.CurrentPlayerBody.GetPlayerIFF()) { return false; } return true; } private Transform GetNearestSosig() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (detectedSosigs.Count == 0) { return null; } Transform result = null; float num = sosigDetectionRange; foreach (Transform detectedSosig in detectedSosigs) { if (!((Object)(object)detectedSosig == (Object)null)) { float num2 = Vector3.Distance(((Component)this).transform.position, detectedSosig.position); if (num2 < num) { num = num2; result = detectedSosig; } } } return result; } private Transform GetBestTarget() { Transform result = null; float num = -1f; foreach (SOSIGHMGUNNER item in currentAI) { if (!((Object)(object)item == (Object)null) && item.isContious) { Transform transform = ((Component)item).transform; float num2 = EvaluateTargetScore(transform); num2 *= 1.2f; if (num2 > num) { num = num2; result = transform; } } } DetectSosigs(); foreach (Transform detectedSosig in detectedSosigs) { if (!((Object)(object)detectedSosig == (Object)null)) { float num3 = EvaluateTargetScore(detectedSosig); num3 *= 1.1f; if (num3 > num) { num = num3; result = detectedSosig; } } } if ((Object)(object)GM.CurrentPlayerBody != (Object)null && IsValidEnemy(((Component)GM.CurrentPlayerBody.Torso).transform)) { float num4 = EvaluateTargetScore(((Component)GM.CurrentPlayerBody.Torso).transform); num4 *= 0.6f; if (num4 > num) { num = num4; result = ((Component)GM.CurrentPlayerBody.Torso).transform; } } return result; } private float EvaluateTargetScore(Transform target) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null) { return 0f; } float num = Vector3.Distance(((Component)this).transform.position, target.position); Vector3 val = target.position - headsight.position; Vector3 normalized = ((Vector3)(ref val)).normalized; float num2 = Vector3.Angle(headsight.forward, normalized); float num3 = 1f - Mathf.Clamp01(num / detectionRange); float num4 = 1f - Mathf.Clamp01(num2 / fieldOfView); float num5 = 1f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(headsight.position, normalized, ref val2, num, LayerMask.op_Implicit(LMMASK)) && (Object)(object)((RaycastHit)(ref val2)).transform != (Object)(object)target && !((RaycastHit)(ref val2)).transform.IsChildOf(target)) { num5 = 0.3f; } return num3 * 0.5f + num4 * 0.3f + num5 * 0.2f; } private void Awake() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown curnmay = ((Component)NMA).gameObject.transform.position.y; lastnmay = ((Component)NMA).gameObject.transform.position.y; GM.CurrentSceneSettings.PerceiveableSoundEvent += new PerceiveableSound(OnSoundHeard); GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(OnShotFired); } private void OnSoundHeard(float loudness, float maxDistanceHeard, Vector3 pos, int iffcode, AIEntity ent) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (!isContious) { return; } float num = Vector3.Distance(((Component)this).transform.position, pos); if (num > hearingRange) { return; } float num2 = loudness * (1f - num / maxDistanceHeard); if (num2 < minSoundLoudness) { return; } float num3 = CalculateSoundPriority(loudness, num, ent); SoundEvent soundEvent = new SoundEvent(pos, num2, attentionDuration, num3); if (activeSounds.ContainsKey(pos)) { if (activeSounds[pos].priority < num3) { activeSounds[pos] = soundEvent; } } else { activeSounds.Add(pos, soundEvent); } ReactToSound(soundEvent); } private float CalculateSoundPriority(float loudness, float distance, AIEntity ent) { float num = loudness; num = ((loudness > 0.8f) ? (num + 100f) : ((!(loudness < 0.4f)) ? (num + 50f) : (num + 10f))); num += (hearingRange - distance) * 5f; if ((Object)(object)ent != (Object)null && IsEnemyEntity(ent)) { num *= 1.5f; } return num; } private bool IsEnemyEntity(AIEntity ent) { return false; } private void ReactToSound(SoundEvent soundEvent) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)nearestAI != (Object)null) { if (Vector3.Distance(soundEvent.position, nearestAI.position) < Vector3.Distance(soundEvent.position, ((Component)this).transform.position)) { ((MonoBehaviour)this).StartCoroutine(QuickLookAtSound(soundEvent.position, 0.5f)); } return; } currentSoundInterest = soundEvent.position; timeLookingAtSound = 0f; isInvestigatingSound = true; if (soundEvent.loudness > 0.7f) { ((MonoBehaviour)this).StartCoroutine(StartledReaction(soundEvent)); } else if (soundEvent.loudness > 0.4f) { ((MonoBehaviour)this).StartCoroutine(LookAtSound(soundEvent)); } else { ((MonoBehaviour)this).StartCoroutine(SlightHeadTurn(soundEvent)); } if (speechCD <= 0f && soundEvent.loudness > 0.5f) { SM.PlayCoreSound((FVRPooledAudioType)41, wanning, ((Component)this).transform.position); speechCD = Random.Range(5, 10); } } private IEnumerator StartledReaction(SoundEvent soundEvent) { float originalSpeed = NMA.speed; NMA.speed = -1f; yield return (object)new WaitForSeconds(0.2f); NMA.speed = originalSpeed; float startTime = Time.time; while (Time.time - startTime < 0.3f) { SmoothAxisLookAt(((Component)headsight).transform, soundEvent.position, Vector3.forward); yield return null; } yield return (object)new WaitForSeconds(1f); isInvestigatingSound = false; } private IEnumerator LookAtSound(SoundEvent soundEvent) { float startTime = Time.time; float lookDuration = Mathf.Min(soundEvent.duration, maxLookAtSoundTime); while (Time.time - startTime < lookDuration && isInvestigatingSound) { float t = (Time.time - startTime) / lookDuration; SmoothAxisLookAt(lookPos: Vector3.Lerp(((Component)this).transform.position + ((Component)this).transform.forward, soundEvent.position, Mathf.Sin(t * (float)Math.PI / 2f)), tr_self: ((Component)headsight).transform, directionAxis: Vector3.forward); timeLookingAtSound += Time.deltaTime; yield return null; } isInvestigatingSound = false; } private IEnumerator SlightHeadTurn(SoundEvent soundEvent) { Vector3 originalHeadRot = headsight.localEulerAngles; Vector3 targetRot = headsight.localEulerAngles; Vector3 val = soundEvent.position - headsight.position; Vector3 directionToSound = ((Vector3)(ref val)).normalized; Vector3 forwardFlat = headsight.forward; forwardFlat.y = 0f; ((Vector3)(ref forwardFlat)).Normalize(); Vector3 toSoundFlat = directionToSound; toSoundFlat.y = 0f; ((Vector3)(ref toSoundFlat)).Normalize(); float dot = Vector3.Dot(forwardFlat, toSoundFlat); float angle = Mathf.Acos(Mathf.Clamp(dot, -1f, 1f)) * 57.29578f; float sign = ((!(Vector3.Cross(forwardFlat, toSoundFlat).y > 0f)) ? (-1f) : 1f); float targetYaw = Mathf.Clamp(angle * 0.3f * sign, -30f, 30f); targetRot.y += targetYaw; float startTime = Time.time; while (Time.time - startTime < 0.5f) { headsight.localEulerAngles = Vector3.Lerp(originalHeadRot, targetRot, (Time.time - startTime) / 0.5f); yield return null; } startTime = Time.time; while (Time.time - startTime < 0.5f) { headsight.localEulerAngles = Vector3.Lerp(targetRot, originalHeadRot, (Time.time - startTime) / 0.5f); yield return null; } headsight.localEulerAngles = originalHeadRot; } private IEnumerator QuickLookAtSound(Vector3 soundPos, float duration) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Transform previousTarget = nearestAI; float startTime = Time.time; while (Time.time - startTime < duration) { SmoothAxisLookAt(((Component)headsight).transform, soundPos, Vector3.forward); yield return null; } if ((Object)(object)previousTarget != (Object)null) { startTime = Time.time; while (Time.time - startTime < 0.2f) { SmoothAxisLookAt(((Component)headsight).transform, previousTarget.position, Vector3.forward); yield return null; } } } private void CleanupSoundEvents() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) List list = new List(); foreach (KeyValuePair activeSound in activeSounds) { if (!activeSound.Value.IsValid()) { list.Add(activeSound.Key); } } foreach (Vector3 item in list) { activeSounds.Remove(item); } } private SoundEvent GetPrioritySound() { SoundEvent result = null; float num = -1f; CleanupSoundEvents(); foreach (KeyValuePair activeSound in activeSounds) { if (activeSound.Value.priority > num) { num = activeSound.Value.priority; result = activeSound.Value; } } return result; } private IEnumerator DetectionCoroutine() { while (isContious) { PerformDetection(); yield return (object)new WaitForSeconds(0.2f); } } private void PerformDetection() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if (!isContious || (Object)(object)curGun == (Object)null || (Object)(object)curMag == (Object)null) { return; } Transform bestTarget = GetBestTarget(); if ((Object)(object)bestTarget != (Object)null) { Sosig componentInParent = ((Component)bestTarget).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { nearestAI = bestTarget; currentCombatState = CombatState.Shooting; currentAimTime = aimDuration; currentLoseTime = loseTargetTime; lastSeenPosition = bestTarget.position; lastSeenTime = Time.time; if (speechCD <= 0f && Random.value < 0.3f) { SM.PlayCoreSound((FVRPooledAudioType)41, curses, ((Component)this).transform.position); speechCD = Random.Range(3, 8); } } else { nearestAI = bestTarget; currentLoseTime = loseTargetTime; lastSeenPosition = bestTarget.position; lastSeenTime = Time.time; } } else if (Time.time - lastSeenTime < loseTargetTime) { nearestAI = null; } else { nearestAI = null; currentSosigTarget = null; } } private Transform GetTargetFromCollider(Collider col) { if ((Object)(object)GM.CurrentPlayerBody != (Object)null && ((Object)(object)((Component)col).transform == (Object)(object)GM.CurrentPlayerBody.Torso || (Object)(object)((Component)col).transform == (Object)(object)GM.CurrentPlayerBody.Head || (Object)(object)((Component)col).transform.root == (Object)(object)((Component)GM.CurrentPlayerBody).transform)) { if (isSCAV) { return ((Component)GM.CurrentPlayerBody.Torso).transform; } if (isBEAR && !playerIsBEAR) { return ((Component)GM.CurrentPlayerBody.Torso).transform; } if (isUSEC && !playerIsUSEC) { return ((Component)GM.CurrentPlayerBody.Torso).transform; } } SOSIGHMGUNNER component = ((Component)col).GetComponent(); if ((Object)(object)component != (Object)null && component.isContious && IsEnemyFaction(component)) { return ((Component)component).transform; } Sosig componentInParent = ((Component)col).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && IsValidSosigTarget(componentInParent)) { return GetSosigTargetTransform(componentInParent); } return null; } private bool IsEnemyFaction(SOSIGHMGUNNER other) { if (isSCAV) { return !other.isSCAV; } if (isBEAR) { return !other.isBEAR && !other.isSCAV; } if (isUSEC) { return !other.isUSEC && !other.isSCAV; } return false; } private void PerformShot() { Handgun component = ((Component)curGun).GetComponent(); if (!((Object)(object)component == (Object)null) && component.Chamber.IsFull && !component.Chamber.IsSpent && fire) { component.Fire(); } } private bool IsValidEnemy(Transform target) { if ((Object)(object)target == (Object)null) { return false; } if ((Object)(object)GM.CurrentPlayerBody != (Object)null && ((Object)(object)target == (Object)(object)((Component)GM.CurrentPlayerBody.Torso).transform || (Object)(object)target == (Object)(object)((Component)GM.CurrentPlayerBody.Head).transform)) { if (isSCAV) { return true; } if (isBEAR && !playerIsBEAR) { return true; } if (isUSEC && !playerIsUSEC) { return true; } return false; } SOSIGHMGUNNER component = ((Component)target).GetComponent(); if ((Object)(object)component != (Object)null && component.isContious) { return IsEnemyFaction(component); } return false; } private void UpdateShooting() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)curGun == (Object)null || (Object)(object)curMag == (Object)null || (Object)(object)nearestAI == (Object)null) { return; } bool flag = (Object)(object)((Component)nearestAI).GetComponentInParent() != (Object)null; if (flag) { if (fireCD > 0f) { fireCD -= Time.deltaTime * 1.5f; return; } } else if (fireCD > 0f) { fireCD -= Time.deltaTime; return; } if (flag && Vector3.Distance(((Component)this).transform.position, nearestAI.position) < 40f) { PerformShot(); fireCD = Random.Range(0.3f, 0.6f); } suppressionLevel = Mathf.Max(0f, suppressionLevel - Time.deltaTime / suppressionRecoveryTime); float num = CalculateHitChance(); Handgun component = ((Component)curGun).GetComponent(); if ((Object)(object)component == (Object)null) { return; } if (fireCD > 0f) { fireCD -= Time.deltaTime; } else if (component.Chamber.IsFull && !component.Chamber.IsSpent && fire && !(Random.value > num)) { Vector3 val = CalculateSpreadDirection(); Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(((Component)((FVRFireArm)component).MuzzlePos).transform.position, val); float num2 = Vector3.Distance(((Component)this).transform.position, nearestAI.position); float num3 = Mathf.Clamp(num2 / 50f, 0.3f, 1f); num3 += suppressionLevel * 0.5f; component.Fire(); fireCD = Random.Range(num3 * 0.8f, num3 * 1.2f); accuracySpread += 0.5f; accuracySpread = Mathf.Min(accuracySpread, 8f); if (flag) { num3 = 0.2f; fireCD = num3; } } } private float CalculateHitChance() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)nearestAI == (Object)null) { return 0f; } float num = Vector3.Distance(((Component)this).transform.position, nearestAI.position); Sosig componentInParent = ((Component)nearestAI).GetComponentInParent(); bool flag = (Object)(object)componentInParent != (Object)null; float num2 = ((!flag) ? 0.7f : 0.75f); float num3 = Mathf.Clamp01(num / detectionRange); num2 *= 1f - num3 * 0.6f; num2 -= suppressionLevel * 0.4f; float num4 = Mathf.Clamp01(currentAimTime / aimDuration) * 0.3f; num2 += num4; float num5 = 0f; if ((Object)(object)((Component)nearestAI).GetComponent() != (Object)null) { Vector3 velocity = ((Component)nearestAI).GetComponent().velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; num5 = Mathf.Clamp01(magnitude / 5f) * ((!flag) ? 0.3f : 0.2f); num2 -= num5; } return Mathf.Clamp(num2, 0.1f, 0.9f); } private Vector3 CalculateSpreadDirection() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) Vector3 val = nearestAI.position - curGun.MuzzlePos.position; Vector3 normalized = ((Vector3)(ref val)).normalized; float num = accuracySpread * (1f + suppressionLevel); Vector3 val2 = Random.insideUnitSphere * num * ((float)Math.PI / 180f); Vector3 randomBodyPart = GetRandomBodyPart(nearestAI); Vector3 val3 = randomBodyPart - curGun.MuzzlePos.position; Vector3 normalized2 = ((Vector3)(ref val3)).normalized; Vector3 val4 = Vector3.Slerp(normalized2, normalized + val2, 0.7f); return ((Vector3)(ref val4)).normalized; } private Vector3 GetRandomBodyPart(Transform target) { //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) Sosig componentInParent = ((Component)target).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { float value = Random.value; if (value < 0.4f) { if ((Object)(object)componentInParent.Links[0] != (Object)null) { return ((Component)componentInParent.Links[0]).gameObject.transform.position + Vector3.up * 0.1f; } } else { if (!(value < 0.7f)) { return target.position + Vector3.right * Random.Range(-0.3f, 0.3f); } if ((Object)(object)componentInParent.Links[1] != (Object)null) { return ((Component)componentInParent.Links[0]).gameObject.transform.position; } } } float value2 = Random.value; if (value2 < 0.5f) { return target.position + Vector3.up * Random.Range(-0.2f, 0.3f); } if (value2 < 0.75f) { return target.position + Vector3.up * 0.5f; } return target.position + Vector3.right * Random.Range(-0.3f, 0.3f); } private void Keyword_OnPhraseRecognized(PhraseRecognizedEventArgs args) { Debug.Log((object)args.text); dic[args.text](); } private void OnShotFired(FVRFireArm firearm) { if ((Object)(object)((FVRInteractiveObject)firearm).m_hand != (Object)null && ((Object)(object)((FVRInteractiveObject)firearm).m_hand == (Object)(object)GM.CurrentMovementManager.Hands[0] || (Object)(object)((FVRInteractiveObject)firearm).m_hand == (Object)(object)GM.CurrentMovementManager.Hands[1]) && ((isBEAR && !playerIsBEAR) || (isUSEC && !playerIsUSEC) || isSCAV) && (Object)(object)nearestAI == (Object)null) { nearestAI = ((Component)firearm).gameObject.transform; } } private void UpdateHeadSafe(Vector3 lookTarget) { //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)headsight == (Object)null) { return; } if ((Object)(object)nearestAI != (Object)null && (fire || isInvestigatingSound)) { Vector3 val = lookTarget - headsight.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Transform val2 = headsight.parent; if ((Object)(object)val2 == (Object)null) { val2 = ((Component)this).transform; } Vector3 val3 = val2.InverseTransformDirection(normalized); float num = Mathf.Atan2(val3.x, val3.z) * 57.29578f; float num2 = Mathf.Sqrt(val3.x * val3.x + val3.z * val3.z); float num3 = (0f - Mathf.Atan2(val3.y, num2)) * 57.29578f; float num4 = 0f; num = Mathf.Clamp(num, 0f - headYawLimit, headYawLimit); num3 = Mathf.Clamp(num3, 0f - headPitchDownLimit, headPitchUpLimit); num4 = Mathf.Clamp(num4, 0f - headRollLimit, headRollLimit); targetHeadAngles = new Vector3(num3, num, num4); currentHeadAngles = Vector3.Lerp(currentHeadAngles, targetHeadAngles, Time.deltaTime * headRotationSpeed); } else { Vector3 eulerAngles = ((Quaternion)(ref headInitialLocalRot)).eulerAngles; if (eulerAngles.x > 180f) { eulerAngles.x -= 360f; } if (eulerAngles.y > 180f) { eulerAngles.y -= 360f; } if (eulerAngles.z > 180f) { eulerAngles.z -= 360f; } currentHeadAngles = Vector3.Lerp(currentHeadAngles, eulerAngles, Time.deltaTime * headRestoreSpeed); } headsight.localRotation = Quaternion.Euler(currentHeadAngles); } private void Start() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Expected O, but got Unknown //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Expected O, but got Unknown //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)headsight != (Object)null) { headInitialLocalRot = headsight.localRotation; headTargetLocalRot = headInitialLocalRot; currentHeadAngles = ((Quaternion)(ref headInitialLocalRot)).eulerAngles; targetHeadAngles = currentHeadAngles; Debug.Log((object)("Head initial rotation:" + headsight.localEulerAngles)); } ((MonoBehaviour)this).StartCoroutine(DetectionCoroutine()); if ((Object)(object)NB != (Object)null) { NB.activeRagdoll = AR; NB.speed = 2f; NB.turnTorque = 8f; } dic.Add("Follow me.", FollowUSEC); dic.Add("Stay here.", StopUSEC); dic.Add("Stop.", StopUSEC); dic.Add("Hold position.", StopUSEC); dic.Add("Follow.", FollowUSEC); dic.Add("Stoy.", StopBothBEAR); dic.Add("Bashlee.", FollowBEAR); dic.Add("Zav Noi", FollowBEAR); dic.Add("Contact.", FireUSEC); dic.Add("Ready to contact.", FireUSEC); dic.Add("Ready to fire.", FireUSEC); dic.Add("Open fire.", FireUSEC); dic.Add("Safety off.", FireUSEC); dic.Add("Con duct.", FireBEAR); dic.Add("Agoy.", FireBEAR); dic.Add("Hold your fire.", HoldUSEC); dic.Add("Cease fire.", HoldUSEC); dic.Add("Safety on.", HoldUSEC); dic.Add("Stop firing.", HoldUSEC); dic.Add("No shoot.", HoldUSEC); dic.Add("Stop shooting.", HoldUSEC); dic.Add("Stahya.", HoldBEAR); keyword = new KeywordRecognizer(dic.Keys.ToArray()); ((PhraseRecognizer)keyword).OnPhraseRecognized += new PhraseRecognizedDelegate(Keyword_OnPhraseRecognized); ((PhraseRecognizer)keyword).Start(); ConfigureNPCStability(); targetBodyRotation = body.transform.rotation; currentBodyYaw = body.transform.eulerAngles.y; targetBodyYaw = currentBodyYaw; smoothHeadRotation = headsight.localRotation; if ((Object)(object)AR != (Object)null) { originalStandHeight = AR.standHeight; } if (enableArmControlSwitch && (Object)(object)AR != (Object)null) { SetupArmControlSwitch(); } } private void SetupArmControlSwitch() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)handL != (Object)null) { originalLeftHandPos = handL.localPosition; originalLeftHandRot = handL.localRotation; } if ((Object)(object)handR != (Object)null) { originalRightHandPos = handR.localPosition; originalRightHandRot = handR.localRotation; } AR.takeArmControl = true; } private void ConfigureNPCStability() { if ((Object)(object)NB != (Object)null) { NB.maxSpeed = 2.5f; NB.speed = 1.5f; NB.stabilityForce = 25f; NB.antiTiltForce = 20f; NB.maxTiltAngle = 20f; NB.groundStickForce = 40f; NB.turnTorque = 4f; if (isSCAV) { NB.maxSpeed = 2f; NB.stabilityForce = 30f; } else { NB.maxSpeed = 3f; NB.stabilityForce = 20f; } } if ((Object)(object)AR != (Object)null) { AR.rotationForce = 15; AR.rotationSmoothness = 2; } } private void FollowBEAR() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)GM.CurrentPlayerBody).gameObject != (Object)null && Vector3.Distance(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ((Component)this).gameObject.transform.position) < 7.5f) { playerIsBEAR = true; playerIsUSEC = false; if (isBEAR) { follow = true; SM.PlayCoreSound((FVRPooledAudioType)41, sure, ((Component)this).gameObject.transform.position); } } } private void StopBEAR() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)GM.CurrentPlayerBody).gameObject != (Object)null && Vector3.Distance(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ((Component)this).gameObject.transform.position) < 7.5f) { playerIsBEAR = true; playerIsUSEC = false; if (isBEAR) { follow = false; SM.PlayCoreSound((FVRPooledAudioType)41, sure, ((Component)this).gameObject.transform.position); } } } private void FireBEAR() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)GM.CurrentPlayerBody).gameObject != (Object)null && Vector3.Distance(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ((Component)this).gameObject.transform.position) < 7.5f) { playerIsBEAR = true; playerIsUSEC = false; if (isBEAR) { fire = true; SM.PlayCoreSound((FVRPooledAudioType)41, sure, ((Component)this).gameObject.transform.position); } } } private void HoldBEAR() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)GM.CurrentPlayerBody).gameObject != (Object)null && Vector3.Distance(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ((Component)this).gameObject.transform.position) < 7.5f) { playerIsBEAR = true; playerIsUSEC = false; if (isBEAR) { fire = false; SM.PlayCoreSound((FVRPooledAudioType)41, sure, ((Component)this).gameObject.transform.position); } } } private void StopBothBEAR() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)GM.CurrentPlayerBody).gameObject != (Object)null && Vector3.Distance(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ((Component)this).gameObject.transform.position) < 7.5f) { playerIsBEAR = true; playerIsUSEC = false; if (isBEAR) { fire = false; follow = false; SM.PlayCoreSound((FVRPooledAudioType)41, sure, ((Component)this).gameObject.transform.position); } } } private void FollowUSEC() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)GM.CurrentPlayerBody).gameObject != (Object)null && Vector3.Distance(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ((Component)this).gameObject.transform.position) < 7.5f) { playerIsBEAR = false; playerIsUSEC = true; if (isUSEC) { follow = true; SM.PlayCoreSound((FVRPooledAudioType)41, sure, ((Component)this).gameObject.transform.position); } } } private void StopUSEC() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)GM.CurrentPlayerBody).gameObject != (Object)null && Vector3.Distance(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ((Component)this).gameObject.transform.position) < 7.5f) { playerIsBEAR = false; playerIsUSEC = true; if (isUSEC) { follow = false; SM.PlayCoreSound((FVRPooledAudioType)41, sure, ((Component)this).gameObject.transform.position); } } } private void FireUSEC() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)GM.CurrentPlayerBody).gameObject != (Object)null && Vector3.Distance(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ((Component)this).gameObject.transform.position) < 7.5f) { playerIsBEAR = false; playerIsUSEC = true; if (isUSEC) { fire = true; SM.PlayCoreSound((FVRPooledAudioType)41, sure, ((Component)this).gameObject.transform.position); } } } private void HoldUSEC() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)GM.CurrentPlayerBody).gameObject != (Object)null && Vector3.Distance(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ((Component)this).gameObject.transform.position) < 7.5f) { playerIsBEAR = false; playerIsUSEC = true; if (isUSEC) { fire = false; SM.PlayCoreSound((FVRPooledAudioType)41, sure, ((Component)this).gameObject.transform.position); } } } private void StopBothUSEC() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)GM.CurrentPlayerBody).gameObject != (Object)null && Vector3.Distance(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ((Component)this).gameObject.transform.position) < 7.5f) { playerIsBEAR = false; playerIsUSEC = true; if (isUSEC) { fire = false; follow = false; SM.PlayCoreSound((FVRPooledAudioType)41, sure, ((Component)this).gameObject.transform.position); } } } private void OnTriggerEnter(Collider other) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Invalid comparison between Unknown and I4 //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Invalid comparison between Unknown and I4 if ((Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && isContious) { if (!((FVRInteractiveObject)((Component)other).gameObject.GetComponent()).IsHeld && (Object)(object)((Component)other).gameObject.GetComponent().m_quickbeltSlot == (Object)null && (int)((Component)other).gameObject.GetComponent().QBSlotType == 1 && (Object)(object)SlotTorso.CurObject == (Object)null) { SlotTorso.CurObject = ((Component)other).gameObject.GetComponent(); ((Component)other).gameObject.GetComponent().SetQuickBeltSlot(SlotTorso); ((Component)other).gameObject.GetComponent().DistantGrabbable = false; ((FVRInteractiveObject)((Component)other).gameObject.GetComponent()).SetAllCollidersToLayer(false, "Interactable"); } if (!((FVRInteractiveObject)((Component)other).gameObject.GetComponent()).IsHeld && (Object)(object)((Component)other).gameObject.GetComponent().m_quickbeltSlot == (Object)null && (int)((Component)other).gameObject.GetComponent().QBSlotType == 1985 && (Object)(object)SlotHead.CurObject == (Object)null) { SlotHead.CurObject = ((Component)other).gameObject.GetComponent(); ((Component)other).gameObject.GetComponent().SetQuickBeltSlot(SlotHead); ((Component)other).gameObject.GetComponent().DistantGrabbable = false; ((FVRInteractiveObject)((Component)other).gameObject.GetComponent()).SetAllCollidersToLayer(false, "Interactable"); } } } private void OnTriggerStay(Collider other) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_0835: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_0698: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_093e: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_0963: Unknown result type (might be due to invalid IL or missing references) //IL_0973: Unknown result type (might be due to invalid IL or missing references) //IL_0902: Unknown result type (might be due to invalid IL or missing references) //IL_09d9: Unknown result type (might be due to invalid IL or missing references) //IL_09e9: Unknown result type (might be due to invalid IL or missing references) //IL_099e: Unknown result type (might be due to invalid IL or missing references) //IL_09ae: Unknown result type (might be due to invalid IL or missing references) //IL_09be: Unknown result type (might be due to invalid IL or missing references) if (!isContious) { return; } if ((Object)(object)curMortar == (Object)null && (Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && ((Object)((Component)other).gameObject).name == "M224Mortar(Clone)" && ((Component)other).gameObject.GetComponent().m_isCol && (int)((Component)other).gameObject.GetComponent().Mode != 0) { hasMortar = true; nearestAI = null; currentSosigTarget = null; itemTar = ((Component)other).gameObject; if (follow && ((Behaviour)NMA).enabled) { NMA.SetDestination(((Component)other).gameObject.transform.position); } NMA.stoppingDistance = 0f; if (Vector3.Distance(((Component)NMA).gameObject.transform.position, ((Component)other).gameObject.transform.position) <= 1.5f) { if ((Object)(object)curGun != (Object)null) { if ((Object)(object)((Component)curGun).gameObject.GetComponent() != (Object)null) { ((Component)curGun).gameObject.GetComponent().isKinematic = false; ((Component)curGun).gameObject.GetComponent().useGravity = true; } curGun = null; } if ((Object)(object)curMag != (Object)null) { if ((Object)(object)((Component)curMag).gameObject.GetComponent() != (Object)null) { ((Component)curMag).gameObject.GetComponent().isKinematic = false; ((Component)curMag).gameObject.GetComponent().useGravity = true; } curMag = null; } curMortar = ((Component)other).gameObject.GetComponent(); hasMortar = true; itemTar = null; } } if ((Object)(object)curGun != (Object)null && (Object)(object)curMag != (Object)null && (Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && ((Component)other).gameObject.GetComponent().isContious) { SOSIGHMGUNNER component = ((Component)other).gameObject.GetComponent(); if (isSCAV && !component.isSCAV && !currentAI.Contains(component) && component.isContious) { currentAI.Add(component); } if (!isSCAV) { if (isBEAR && !isUSEC) { if (!component.isSCAV && !component.isBEAR && !currentAI.Contains(component) && component.isContious) { currentAI.Add(component); } if (component.isSCAV && !currentAI.Contains(component) && component.isContious) { currentAI.Add(component); } } if (!isBEAR && isUSEC) { if (!component.isSCAV && component.isBEAR && !currentAI.Contains(component) && component.isContious) { currentAI.Add(component); } if (component.isSCAV && !currentAI.Contains(component) && component.isContious) { currentAI.Add(component); } } } } if ((Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && (Object)(object)curGun == (Object)null && !hasMortar && (Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && (Object)(object)((FVRPhysicalObject)((Component)other).gameObject.GetComponent()).m_quickbeltSlot == (Object)null && !((FVRInteractiveObject)((Component)other).gameObject.GetComponent()).m_isHeld && ((FVRFireArm)((Component)other).gameObject.GetComponent()).UsesMagazines) { if ((Object)(object)((FVRFireArm)((Component)other).gameObject.GetComponent()).Magazine == (Object)null && (Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && !((Component)other).gameObject.GetComponent().isKinematic) { itemTar = ((Component)other).gameObject; if (follow && ((Behaviour)NMA).enabled) { NMA.SetDestination(((Component)other).gameObject.transform.position); } NMA.stoppingDistance = 0f; if (Vector3.Distance(body.gameObject.transform.position, ((Component)other).gameObject.transform.position) <= 1f) { if (Vector3.Distance(((Component)handR).gameObject.transform.position, ((Component)other).gameObject.transform.position) > 0.15f) { ((Component)handR).transform.position = Vector3.Lerp(((Component)handR).transform.position, ((Component)other).gameObject.transform.position, Time.deltaTime * 15f); } if (Vector3.Distance(((Component)handR).gameObject.transform.position, ((Component)other).gameObject.transform.position) <= 1f) { curGun = ((Component)other).gameObject.GetComponent(); } } } if ((Object)(object)((FVRFireArm)((Component)other).gameObject.GetComponent()).Magazine != (Object)null && !((FVRFireArm)((Component)other).gameObject.GetComponent()).Magazine.IsIntegrated && (Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && !((Component)other).gameObject.GetComponent().isKinematic) { itemTar = ((Component)other).gameObject; if (follow && ((Behaviour)NMA).enabled) { NMA.SetDestination(((Component)other).gameObject.transform.position); } NMA.stoppingDistance = 0f; if (Vector3.Distance(body.gameObject.transform.position, ((Component)other).gameObject.transform.position) <= 1f) { if (Vector3.Distance(((Component)handR).gameObject.transform.position, ((Component)other).gameObject.transform.position) > 0.15f) { ((Component)handR).transform.position = Vector3.Lerp(((Component)handR).transform.position, ((Component)other).gameObject.transform.position, Time.deltaTime * 15f); } if (Vector3.Distance(((Component)handR).gameObject.transform.position, ((Component)other).gameObject.transform.position) <= 1f) { curGun = ((Component)other).gameObject.GetComponent(); } } } } if (!((Object)(object)((Component)other).gameObject.GetComponent() != (Object)null) || !((Object)(object)curGun != (Object)null) || !((Object)(object)curMag == (Object)null) || hasMortar) { return; } curMortar = null; if (!curGun.UsesMagazines || ((Component)other).gameObject.GetComponent().m_numRounds <= 0 || ((Component)other).gameObject.GetComponent().MagazineType != curGun.MagazineType || !((Object)(object)((FVRPhysicalObject)((Component)other).gameObject.GetComponent()).m_quickbeltSlot == (Object)null) || ((FVRInteractiveObject)((Component)other).gameObject.GetComponent()).m_isHeld || !((FVRPhysicalObject)((Component)other).gameObject.GetComponent()).DistantGrabbable || !((Object)(object)curGun.Magazine == (Object)null) || !((Object)(object)((Component)other).gameObject.GetComponent() != (Object)null) || ((Component)other).gameObject.GetComponent().isKinematic) { return; } itemTar = ((Component)other).gameObject; if (follow && ((Behaviour)NMA).enabled) { NMA.SetDestination(((Component)other).gameObject.transform.position); } NMA.stoppingDistance = 0f; if (!(Vector3.Distance(body.gameObject.transform.position, ((Component)other).gameObject.transform.position) <= 1f)) { return; } if (Vector3.Distance(((Component)handL).gameObject.transform.position, ((Component)other).gameObject.transform.position) > 0.15f) { ((Component)handL).transform.position = Vector3.Lerp(((Component)handL).transform.position, ((Component)other).gameObject.transform.position, Time.deltaTime * 15f); } if (Vector3.Distance(((Component)handL).gameObject.transform.position, ((Component)other).gameObject.transform.position) <= 1f) { curMag = ((Component)other).gameObject.GetComponent(); if ((Object)(object)itemTar != (Object)null) { itemTar = null; } } } private void SmoothAxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis, float smoothSpeed = 10f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) if (lookPos == Vector3.zero) { return; } Vector3 val = lookPos - tr_self.position; if (!(((Vector3)(ref val)).magnitude < 0.01f)) { Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); float num2 = smoothSpeed * Time.deltaTime; float num3 = Mathf.Min(num, num2); Quaternion rotation = Quaternion.AngleAxis(num3, normalized) * tr_self.rotation; tr_self.rotation = rotation; Vector3 localEulerAngles = tr_self.localEulerAngles; if (directionAxis == Vector3.forward) { tr_self.localEulerAngles = new Vector3(localEulerAngles.x, localEulerAngles.y, 0f); } } } private void SmoothAxisLookAtY(Transform tr_self, Vector3 lookPos, Vector3 directionAxis, float smoothSpeed = 10f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) if (lookPos == Vector3.zero) { return; } Vector3 val = lookPos - tr_self.position; if (!(((Vector3)(ref val)).magnitude < 0.01f)) { Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); float num2 = smoothSpeed * Time.deltaTime; float num3 = Mathf.Min(num, num2); Quaternion rotation = Quaternion.AngleAxis(num3, normalized) * tr_self.rotation; tr_self.rotation = rotation; Vector3 localEulerAngles = tr_self.localEulerAngles; if (directionAxis == Vector3.forward) { tr_self.localEulerAngles = new Vector3(0f, localEulerAngles.y, 0f); } } } private float GetSmoothYawToTarget(Transform tr_self, Vector3 lookPos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) Vector3 val = lookPos - tr_self.position; val.y = 0f; if (((Vector3)(ref val)).magnitude < 0.01f) { return tr_self.eulerAngles.y; } ((Vector3)(ref val)).Normalize(); Quaternion val2 = Quaternion.LookRotation(val); return ((Quaternion)(ref val2)).eulerAngles.y; } private void UpdateHeadAndBodySync(Vector3 lookTarget) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)headsight == (Object)null || lookTarget == Vector3.zero) { return; } Vector3 val = lookTarget - headsight.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Transform val2 = headsight.parent; if ((Object)(object)val2 == (Object)null) { val2 = ((Component)this).transform; } Vector3 val3 = val2.InverseTransformDirection(normalized); float num = Mathf.Atan2(val3.x, val3.z) * 57.29578f; float num2 = num; num = Mathf.Clamp(num, 0f - headYawLimit, headYawLimit); float num3 = 0f; if (Mathf.Abs(num2) > headYawLimit) { if (num2 > headYawLimit) { num3 = num2 - headYawLimit; } else if (num2 < 0f - headYawLimit) { num3 = num2 + headYawLimit; } if (Mathf.Abs(num3) > bodyFollowHeadThreshold) { UpdateBodyFollowWithNavMesh(num3); } } float num4 = Mathf.Sqrt(val3.x * val3.x + val3.z * val3.z); float num5 = (0f - Mathf.Atan2(val3.y, num4)) * 57.29578f; num5 = Mathf.Clamp(num5, 0f - headPitchDownLimit, headPitchUpLimit); targetHeadAngles = new Vector3(num5, num, 0f); currentHeadAngles = Vector3.Lerp(currentHeadAngles, targetHeadAngles, Time.deltaTime * headRotationSpeed); headsight.localRotation = Quaternion.Euler(currentHeadAngles); } private void UpdateBodyFollowWithNavMesh(float excessYaw) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)NMA == (Object)null || !((Behaviour)NMA).enabled || (Object)(object)nearestAI == (Object)null) { return; } Vector3 val = nearestAI.position - body.transform.position; val.y = 0f; if (((Vector3)(ref val)).magnitude > 0.1f) { Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized); body.transform.rotation = Quaternion.Slerp(body.transform.rotation, val2, bodyFollowHeadSpeed * Time.deltaTime); if (NMA.updateRotation) { bool updateRotation = NMA.updateRotation; NMA.updateRotation = false; NMA.updateRotation = updateRotation; } } } private void UpdateBodyRestore() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)NMA == (Object)null) && ((Behaviour)NMA).enabled) { Quaternion val = Quaternion.LookRotation(Vector3.forward); float num = Vector3.Angle(body.transform.forward, Vector3.forward); if (num > 5f) { Quaternion rotation = Quaternion.Slerp(body.transform.rotation, val, headRestoreSpeed * Time.deltaTime); body.transform.rotation = rotation; } } } private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f); } private void AxisLookAtY(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(0f, tr_self.localEulerAngles.y, 0f); } private void AxisLookAtX(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, 0f, 0f); } private void Update() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_08ba: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_0a9c: Unknown result type (might be due to invalid IL or missing references) //IL_0abc: Unknown result type (might be due to invalid IL or missing references) //IL_0adc: Unknown result type (might be due to invalid IL or missing references) //IL_0afc: Unknown result type (might be due to invalid IL or missing references) //IL_0b0c: Unknown result type (might be due to invalid IL or missing references) //IL_0b11: Unknown result type (might be due to invalid IL or missing references) //IL_08ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0b3c: Unknown result type (might be due to invalid IL or missing references) //IL_0b41: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0b86: Unknown result type (might be due to invalid IL or missing references) //IL_0b8b: Unknown result type (might be due to invalid IL or missing references) //IL_0ba0: Unknown result type (might be due to invalid IL or missing references) //IL_0bca: Unknown result type (might be due to invalid IL or missing references) //IL_0bcf: Unknown result type (might be due to invalid IL or missing references) //IL_0be4: Unknown result type (might be due to invalid IL or missing references) //IL_0a4b: Unknown result type (might be due to invalid IL or missing references) //IL_0a6f: Unknown result type (might be due to invalid IL or missing references) //IL_0c33: Unknown result type (might be due to invalid IL or missing references) //IL_0c4f: Unknown result type (might be due to invalid IL or missing references) //IL_0c54: Unknown result type (might be due to invalid IL or missing references) //IL_0cba: Unknown result type (might be due to invalid IL or missing references) //IL_0cc5: Unknown result type (might be due to invalid IL or missing references) //IL_0ccf: Unknown result type (might be due to invalid IL or missing references) //IL_0cd4: Unknown result type (might be due to invalid IL or missing references) //IL_0c66: Unknown result type (might be due to invalid IL or missing references) //IL_0ca2: Unknown result type (might be due to invalid IL or missing references) //IL_1001: Unknown result type (might be due to invalid IL or missing references) //IL_1006: Unknown result type (might be due to invalid IL or missing references) //IL_1046: Unknown result type (might be due to invalid IL or missing references) //IL_104b: Unknown result type (might be due to invalid IL or missing references) //IL_10e5: Unknown result type (might be due to invalid IL or missing references) //IL_10fa: Unknown result type (might be due to invalid IL or missing references) //IL_10ff: Unknown result type (might be due to invalid IL or missing references) //IL_1113: Unknown result type (might be due to invalid IL or missing references) //IL_1118: Unknown result type (might be due to invalid IL or missing references) //IL_1131: Unknown result type (might be due to invalid IL or missing references) //IL_1136: Unknown result type (might be due to invalid IL or missing references) //IL_113f: Unknown result type (might be due to invalid IL or missing references) //IL_114f: Unknown result type (might be due to invalid IL or missing references) //IL_0e6a: Unknown result type (might be due to invalid IL or missing references) //IL_0e99: Unknown result type (might be due to invalid IL or missing references) //IL_0e9e: Unknown result type (might be due to invalid IL or missing references) //IL_0eac: Unknown result type (might be due to invalid IL or missing references) //IL_0ecc: Unknown result type (might be due to invalid IL or missing references) //IL_0eec: Unknown result type (might be due to invalid IL or missing references) //IL_0f0c: Unknown result type (might be due to invalid IL or missing references) //IL_0f38: Unknown result type (might be due to invalid IL or missing references) //IL_0f3d: Unknown result type (might be due to invalid IL or missing references) //IL_0f6c: Unknown result type (might be due to invalid IL or missing references) //IL_0f71: Unknown result type (might be due to invalid IL or missing references) //IL_0f7f: Unknown result type (might be due to invalid IL or missing references) //IL_1181: Unknown result type (might be due to invalid IL or missing references) //IL_1196: Unknown result type (might be due to invalid IL or missing references) //IL_11a6: Unknown result type (might be due to invalid IL or missing references) //IL_11da: Unknown result type (might be due to invalid IL or missing references) //IL_11df: Unknown result type (might be due to invalid IL or missing references) //IL_125c: Unknown result type (might be due to invalid IL or missing references) //IL_1261: Unknown result type (might be due to invalid IL or missing references) //IL_1222: Unknown result type (might be due to invalid IL or missing references) //IL_1246: Unknown result type (might be due to invalid IL or missing references) //IL_127f: Unknown result type (might be due to invalid IL or missing references) //IL_1284: Unknown result type (might be due to invalid IL or missing references) //IL_12b3: Unknown result type (might be due to invalid IL or missing references) //IL_12b8: Unknown result type (might be due to invalid IL or missing references) //IL_12d3: Unknown result type (might be due to invalid IL or missing references) //IL_12d8: Unknown result type (might be due to invalid IL or missing references) //IL_12ec: Unknown result type (might be due to invalid IL or missing references) //IL_12f1: Unknown result type (might be due to invalid IL or missing references) //IL_12fa: Unknown result type (might be due to invalid IL or missing references) //IL_1415: Unknown result type (might be due to invalid IL or missing references) //IL_1420: Unknown result type (might be due to invalid IL or missing references) //IL_1430: Unknown result type (might be due to invalid IL or missing references) //IL_1450: Unknown result type (might be due to invalid IL or missing references) //IL_145b: Unknown result type (might be due to invalid IL or missing references) //IL_146b: Unknown result type (might be due to invalid IL or missing references) //IL_1486: Unknown result type (might be due to invalid IL or missing references) //IL_14a1: Unknown result type (might be due to invalid IL or missing references) //IL_15a8: Unknown result type (might be due to invalid IL or missing references) //IL_15df: Unknown result type (might be due to invalid IL or missing references) //IL_1622: Unknown result type (might be due to invalid IL or missing references) //IL_1627: Unknown result type (might be due to invalid IL or missing references) //IL_155e: Unknown result type (might be due to invalid IL or missing references) //IL_25fe: Unknown result type (might be due to invalid IL or missing references) //IL_2603: Unknown result type (might be due to invalid IL or missing references) //IL_2620: Unknown result type (might be due to invalid IL or missing references) //IL_2640: Unknown result type (might be due to invalid IL or missing references) //IL_2650: Unknown result type (might be due to invalid IL or missing references) //IL_2655: Unknown result type (might be due to invalid IL or missing references) //IL_2669: Unknown result type (might be due to invalid IL or missing references) //IL_266e: Unknown result type (might be due to invalid IL or missing references) //IL_2682: Unknown result type (might be due to invalid IL or missing references) //IL_2687: Unknown result type (might be due to invalid IL or missing references) //IL_2690: Unknown result type (might be due to invalid IL or missing references) //IL_26a0: Unknown result type (might be due to invalid IL or missing references) //IL_27d1: Unknown result type (might be due to invalid IL or missing references) //IL_2800: Unknown result type (might be due to invalid IL or missing references) //IL_2805: Unknown result type (might be due to invalid IL or missing references) //IL_2813: Unknown result type (might be due to invalid IL or missing references) //IL_2833: Unknown result type (might be due to invalid IL or missing references) //IL_2853: Unknown result type (might be due to invalid IL or missing references) //IL_2873: Unknown result type (might be due to invalid IL or missing references) //IL_289e: Unknown result type (might be due to invalid IL or missing references) //IL_28c3: Unknown result type (might be due to invalid IL or missing references) //IL_28e8: Unknown result type (might be due to invalid IL or missing references) //IL_2913: Unknown result type (might be due to invalid IL or missing references) //IL_2918: Unknown result type (might be due to invalid IL or missing references) //IL_2947: Unknown result type (might be due to invalid IL or missing references) //IL_294c: Unknown result type (might be due to invalid IL or missing references) //IL_295a: Unknown result type (might be due to invalid IL or missing references) //IL_299a: Unknown result type (might be due to invalid IL or missing references) //IL_29b5: Unknown result type (might be due to invalid IL or missing references) //IL_29c5: Unknown result type (might be due to invalid IL or missing references) //IL_29e6: Unknown result type (might be due to invalid IL or missing references) //IL_29f0: Unknown result type (might be due to invalid IL or missing references) //IL_29f5: Unknown result type (might be due to invalid IL or missing references) //IL_254a: Unknown result type (might be due to invalid IL or missing references) //IL_255e: Unknown result type (might be due to invalid IL or missing references) //IL_256e: Unknown result type (might be due to invalid IL or missing references) //IL_2a25: Unknown result type (might be due to invalid IL or missing references) //IL_2a2b: Invalid comparison between Unknown and I4 //IL_25a1: Unknown result type (might be due to invalid IL or missing references) //IL_25b5: Unknown result type (might be due to invalid IL or missing references) //IL_25c5: Unknown result type (might be due to invalid IL or missing references) //IL_22cd: Unknown result type (might be due to invalid IL or missing references) //IL_22dd: Unknown result type (might be due to invalid IL or missing references) //IL_2b3a: Unknown result type (might be due to invalid IL or missing references) //IL_2b40: Invalid comparison between Unknown and I4 //IL_2514: Unknown result type (might be due to invalid IL or missing references) //IL_2378: Unknown result type (might be due to invalid IL or missing references) //IL_2388: Unknown result type (might be due to invalid IL or missing references) //IL_1747: Unknown result type (might be due to invalid IL or missing references) //IL_1757: Unknown result type (might be due to invalid IL or missing references) //IL_1767: Unknown result type (might be due to invalid IL or missing references) //IL_1715: Unknown result type (might be due to invalid IL or missing references) //IL_2318: Unknown result type (might be due to invalid IL or missing references) //IL_2338: Unknown result type (might be due to invalid IL or missing references) //IL_2348: Unknown result type (might be due to invalid IL or missing references) //IL_2358: Unknown result type (might be due to invalid IL or missing references) //IL_23d7: Unknown result type (might be due to invalid IL or missing references) //IL_23fc: Unknown result type (might be due to invalid IL or missing references) //IL_2a97: Unknown result type (might be due to invalid IL or missing references) //IL_2ab1: Unknown result type (might be due to invalid IL or missing references) //IL_2ac1: Unknown result type (might be due to invalid IL or missing references) //IL_2ae2: Unknown result type (might be due to invalid IL or missing references) //IL_2aec: Unknown result type (might be due to invalid IL or missing references) //IL_2af1: Unknown result type (might be due to invalid IL or missing references) //IL_186e: Unknown result type (might be due to invalid IL or missing references) //IL_187e: Unknown result type (might be due to invalid IL or missing references) //IL_1847: Unknown result type (might be due to invalid IL or missing references) //IL_2bb6: Unknown result type (might be due to invalid IL or missing references) //IL_2bc1: Unknown result type (might be due to invalid IL or missing references) //IL_199c: Unknown result type (might be due to invalid IL or missing references) //IL_18e4: Unknown result type (might be due to invalid IL or missing references) //IL_18f4: Unknown result type (might be due to invalid IL or missing references) //IL_18a9: Unknown result type (might be due to invalid IL or missing references) //IL_18b9: Unknown result type (might be due to invalid IL or missing references) //IL_18c9: Unknown result type (might be due to invalid IL or missing references) //IL_2d2f: Unknown result type (might be due to invalid IL or missing references) //IL_2d3a: Unknown result type (might be due to invalid IL or missing references) //IL_2c59: Unknown result type (might be due to invalid IL or missing references) //IL_2c73: Unknown result type (might be due to invalid IL or missing references) //IL_2c83: Unknown result type (might be due to invalid IL or missing references) //IL_2ca4: Unknown result type (might be due to invalid IL or missing references) //IL_2cae: Unknown result type (might be due to invalid IL or missing references) //IL_2cb3: Unknown result type (might be due to invalid IL or missing references) //IL_1a0b: Unknown result type (might be due to invalid IL or missing references) //IL_1a1b: Unknown result type (might be due to invalid IL or missing references) //IL_1940: Unknown result type (might be due to invalid IL or missing references) //IL_191f: Unknown result type (might be due to invalid IL or missing references) //IL_3032: Unknown result type (might be due to invalid IL or missing references) //IL_3047: Unknown result type (might be due to invalid IL or missing references) //IL_2e98: Unknown result type (might be due to invalid IL or missing references) //IL_2eb2: Unknown result type (might be due to invalid IL or missing references) //IL_2ec2: Unknown result type (might be due to invalid IL or missing references) //IL_2ee3: Unknown result type (might be due to invalid IL or missing references) //IL_2eed: Unknown result type (might be due to invalid IL or missing references) //IL_2ef2: Unknown result type (might be due to invalid IL or missing references) //IL_2dd2: Unknown result type (might be due to invalid IL or missing references) //IL_2dec: Unknown result type (might be due to invalid IL or missing references) //IL_2dfc: Unknown result type (might be due to invalid IL or missing references) //IL_2e1d: Unknown result type (might be due to invalid IL or missing references) //IL_2e27: Unknown result type (might be due to invalid IL or missing references) //IL_2e2c: Unknown result type (might be due to invalid IL or missing references) //IL_1cdb: Unknown result type (might be due to invalid IL or missing references) //IL_1ceb: Unknown result type (might be due to invalid IL or missing references) //IL_1cfb: Unknown result type (might be due to invalid IL or missing references) //IL_1d1b: Unknown result type (might be due to invalid IL or missing references) //IL_1a81: Unknown result type (might be due to invalid IL or missing references) //IL_1a91: Unknown result type (might be due to invalid IL or missing references) //IL_1a46: Unknown result type (might be due to invalid IL or missing references) //IL_1a56: Unknown result type (might be due to invalid IL or missing references) //IL_1a66: Unknown result type (might be due to invalid IL or missing references) //IL_36e6: Unknown result type (might be due to invalid IL or missing references) //IL_36eb: Unknown result type (might be due to invalid IL or missing references) //IL_36f9: Unknown result type (might be due to invalid IL or missing references) //IL_367f: Unknown result type (might be due to invalid IL or missing references) //IL_36a0: Unknown result type (might be due to invalid IL or missing references) //IL_36a5: Unknown result type (might be due to invalid IL or missing references) //IL_345e: Unknown result type (might be due to invalid IL or missing references) //IL_3473: Unknown result type (might be due to invalid IL or missing references) //IL_1fc2: Unknown result type (might be due to invalid IL or missing references) //IL_1add: Unknown result type (might be due to invalid IL or missing references) //IL_1b03: Unknown result type (might be due to invalid IL or missing references) //IL_1b08: Unknown result type (might be due to invalid IL or missing references) //IL_1b33: Unknown result type (might be due to invalid IL or missing references) //IL_1b38: Unknown result type (might be due to invalid IL or missing references) //IL_1abc: Unknown result type (might be due to invalid IL or missing references) //IL_19f4: Unknown result type (might be due to invalid IL or missing references) //IL_38d5: Unknown result type (might be due to invalid IL or missing references) //IL_38da: Unknown result type (might be due to invalid IL or missing references) //IL_38e8: Unknown result type (might be due to invalid IL or missing references) //IL_386e: Unknown result type (might be due to invalid IL or missing references) //IL_388f: Unknown result type (might be due to invalid IL or missing references) //IL_3894: Unknown result type (might be due to invalid IL or missing references) //IL_3497: Unknown result type (might be due to invalid IL or missing references) //IL_34ac: Unknown result type (might be due to invalid IL or missing references) //IL_3073: Unknown result type (might be due to invalid IL or missing references) //IL_3088: Unknown result type (might be due to invalid IL or missing references) //IL_1d4e: Unknown result type (might be due to invalid IL or missing references) //IL_1d63: Unknown result type (might be due to invalid IL or missing references) //IL_32a1: Unknown result type (might be due to invalid IL or missing references) //IL_32b6: Unknown result type (might be due to invalid IL or missing references) //IL_30a8: Unknown result type (might be due to invalid IL or missing references) //IL_30bd: Unknown result type (might be due to invalid IL or missing references) //IL_30cd: Unknown result type (might be due to invalid IL or missing references) //IL_30d2: Unknown result type (might be due to invalid IL or missing references) //IL_2faa: Unknown result type (might be due to invalid IL or missing references) //IL_2fc4: Unknown result type (might be due to invalid IL or missing references) //IL_2fd4: Unknown result type (might be due to invalid IL or missing references) //IL_2ff5: Unknown result type (might be due to invalid IL or missing references) //IL_2fff: Unknown result type (might be due to invalid IL or missing references) //IL_3004: Unknown result type (might be due to invalid IL or missing references) //IL_2028: Unknown result type (might be due to invalid IL or missing references) //IL_2048: Unknown result type (might be due to invalid IL or missing references) //IL_1eaa: Unknown result type (might be due to invalid IL or missing references) //IL_1eba: Unknown result type (might be due to invalid IL or missing references) //IL_1eca: Unknown result type (might be due to invalid IL or missing references) //IL_1eef: Unknown result type (might be due to invalid IL or missing references) //IL_1f14: Unknown result type (might be due to invalid IL or missing references) //IL_1f2e: Unknown result type (might be due to invalid IL or missing references) //IL_1f3e: Unknown result type (might be due to invalid IL or missing references) //IL_1dc9: Unknown result type (might be due to invalid IL or missing references) //IL_1dde: Unknown result type (might be due to invalid IL or missing references) //IL_1d8e: Unknown result type (might be due to invalid IL or missing references) //IL_1d9e: Unknown result type (might be due to invalid IL or missing references) //IL_1dae: Unknown result type (might be due to invalid IL or missing references) //IL_334a: Unknown result type (might be due to invalid IL or missing references) //IL_335f: Unknown result type (might be due to invalid IL or missing references) //IL_336f: Unknown result type (might be due to invalid IL or missing references) //IL_3390: Unknown result type (might be due to invalid IL or missing references) //IL_339a: Unknown result type (might be due to invalid IL or missing references) //IL_339f: Unknown result type (might be due to invalid IL or missing references) //IL_33c9: Unknown result type (might be due to invalid IL or missing references) //IL_33de: Unknown result type (might be due to invalid IL or missing references) //IL_33ee: Unknown result type (might be due to invalid IL or missing references) //IL_3418: Unknown result type (might be due to invalid IL or missing references) //IL_342d: Unknown result type (might be due to invalid IL or missing references) //IL_343d: Unknown result type (might be due to invalid IL or missing references) //IL_322b: Unknown result type (might be due to invalid IL or missing references) //IL_3245: Unknown result type (might be due to invalid IL or missing references) //IL_3255: Unknown result type (might be due to invalid IL or missing references) //IL_3276: Unknown result type (might be due to invalid IL or missing references) //IL_3280: Unknown result type (might be due to invalid IL or missing references) //IL_3285: Unknown result type (might be due to invalid IL or missing references) //IL_30f2: Unknown result type (might be due to invalid IL or missing references) //IL_3102: Unknown result type (might be due to invalid IL or missing references) //IL_1e0e: Unknown result type (might be due to invalid IL or missing references) //IL_1e23: Unknown result type (might be due to invalid IL or missing references) //IL_31a9: Unknown result type (might be due to invalid IL or missing references) //IL_31c3: Unknown result type (might be due to invalid IL or missing references) //IL_31d3: Unknown result type (might be due to invalid IL or missing references) //IL_31f4: Unknown result type (might be due to invalid IL or missing references) //IL_31fe: Unknown result type (might be due to invalid IL or missing references) //IL_3203: Unknown result type (might be due to invalid IL or missing references) //IL_312d: Unknown result type (might be due to invalid IL or missing references) //IL_3142: Unknown result type (might be due to invalid IL or missing references) //IL_3152: Unknown result type (might be due to invalid IL or missing references) //IL_3173: Unknown result type (might be due to invalid IL or missing references) //IL_317d: Unknown result type (might be due to invalid IL or missing references) //IL_3182: Unknown result type (might be due to invalid IL or missing references) //IL_1bb8: Unknown result type (might be due to invalid IL or missing references) //IL_1bc9: Unknown result type (might be due to invalid IL or missing references) //IL_1bd3: Unknown result type (might be due to invalid IL or missing references) //IL_1be3: Unknown result type (might be due to invalid IL or missing references) //IL_1bf3: Unknown result type (might be due to invalid IL or missing references) //IL_1bfe: Unknown result type (might be due to invalid IL or missing references) //IL_1c26: Unknown result type (might be due to invalid IL or missing references) //IL_1c36: Unknown result type (might be due to invalid IL or missing references) curnmay = ((Component)NMA).gameObject.transform.position.y; heightslope.transform.localPosition = Vector3.Lerp(heightslope.transform.localPosition, new Vector3(0f, curnmay - lastnmay, 0f), Time.deltaTime * 5f); lastnmay = curnmay; body.transform.position = heightref.transform.position; MortarTarg.gameObject.transform.SetParent((Transform)null); if ((Object)(object)itemTar != (Object)null && Vector3.Distance(itemTar.transform.position, body.transform.position) > 3f) { itemTar = null; } if ((Object)(object)curGun != (Object)null) { ArmL.solver.arm.palmToThumbAxis = new Vector3(0f, 0f, 4f); ArmR.solver.arm.palmToThumbAxis = new Vector3(0f, 0f, 2.25f); } else if ((Object)(object)curGun == (Object)null) { ArmL.solver.arm.palmToThumbAxis = new Vector3(0f, 0f, 2f); ArmR.solver.arm.palmToThumbAxis = new Vector3(0f, 0f, 2.25f); } if ((Object)(object)GM.CurrentPlayerBody != (Object)null && (Object)(object)curGun != (Object)null && (Object)(object)curMag != (Object)null && Vector3.Distance(((Component)this).gameObject.transform.position, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position) <= 15f) { AxisLookAt(((Component)headtoplayer).transform, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ((Component)headtoplayer).transform.forward); RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)headtoplayer).transform.position, ((Component)headtoplayer).transform.forward, ref val, Vector3.Distance(((Component)headtoplayer).transform.position, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position), LayerMask.op_Implicit(LMMASK))) { if (((RaycastHit)(ref val)).distance < Vector3.Distance(((Component)headtoplayer).transform.position, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position) - 1f) { sawPlayer = false; } else if (((RaycastHit)(ref val)).distance >= Vector3.Distance(((Component)headtoplayer).transform.position, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position) - 1f) { sawPlayer = true; } } else { sawPlayer = true; } if (sawPlayer) { if (isSCAV) { nearestAI = ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform; } if (!isSCAV) { if (isBEAR && !playerIsBEAR) { nearestAI = ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform; } if (isUSEC && !playerIsUSEC) { nearestAI = ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform; } } } } if ((Object)(object)nearestAI != (Object)null) { if (cdlost <= 0f) { nearestAI = null; cdlost = 10f; } RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Component)headsight).transform.position, ((Component)headsight).transform.forward, ref val2, Vector3.Distance(((Component)headsight).transform.position, ((Component)nearestAI).gameObject.transform.position), LayerMask.op_Implicit(LMMASK))) { float num = ((!((Object)(object)((Component)nearestAI).GetComponentInParent() != (Object)null)) ? 1f : 2f); if (((RaycastHit)(ref val2)).distance < Vector3.Distance(((Component)headsight).transform.position, ((Component)nearestAI).gameObject.transform.position) - num) { cdlost -= Time.deltaTime; } else { cdlost = 10f; } } SmoothAxisLookAt(((Component)headsight).transform, ((Component)nearestAI).gameObject.transform.position, Vector3.forward); if ((Object)(object)nearestAI == (Object)(object)((Component)GM.CurrentPlayerBody.Head).gameObject.transform) { if (isBEAR && playerIsBEAR) { nearestAI = null; } if (isUSEC && playerIsUSEC) { nearestAI = null; } } if ((Object)(object)((Component)nearestAI).gameObject.GetComponent() != (Object)null && !((Component)nearestAI).gameObject.GetComponent().isContious) { nearestAI = null; } } isLowHealth = R.isLowHealth; isContious = !R.ragdolled; if (R.dead) { NMA.acceleration = 0f; NMA.speed = 0f; ((Behaviour)NMA).enabled = false; ((Component)NMA).gameObject.transform.position = body.transform.position; if (!isHurt) { isHurt = true; SM.PlayCoreSound((FVRPooledAudioType)41, hurt, ((Component)this).gameObject.transform.position); } ((Behaviour)ArmL).enabled = false; ((Behaviour)ArmR).enabled = false; ((Behaviour)LegL).enabled = false; ((Behaviour)LegR).enabled = false; if ((Object)(object)curMag != (Object)null) { if ((Object)(object)((Component)curMag).gameObject.GetComponent() != (Object)null) { ((Component)curMag).gameObject.GetComponent().useGravity = true; ((Component)curMag).gameObject.GetComponent().isKinematic = false; } curMag = null; } if ((Object)(object)curGun != (Object)null) { if ((Object)(object)curGun.Magazine != (Object)null) { curGun.EjectMag(false); } if ((Object)(object)((Component)curGun).gameObject.GetComponent() != (Object)null) { ((Component)curGun).gameObject.GetComponent().useGravity = true; ((Component)curGun).gameObject.GetComponent().isKinematic = false; } curGun = null; } newMag = null; cocked = false; detectCol.enabled = false; pouched = false; ((Component)aimRoot).transform.localEulerAngles = new Vector3(0f, 0f, 0f); aimingpoint.transform.localEulerAngles = new Vector3(0f, 0f, 0f); ((Behaviour)R).enabled = false; ((Behaviour)this).enabled = false; } if (!isContious) { NMA.acceleration = 0f; NMA.speed = 0f; ((Behaviour)NMA).enabled = false; ((Component)NMA).gameObject.transform.position = body.transform.position; if (!isHurt) { isHurt = true; SM.PlayCoreSound((FVRPooledAudioType)41, hurt, ((Component)this).gameObject.transform.position); } ((Behaviour)ArmL).enabled = false; ((Behaviour)ArmR).enabled = false; ((Behaviour)LegL).enabled = false; ((Behaviour)LegR).enabled = false; if ((Object)(object)curMag != (Object)null) { if ((Object)(object)((Component)curMag).gameObject.GetComponent() != (Object)null) { ((Component)curMag).gameObject.GetComponent().useGravity = true; ((Component)curMag).gameObject.GetComponent().isKinematic = false; } curMag = null; } if ((Object)(object)curGun != (Object)null) { if ((Object)(object)curGun.Magazine != (Object)null) { curGun.EjectMag(false); } if ((Object)(object)((Component)curGun).gameObject.GetComponent() != (Object)null) { ((Component)curGun).gameObject.GetComponent().useGravity = true; ((Component)curGun).gameObject.GetComponent().isKinematic = false; } curGun = null; } newMag = null; cocked = false; detectCol.enabled = false; pouched = false; ((Component)aimRoot).transform.localEulerAngles = new Vector3(0f, 0f, 0f); aimingpoint.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if (isContious) { ((Component)leftFootTar).transform.position = ((Component)leftFoot).transform.position; ((Component)leftFootTar).transform.eulerAngles = ((Component)leftFoot).transform.eulerAngles; ((Component)rightFootTar).transform.position = ((Component)rightFoot).transform.position; ((Component)rightFootTar).transform.eulerAngles = ((Component)rightFoot).transform.eulerAngles; Vector3 velocity = NMA.velocity; if (((Vector3)(ref velocity)).magnitude >= 0.05f) { AR.footGap = 0.025f; } Vector3 velocity2 = NMA.velocity; if (((Vector3)(ref velocity2)).magnitude < 0.05f) { AR.footGap = 0.0325f; } ((Component)l).transform.localPosition = new Vector3(-0.06f, -0.15f, ((Component)rightFootTar).transform.localPosition.z * 0.15f + 0.05f); ((Component)r).transform.localPosition = new Vector3(0.06f, -0.15f, ((Component)leftFootTar).transform.localPosition.z * 0.15f + 0.05f); NMA.acceleration = 100f; NMA.speed = 2f; ((Behaviour)NMA).enabled = true; if ((Object)(object)nearestAI != (Object)null) { UpdateHeadAndBodySync(nearestAI.position); } else if (isInvestigatingSound && currentSoundInterest != Vector3.zero) { UpdateHeadAndBodySync(currentSoundInterest); } else if (follow && (Object)(object)GM.CurrentPlayerBody != (Object)null) { UpdateHeadAndBodySync(((Component)GM.CurrentPlayerBody.Torso).transform.position); } else { UpdateHeadAndBodySync(((Component)this).transform.position + ((Component)this).transform.forward * 10f); UpdateBodyRestore(); } if ((Object)(object)NB != (Object)null) { if ((Object)(object)nearestAI != (Object)null && fire && follow) { NB.SetTarget(nearestAI); NB.SetSpeed(3f); NB.standDist = 8f; } else if (follow && (Object)(object)itemTar == (Object)null && ((Object)(object)curGun == (Object)null || (Object)(object)curMag == (Object)null || Object.op_Implicit((Object)(object)curMortar))) { NB.SetTarget(((Component)GM.CurrentMovementManager.Body).transform); NB.SetSpeed(2f); NB.standDist = 2f; } else if ((Object)(object)itemTar != (Object)null) { NB.SetTarget(itemTar.transform); NB.SetSpeed(1.5f); NB.standDist = 0.5f; } else if ((Object)(object)curMortar != (Object)null) { MortarTarg.gameObject.transform.position = ((Component)curMortar.Col).gameObject.transform.position; MortarTarg.gameObject.transform.eulerAngles = new Vector3(0f, ((Component)curMortar).gameObject.transform.eulerAngles.y, 0f); rangeBallRef.transform.position = curMortar.RangeGuide.position; rangeBallRef.transform.eulerAngles = curMortar.RangeGuide.eulerAngles; NMA.SetDestination(MortarStand.gameObject.transform.position); SmoothAxisLookAtY(((Component)NMA).gameObject.transform, ((Component)curMortar).gameObject.transform.position, Vector3.forward); ((Component)NMA).gameObject.transform.eulerAngles = new Vector3(0f, MortarStand.transform.eulerAngles.y, 0f); NB.SetSpeed(2f); NB.standDist = 0f; } else { NB.SetTarget(((Component)this).transform); NB.SetSpeed(0f); } } if ((Object)(object)nearestAI != (Object)null) { SmoothAxisLookAt(((Component)headsight).transform, ((Component)nearestAI).gameObject.transform.position, Vector3.forward); } CleanupSoundEvents(); if ((Object)(object)nearestAI == (Object)null && isInvestigatingSound) { SmoothAxisLookAt(((Component)headsight).transform, currentSoundInterest, Vector3.forward); timeLookingAtSound += Time.deltaTime; if (timeLookingAtSound >= attentionDuration) { isInvestigatingSound = false; } } if ((Object)(object)nearestAI != (Object)null) { currentAimTime += Time.deltaTime; } else { currentAimTime = 0f; accuracySpread = 2f; } UpdateShooting(); body.transform.position = Vector3.Lerp(body.transform.position, new Vector3(((Component)NMA).gameObject.transform.position.x, body.transform.position.y, ((Component)NMA).gameObject.transform.position.z), Time.deltaTime * 2.5f); if ((Object)(object)nearestAI == (Object)null) { body.transform.rotation = Quaternion.Slerp(body.transform.rotation, ((Component)NMA).gameObject.transform.rotation, Time.deltaTime * 25f); } else if ((Object)(object)nearestAI != (Object)null) { SmoothAxisLookAt(body.transform, nearestAI.position, Vector3.forward, 250f); } isHurt = false; if ((Object)(object)nearestAI == (Object)null) { ((Component)aimRoot).transform.localEulerAngles = new Vector3(0f, 0f, 0f); aimingpoint.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if (heightref.transform.localPosition.y <= 1f && heightref.transform.localPosition.y >= 0.5f) { chest.transform.localEulerAngles = new Vector3((1f - heightref.transform.localPosition.y) * 60f, chest.transform.localEulerAngles.y, chest.transform.localEulerAngles.z); } if (speechCD > 0f) { speechCD -= Time.deltaTime; } if (follow) { NMA.acceleration = 20f; NMA.speed = 2.5f; } else if (!follow) { NMA.acceleration = 0f; NMA.speed = 2f; } ((Behaviour)ArmL).enabled = true; ((Behaviour)ArmR).enabled = true; ((Behaviour)LegL).enabled = true; ((Behaviour)LegR).enabled = true; detectCol.enabled = true; if ((Object)(object)curGun == (Object)null && (Object)(object)curMag == (Object)null && (Object)(object)curMortar == (Object)null) { nearestAI = null; ((Component)handL).transform.localPosition = Vector3.SmoothDamp(((Component)handL).transform.localPosition, l.localPosition, ref refHandL, 0.05f); ((Component)handR).transform.localPosition = Vector3.SmoothDamp(((Component)handR).transform.localPosition, r.localPosition, ref refHandR, 0.05f); ((Component)handL).transform.localEulerAngles = l.localEulerAngles; ((Component)handR).transform.localEulerAngles = r.localEulerAngles; } if ((Object)(object)curMag == (Object)null) { nearestAI = null; } if ((Object)(object)curGun == (Object)null) { nearestAI = null; NMA.stoppingDistance = 0f; if ((Object)(object)itemTar == (Object)null) { NB.standDist = 2f; } else if ((Object)(object)itemTar != (Object)null) { NB.standDist = 0f; } if (speechCD <= 0f) { SM.PlayCoreSound((FVRPooledAudioType)41, wanning, ((Component)this).gameObject.transform.position); speechCD = Random.Range(15, 25); } } if ((Object)(object)curGun != (Object)null) { ((Component)curGun).gameObject.transform.position = ((Component)handR).transform.position; if ((Object)(object)nearestAI == (Object)null) { ((Component)curGun).gameObject.transform.eulerAngles = ((Component)handR).transform.eulerAngles; } else if ((Object)(object)nearestAI != (Object)null) { SmoothAxisLookAt(((Component)curGun).gameObject.transform, ((Component)nearestAI).gameObject.transform.position, Vector3.forward, 250f); } if (!((FVRInteractiveObject)curGun).m_isHeld && (Object)(object)((FVRPhysicalObject)curGun).m_quickbeltSlot == (Object)null) { if ((Object)(object)((Component)curGun).gameObject.GetComponent() != (Object)null) { ((Component)curGun).gameObject.GetComponent().useGravity = false; ((Component)curGun).gameObject.GetComponent().isKinematic = true; } if ((Object)(object)curMag != (Object)null) { NMA.stoppingDistance = 10f; NB.standDist = 5f; } else if ((Object)(object)curMag == (Object)null) { if (speechCD <= 0f) { SM.PlayCoreSound((FVRPooledAudioType)41, wanning, ((Component)this).gameObject.transform.position); speechCD = Random.Range(15, 25); } ((Component)handR).transform.localPosition = Vector3.SmoothDamp(((Component)handR).transform.localPosition, ((Component)idlePos).transform.localPosition, ref refHandR, 0.2f); if ((Object)(object)itemTar == (Object)null) { NB.standDist = 2f; } else if ((Object)(object)itemTar != (Object)null) { NB.standDist = 0f; } NMA.stoppingDistance = 0f; } if ((Object)(object)((Component)curGun).gameObject.GetComponent() != (Object)null) { Handgun component = ((Component)curGun).gameObject.GetComponent(); if ((Object)(object)nearestAI == (Object)null && (Object)(object)curGun.Magazine != (Object)null) { if (speechCD <= 0f) { SM.PlayCoreSound((FVRPooledAudioType)41, wanning, ((Component)this).gameObject.transform.position); speechCD = Random.Range(15, 25); } if (Vector3.Distance(((Component)handR).transform.localPosition, ((Component)idlePos).transform.localPosition) > 0.05f) { ((Component)handR).transform.localPosition = Vector3.SmoothDamp(((Component)handR).transform.localPosition, ((Component)idlePos).transform.localPosition, ref refHandR, 0.1f); } else if (Vector3.Distance(((Component)handR).transform.localPosition, ((Component)idlePos).transform.localPosition) <= 0.05f) { ((Component)handR).transform.localPosition = ((Component)idlePos).transform.localPosition; } ((Component)handR).transform.localEulerAngles = ((Component)idlePos).transform.localEulerAngles; } else if ((Object)(object)nearestAI != (Object)null && (Object)(object)curGun.Magazine != (Object)null) { if (speechCD <= 0f) { SM.PlayCoreSound((FVRPooledAudioType)41, curses, ((Component)this).gameObject.transform.position); speechCD = Random.Range(5, 15); } if (follow && fire && ((Behaviour)NMA).enabled) { NMA.SetDestination(((Component)nearestAI).gameObject.transform.position); } if (Vector3.Distance(((Component)handR).transform.localPosition, ((Component)aimPos).transform.localPosition) > 0.05f) { ((Component)handR).transform.localPosition = Vector3.SmoothDamp(((Component)handR).transform.localPosition, ((Component)aimPos).transform.localPosition, ref refHandR, 0.1f); } else if (Vector3.Distance(((Component)handR).transform.localPosition, ((Component)aimPos).transform.localPosition) <= 0.05f) { ((Component)handR).transform.localPosition = ((Component)aimPos).transform.localPosition; } ((Component)handR).transform.localEulerAngles = ((Component)aimPos).transform.localEulerAngles; SmoothAxisLookAt(((Component)aimRoot).transform, ((Component)nearestAI).gameObject.transform.position, Vector3.forward, 250f); SmoothAxisLookAt(aimingpoint.transform, ((Component)nearestAI).gameObject.transform.position, Vector3.forward, 250f); if (fireCD > 0f) { fireCD -= Time.deltaTime; } if (component.Chamber.IsFull && !component.Chamber.IsSpent && fireCD <= 0f) { if (fire) { Ray val3 = default(Ray); ((Ray)(ref val3))..ctor(((Component)((FVRFireArm)component).MuzzlePos).transform.position, ((Component)((FVRFireArm)component).MuzzlePos).transform.forward); RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3, ref val4, Vector3.Distance(((Component)((FVRFireArm)component).MuzzlePos).transform.position, ((Component)nearestAI).transform.position), LayerMask.op_Implicit(lm))) { if (((RaycastHit)(ref val4)).distance >= Vector3.Distance(((Component)((FVRFireArm)component).MuzzlePos).transform.position, ((Component)nearestAI).transform.position) - 1f) { component.Fire(); } } else { component.Fire(); } } fireCD = Random.Range(0.5f, 0.75f); } } if (component.m_isSafetyEngaged) { component.ToggleSafety(); } if (((FVRFireArm)component).UsesMagazines) { if ((Object)(object)((FVRFireArm)component).Magazine == (Object)null) { if ((Object)(object)curMag != (Object)null) { ((Component)handR).transform.localPosition = Vector3.SmoothDamp(((Component)handR).transform.localPosition, ((Component)reloadPos).transform.localPosition, ref refHandR, 0.15f); ((Component)handR).transform.localEulerAngles = ((Component)reloadPos).transform.localEulerAngles; if (pouched) { if ((Object)(object)newMag == (Object)null) { if (Vector3.Distance(((Component)handL).transform.position, ((Component)curMag).gameObject.transform.position) > 0.05f) { ((Component)handL).transform.position = Vector3.SmoothDamp(((Component)handL).transform.position, ((Component)curMag).transform.position, ref refHandL, 0.3f); } else if (Vector3.Distance(((Component)handL).transform.position, ((Component)curMag).gameObject.transform.position) <= 0.05f) { GameObject val5 = Object.Instantiate(((Component)curMag).gameObject, ((Component)curMag).gameObject.transform.position, ((Component)curMag).gameObject.transform.rotation); if ((Object)(object)val5.gameObject.GetComponent() != (Object)null) { val5.gameObject.GetComponent().useGravity = true; } if ((Object)(object)val5.GetComponent() != (Object)null) { newMag = val5.GetComponent(); } } } else if ((Object)(object)newMag != (Object)null) { ((Component)handL).transform.position = Vector3.SmoothDamp(((Component)handL).transform.position, curGun.MagazineMountPos.position, ref refHandL, 0.3f); ((Component)newMag).gameObject.transform.position = ((Component)handL).transform.position; ((Component)newMag).gameObject.transform.eulerAngles = curGun.MagazineMountPos.eulerAngles; if (Vector3.Distance(((Component)newMag).gameObject.transform.position, curGun.MagazineMountPos.position) <= 0.05f) { curGun.LoadMag(newMag); newMag.Load(curGun); newMag = null; cocked = false; } } } } } else if ((Object)(object)((FVRFireArm)component).Magazine != (Object)null) { if ((Object)(object)curMag == (Object)null) { ((FVRFireArm)component).EjectMag(false); } if ((int)component.Slide.CurPos == 0 && cocked && !component.Chamber.IsFull) { component.Slide.KnockToRear(); } if (component.IsSlideLockUp) { component.DisEngageSlideLockMechanism(); component.DropSlideRelease(); } ((Component)handL).transform.localPosition = ((Component)handR).transform.localPosition; ((Component)handL).transform.localEulerAngles = ((Component)handR).transform.localEulerAngles; if (!component.Chamber.IsFull && !cocked) { if (((FVRFireArm)component).Magazine.m_numRounds <= 0) { ((FVRFireArm)component).EjectMag(false); } component.Slide.KnockToRear(); cocked = true; } else if (component.Chamber.IsFull) { cocked = false; } } } } } if (((FVRInteractiveObject)curGun).m_isHeld || (Object)(object)((FVRPhysicalObject)curGun).m_quickbeltSlot != (Object)null || hasMortar) { if ((Object)(object)curMag != (Object)null) { if ((Object)(object)((Component)curMag).gameObject.GetComponent() != (Object)null) { ((Component)curMag).gameObject.GetComponent().isKinematic = false; ((Component)curMag).gameObject.GetComponent().useGravity = true; } curMag = null; } if ((Object)(object)((Component)curGun).gameObject.GetComponent() != (Object)null) { ((Component)curGun).gameObject.GetComponent().isKinematic = false; ((Component)curGun).gameObject.GetComponent().useGravity = true; } curGun = null; } } if ((Object)(object)curMag != (Object)null) { if ((Object)(object)itemTar != (Object)null) { itemTar = null; } if (((FVRInteractiveObject)curMag).m_isHeld || (Object)(object)((FVRPhysicalObject)curMag).m_quickbeltSlot != (Object)null) { if ((Object)(object)((Component)curMag).gameObject.GetComponent() != (Object)null) { ((Component)curMag).gameObject.GetComponent().isKinematic = false; ((Component)curMag).gameObject.GetComponent().useGravity = true; } curMag = null; } if (!((FVRInteractiveObject)curMag).m_isHeld && (Object)(object)((FVRPhysicalObject)curMag).m_quickbeltSlot == (Object)null) { if ((Object)(object)((Component)curMag).gameObject.GetComponent() != (Object)null) { ((Component)curMag).gameObject.GetComponent().isKinematic = true; ((Component)curMag).gameObject.GetComponent().useGravity = false; } if (Vector3.Distance(((Component)curMag).gameObject.transform.position, ((Component)magPouch).transform.position) > 0.1f && !pouched) { ((Component)curMag).gameObject.transform.position = ((Component)handL).transform.position; ((Component)handL).transform.localPosition = Vector3.SmoothDamp(((Component)handL).transform.localPosition, ((Component)magPouch).transform.localPosition, ref refHandL, 0.15f); } else if (Vector3.Distance(((Component)curMag).gameObject.transform.position, ((Component)magPouch).transform.position) <= 0.1f && !pouched) { pouched = true; } if (pouched) { ((Component)curMag).gameObject.transform.position = ((Component)magPouch).transform.position; ((Component)curMag).gameObject.transform.eulerAngles = ((Component)magPouch).transform.eulerAngles; } } } if ((Object)(object)itemTar == (Object)null) { if ((((Object)(object)curGun == (Object)null || (Object)(object)curMag == (Object)null || (Object)(object)nearestAI == (Object)null || (Object)(object)curMortar == (Object)null) && follow && ((Behaviour)NMA).enabled) || (!fire && follow && ((Behaviour)NMA).enabled)) { NMA.stoppingDistance = 1.5f; NB.standDist = 2f; if (!isSCAV && ((isBEAR && playerIsBEAR) || (isUSEC && playerIsUSEC))) { NMA.SetDestination(((Component)GM.CurrentMovementManager.Head).gameObject.transform.position); } } if ((Object)(object)curMortar == (Object)null) { heightref.transform.localPosition = Vector3.Lerp(heightref.transform.localPosition, new Vector3(0f, 1f, 0f), Time.deltaTime * 5f); } if ((Object)(object)curMortar != (Object)null) { heightref.transform.localPosition = Vector3.Lerp(heightref.transform.localPosition, new Vector3(0f, 0.5f, 0f), Time.deltaTime * 5f); } } if ((Object)(object)itemTar != (Object)null) { heightref.transform.localPosition = new Vector3(0f, Mathf.Clamp(heightref.transform.localPosition.y, 0.5f, 1f), 0f); heightref.transform.position = Vector3.Lerp(heightref.transform.position, new Vector3(heightref.transform.position.x, itemTar.transform.position.y, heightref.transform.position.z), Time.deltaTime * 5f); } if (currentAI != null && (Object)(object)curGun != (Object)null && (Object)(object)curMag != (Object)null && currentAI.Count > 0) { for (int i = 0; i < currentAI.Count; i++) { if ((Object)(object)currentAI[i] == (Object)null || !currentAI[i].isContious) { currentAI.Remove(currentAI[i]); } } nearestAI = GetNearestGameObject(((Component)this).gameObject.transform, currentAI); } if (adaptPostureOnSlope && (Object)(object)NB != (Object)null) { UpdateSlopeAdaptation(); } if ((Object)(object)curMortar != (Object)null) { MortarTarg.gameObject.transform.position = ((Component)curMortar.Col).gameObject.transform.position; MortarTarg.gameObject.transform.eulerAngles = new Vector3(0f, ((Component)curMortar).gameObject.transform.eulerAngles.y, 0f); rangeBallRef.transform.position = curMortar.RangeGuide.position; rangeBallRef.transform.eulerAngles = curMortar.RangeGuide.eulerAngles; NMA.SetDestination(MortarStand.gameObject.transform.position); ((Component)NMA).gameObject.transform.position = MortarStand.gameObject.transform.position; body.gameObject.transform.position = mortarHips.transform.position; body.gameObject.transform.eulerAngles = mortarHips.transform.eulerAngles; SmoothAxisLookAtY(((Component)NMA).gameObject.transform, ((Component)curMortar).gameObject.transform.position, Vector3.forward); ((Component)NMA).gameObject.transform.eulerAngles = new Vector3(0f, MortarStand.transform.eulerAngles.y, 0f); NB.SetSpeed(2f); NB.standDist = 0f; ((Component)handL).transform.position = Vector3.Lerp(((Component)handL).transform.position, curMortar.Controls[0].transform.position, Time.deltaTime * 25f); AxisLookAt(((Component)handL).transform, body.transform.position, -1f * Vector3.forward); if (!curMortar.m_isCol) { hasMortar = false; curMortar = null; } if ((int)curMortar.Mode == 1 && (Object)(object)((Component)curMortar).GetComponentInChildren() != (Object)null && !((Component)curMortar).GetComponentInChildren().isSafe && ((Object)((Component)((Component)curMortar).GetComponentInChildren()).gameObject).name == "_Trigger") { ((Component)handR).transform.position = Vector3.Lerp(((Component)handR).transform.position, ((Component)((Component)curMortar).GetComponentInChildren()).gameObject.transform.position, Time.deltaTime * 5f); AxisLookAt(((Component)handR).transform, body.transform.position, -1f * Vector3.forward); if (curMortar.Chamber.IsFull && !curMortar.Chamber.IsSpent) { curMortar.Fire(); } } if ((int)curMortar.Mode == 2) { if ((Object)(object)curShell == (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable != (Object)null) { if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent() != (Object)null && ((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().RoundType == ((FVRFireArm)curMortar).RoundType && (Object)(object)((FVRPhysicalObject)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent()).m_quickbeltSlot == (Object)null) { curShell = ((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent(); } if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent() == (Object)null) { ((Component)handR).transform.position = Vector3.Lerp(((Component)handR).transform.position, ((Component)((Component)curMortar).GetComponentInChildren()).gameObject.transform.position, Time.deltaTime * 5f); AxisLookAt(((Component)handR).transform, body.transform.position, -1f * Vector3.forward); } } if ((Object)(object)curShell == (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable != (Object)null) { if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent() != (Object)null && ((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent().RoundType == ((FVRFireArm)curMortar).RoundType && (Object)(object)((FVRPhysicalObject)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent()).m_quickbeltSlot == (Object)null) { curShell = ((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent(); } if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent() == (Object)null) { ((Component)handR).transform.position = Vector3.Lerp(((Component)handR).transform.position, ((Component)((Component)curMortar).GetComponentInChildren()).gameObject.transform.position, Time.deltaTime * 5f); AxisLookAt(((Component)handR).transform, body.transform.position, -1f * Vector3.forward); } } if ((Object)(object)curShell == (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null) { ((Component)handR).transform.position = Vector3.Lerp(((Component)handR).transform.position, ((Component)((Component)curMortar).GetComponentInChildren()).gameObject.transform.position, Time.deltaTime * 5f); AxisLookAt(((Component)handR).transform, body.transform.position, -1f * Vector3.forward); } if ((Object)(object)curShell == (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable != (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable != (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent() == (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent() == (Object)null) { ((Component)handR).transform.position = Vector3.Lerp(((Component)handR).transform.position, ((Component)((Component)curMortar).GetComponentInChildren()).gameObject.transform.position, Time.deltaTime * 5f); AxisLookAt(((Component)handR).transform, body.transform.position, -1f * Vector3.forward); } if ((Object)(object)curShell != (Object)null) { if (Vector3.Distance(((Component)((FVRFireArm)curMortar).MuzzlePos).transform.position, ((Component)curShell).gameObject.transform.position) > 0.005f) { if (!isShellGrab) { if (Vector3.Distance(((Component)handR).transform.position, ((Component)curShell).gameObject.transform.position) > 0.25f) { if (Vector3.Angle(body.transform.forward, ((Component)curShell).gameObject.transform.position - body.transform.position) <= 75f) { if (Vector3.Distance(((Component)handR).transform.position, body.transform.position) < 0.75f) { ((Component)handR).transform.position = Vector3.Lerp(((Component)handR).transform.position, ((Component)curShell).gameObject.transform.position, Time.deltaTime * 5f); AxisLookAt(((Component)handR).transform, body.transform.position, -1f * Vector3.forward); } else { ((Component)handR).transform.position = Vector3.Lerp(((Component)handR).transform.position, ((Component)((Component)curMortar).GetComponentInChildren()).gameObject.transform.position, Time.deltaTime * 10f); AxisLookAt(((Component)handR).transform, body.transform.position, -1f * Vector3.forward); } } else { ((Component)handR).transform.position = Vector3.Lerp(((Component)handR).transform.position, ((Component)((Component)curMortar).GetComponentInChildren()).gameObject.transform.position, Time.deltaTime * 10f); AxisLookAt(((Component)handR).transform, body.transform.position, -1f * Vector3.forward); } } else if (Vector3.Distance(((Component)handR).transform.position, ((Component)curShell).gameObject.transform.position) <= 0.25f && !((FVRInteractiveObject)curShell).IsHeld) { isShellGrab = true; } } if (isShellGrab) { if ((Object)(object)((Component)curShell).gameObject.GetComponent() != (Object)null) { ((Component)curShell).gameObject.GetComponent().isKinematic = true; } ((FVRInteractiveObject)curShell).SetAllCollidersToLayer(false, "NoCol"); ((Component)handR).transform.position = Vector3.Lerp(((Component)handR).transform.position, ((Component)curShell).gameObject.transform.position, Time.deltaTime * 10f); AxisLookAt(((Component)handR).transform, body.transform.position, -1f * Vector3.forward); ((Component)curShell).gameObject.transform.rotation = Quaternion.Slerp(((Component)curShell).gameObject.transform.rotation, ((Component)((FVRFireArm)curMortar).MuzzlePos).transform.rotation, Time.deltaTime * 10f); ((Component)curShell).gameObject.transform.position = Vector3.Lerp(((Component)curShell).gameObject.transform.position, ((Component)((FVRFireArm)curMortar).MuzzlePos).transform.position, Time.deltaTime * 5f); } } else if (Vector3.Distance(((Component)((FVRFireArm)curMortar).MuzzlePos).transform.position, ((Component)curShell).gameObject.transform.position) <= 0.005f && Vector3.Angle(((Component)((FVRFireArm)curMortar).MuzzlePos).transform.forward, ((Component)curShell).gameObject.transform.forward) < 2.5f) { if ((Object)(object)((Component)curShell).gameObject.GetComponent() != (Object)null) { ((Component)curShell).gameObject.GetComponent().isKinematic = false; } ((FVRInteractiveObject)curShell).SetAllCollidersToLayer(false, "Default"); isShellGrab = false; curShell = null; } } } if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable != (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent() != (Object)null && GM.CurrentMovementManager.Hands[0].Input.TriggerFloat >= 0.75f) { string s = new string(((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().AngleText.text.Where((char c) => !char.IsWhiteSpace(c)).ToArray()); float.TryParse(s, out var result); string s2 = new string(((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().RangeText.text.Where((char c) => !char.IsWhiteSpace(c)).ToArray()); float.TryParse(s2, out var result2); float num2 = (float)CalculateAdjacentSide(Mathf.Abs(result), Mathf.Abs(result2)); if (result2 < 9999f) { mortarAimTargetY.position = ((RaycastHit)(ref ((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().m_hit)).point; SmoothAxisLookAtY(((Component)curMortar).gameObject.transform, mortarAimTargetY.position, Vector3.forward); } float num3 = mortarCurve.Evaluate(result2); ((Component)curMortar).gameObject.transform.eulerAngles = new Vector3(num3, ((Component)curMortar).gameObject.transform.eulerAngles.y, 0f); } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable != (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent() != (Object)null && GM.CurrentMovementManager.Hands[1].Input.TriggerFloat >= 0.75f) { string s3 = new string(((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent().AngleText.text.Where((char c) => !char.IsWhiteSpace(c)).ToArray()); float.TryParse(s3, out var result3); string s4 = new string(((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent().RangeText.text.Where((char c) => !char.IsWhiteSpace(c)).ToArray()); float.TryParse(s4, out var result4); float num4 = (float)CalculateAdjacentSide(Mathf.Abs(result3), Mathf.Abs(result4)); if (result4 < 9999f) { mortarAimTargetY.position = ((RaycastHit)(ref ((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent().m_hit)).point; SmoothAxisLookAtY(((Component)curMortar).gameObject.transform, mortarAimTargetY.position, Vector3.forward); } float num5 = mortarCurve.Evaluate(result4); ((Component)curMortar).gameObject.transform.eulerAngles = new Vector3(num5, ((Component)curMortar).gameObject.transform.eulerAngles.y, 0f); } } } if (enableArmControlSwitch && (Object)(object)AR != (Object)null) { UpdateArmControlBlend(); } if (!((Object)(object)AR != (Object)null)) { return; } switch (AR.currentAuthority) { case ActiveRagdoll.ControlAuthority.DynamicGait: isGaitControlling = true; if ((Object)(object)nearestAI != (Object)null) { accuracySpread = 5f; } break; case ActiveRagdoll.ControlAuthority.ArmIK: isGaitControlling = false; break; case ActiveRagdoll.ControlAuthority.Mixed: isGaitControlling = true; break; } } private static double CalculateAdjacentSide(double angleDegrees, double hypotenuse) { double d = angleDegrees * Math.PI / 180.0; return hypotenuse * Math.Cos(d); } private void UpdateArmControlBlend() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) float num = 0f; if ((Object)(object)nearestAI != (Object)null && fire && (Object)(object)curGun != (Object)null) { num = 0f; } else { if (!isContious) { goto IL_00a4; } if (!follow) { Vector3 velocity = NMA.velocity; if (!(((Vector3)(ref velocity)).magnitude > 0.125f) && !((Object)(object)curGun == (Object)null)) { goto IL_00a4; } } num = Mathf.Lerp(num, 1f, Time.deltaTime * armControlTransitionSpeed); } goto IL_00ac; IL_00a4: num = 0.5f; goto IL_00ac; IL_00ac: currentArmBlend = Mathf.Lerp(currentArmBlend, num, Time.deltaTime * armControlTransitionSpeed); } public bool ShouldRagdollControlArms() { if (!enableArmControlSwitch) { return false; } if ((Object)(object)nearestAI != (Object)null && fire) { return false; } return true; } private void UpdateSlopeAdaptation() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) NavMeshHit val = default(NavMeshHit); if ((Object)(object)NB.cachedAgent != (Object)null && NB.cachedAgent.isOnNavMesh && NavMesh.SamplePosition(((Component)this).transform.position, ref val, 0.5f, NB.cachedAgent.areaMask)) { currentSlopeAngle = Vector3.Angle(((NavMeshHit)(ref val)).normal, Vector3.up); if (currentSlopeAngle > 20f) { NB.speed = Mathf.Lerp(NB.speed, originalStandHeight * crouchSpeedMultiplier, Time.deltaTime * 30f); } else { NB.speed = Mathf.Lerp(NB.speed, originalStandHeight, Time.deltaTime * 30f); } } if ((Object)(object)nearestAI != (Object)null && currentSlopeAngle > 25f) { accuracySpread = Mathf.Lerp(accuracySpread, 5f, Time.deltaTime * 2f); } } public void ApplySuppression(float amount) { suppressionLevel = Mathf.Min(1f, suppressionLevel + amount); } public Transform GetNearestGameObject(Transform player, List objects) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) Transform val = null; if (objects == null || (Object)(object)val == (Object)null) { } if (objects.Count > 0 && (Object)(object)objects[0] != (Object)null) { val = ((Component)objects[0]).transform; float num = Vector3.Distance(player.position, ((Component)objects[0]).transform.position); for (int i = 1; i < objects.Count; i++) { float num2 = Vector3.Distance(player.position, ((Component)objects[i]).transform.position); if (num > num2) { num = num2; val = ((Component)objects[i]).transform; } } } return val; } private void OnDestroy() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown if ((Object)(object)MortarTarg != (Object)null) { Object.Destroy((Object)(object)MortarTarg); } GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(OnShotFired); GM.CurrentSceneSettings.PerceiveableSoundEvent -= new PerceiveableSound(OnSoundHeard); Object.Destroy((Object)(object)chestrefY); } } } namespace JerryComponent { public class KillPlayer : MonoBehaviour { private void Start() { GM.CurrentPlayerBody.KillPlayer(false); } private void Update() { } } public class disaft : MonoBehaviour { public float timer = 59f; private float starttime = 0f; private void Start() { } private void Update() { if (starttime < timer) { starttime += Time.deltaTime; } else if (starttime >= timer) { ((Component)this).gameObject.SetActive(false); } } } } namespace JerryNPC { public class NPCIKController : MonoBehaviour { private enum NPCState { Idle, Patrol, MoveToPickup, Pickup, Chase, Aim, Unconscious } public Transform reloadPos; public FVRFireArmMagazine newMag; public bool cocked = false; [Header("Final IK组件")] [Tooltip("FullBodyBipedIK组件")] public FullBodyBipedIK fullBodyBipedIK; [Tooltip("AimIK组件 - 用于瞄准")] public AimIK aimIK; [Tooltip("布娃娃工具组件")] public RagdollUtility ragdollUtility; [Header("NavMeshAgent设置")] [Tooltip("导航代理组件")] public NavMeshAgent navMeshAgent; [Tooltip("移动速度")] public float walkSpeed = 2f; [Tooltip("奔跑速度")] public float runSpeed = 4f; [Tooltip("停止距离")] public float stoppingDistance = 0.5f; [Header("手臂摆动设置")] [Tooltip("手臂摆动幅度")] public float armSwingAmplitude = 25f; [Tooltip("手臂摆动速度")] public float armSwingSpeed = 2.5f; [Tooltip("左手IK权重")] [Range(0f, 1f)] public float leftHandWeight = 0.5f; [Tooltip("右手IK权重")] [Range(0f, 1f)] public float rightHandWeight = 0.5f; [Header("持枪瞄准设置")] [Tooltip("持枪时的右手IK目标点")] public Transform rightHandGripPoint; [Tooltip("持枪时的左手IK目标点")] public Transform leftHandGripPoint; [Tooltip("瞄准目标点(通常为玩家或敌人)")] public Transform aimTarget; [Tooltip("瞄准IK权重")] [Range(0f, 1f)] public float aimWeightValue = 0.9f; [Tooltip("瞄准范围(米)")] public float aimRange = 20f; [Tooltip("当前装备的武器")] public GameObject currentWeapon; public GameObject currentMag; [Header("拾取设置")] [Tooltip("拾取搜索范围(米)")] public float pickupSearchRange = 8f; [Tooltip("右手接近距离阈值(米)")] public float handReachDistance = 0.12f; [Tooltip("下蹲高度偏移")] public float crouchHeightOffset = -0.3f; [Tooltip("拾取动画时间(秒)")] public float pickupAnimationTime = 1f; [Header("巡逻设置")] [Tooltip("巡逻点列表")] public List patrolPoints = new List(); [Tooltip("等待时间范围(秒)")] public Vector2 waitTimeRange = new Vector2(2f, 5f); [Tooltip("是否循环巡逻")] public bool loopPatrol = true; [Header("感知设置")] [Tooltip("视觉范围(米)")] public float visionRange = 15f; [Tooltip("视觉角度(度)")] public float visionAngle = 60f; [Tooltip("是否看到玩家或武器时追击")] public bool chaseWhenSeeWeapon = true; [Header("布娃娃设置")] [Tooltip("是否处于昏迷状态")] public bool isUnconscious = false; [Tooltip("从布娃娃恢复的时间")] public float ragdollRecoveryTime = 1.2f; [Tooltip("昏迷时自动恢复时间(0为不自动恢复)")] public float autoRecoveryTime = 10f; public Transform magPouch; private NPCState currentState = NPCState.Idle; private NPCState previousState = NPCState.Idle; private float armSwingTimer; private bool isEquipped = false; private bool isMagInSlot = false; private bool isCrouching = false; private bool isPickingUp = false; private GameObject targetWeapon; private GameObject targetMag; private Transform currentTarget; private int currentPatrolIndex = 0; private float waitTimer = 0f; private float autoRecoveryTimer = 0f; private float originalArmSwingSpeed; private float originalArmSwingAmplitude; private bool hasWeaponInRange = false; private bool hasMagInRange = false; private Vector3 originalPosition; private float originalAgentHeight; private float originalAgentRadius; public float fireCD; [Header("程序化行走设置")] [Tooltip("启用程序化行走动画")] public bool useProceduralWalk = true; [Tooltip("腿部摆动幅度")] public float legSwingAmplitude = 15f; [Tooltip("腿部摆动速度")] public float legSwingSpeed = 2.5f; [Tooltip("手臂摆动幅度(未持枪时)")] public float unarmedArmSwing = 30f; [Tooltip("手臂摆动幅度(持枪时)")] public float armedArmSwing = 10f; [Tooltip("身体上下起伏幅度")] public float bodyBobAmplitude = 0.03f; [Tooltip("身体起伏速度")] public float bodyBobSpeed = 3f; private float walkCycleTimer = 0f; private Vector3 originalBodyPosition; private Quaternion originalLeftArmRotation; private Quaternion originalRightArmRotation; private bool originalArmRotationsSet = false; private Transform leftArmBone; private Transform rightArmBone; private Transform leftLegBone; private Transform rightLegBone; private Transform spineBone; public bool IsEquipped => isEquipped; public bool IsUnconscious => isUnconscious; public bool IsMoving { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) int result; if ((Object)(object)navMeshAgent != (Object)null) { Vector3 velocity = navMeshAgent.velocity; result = ((((Vector3)(ref velocity)).magnitude > 0.1f) ? 1 : 0); } else { result = 0; } return (byte)result != 0; } } public Transform CurrentTarget => currentTarget; private void Start() { ValidateComponents(); InitializeComponents(); InitializeStateMachine(); ((MonoBehaviour)this).StartCoroutine(InitializeProceduralAnimationBonesDelayed()); } private IEnumerator InitializeProceduralAnimationBonesDelayed() { yield return null; if ((Object)(object)fullBodyBipedIK == (Object)null || fullBodyBipedIK.solver == null) { Debug.LogWarning((object)"FullBodyBipedIK未就绪"); yield break; } Animator animator = ((Component)this).GetComponent(); if ((Object)(object)animator != (Object)null) { leftArmBone = animator.GetBoneTransform((HumanBodyBones)13); rightArmBone = animator.GetBoneTransform((HumanBodyBones)14); leftLegBone = animator.GetBoneTransform((HumanBodyBones)1); rightLegBone = animator.GetBoneTransform((HumanBodyBones)2); spineBone = animator.GetBoneTransform((HumanBodyBones)7); if ((Object)(object)leftArmBone != (Object)null) { originalLeftArmRotation = leftArmBone.localRotation; } if ((Object)(object)rightArmBone != (Object)null) { originalRightArmRotation = rightArmBone.localRotation; } originalArmRotationsSet = true; } else { FindBonesByName(); } if ((Object)(object)spineBone != (Object)null) { originalBodyPosition = spineBone.localPosition; } else if (((IKSolverFullBody)fullBodyBipedIK.solver).spineMapping != null && ((IKSolverFullBody)fullBodyBipedIK.solver).spineMapping.spineBones.Length > 0) { spineBone = ((IKSolverFullBody)fullBodyBipedIK.solver).spineMapping.spineBones[0]; if ((Object)(object)spineBone != (Object)null) { originalBodyPosition = spineBone.localPosition; } } } private void FindBonesByName() { //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); Transform[] array = componentsInChildren; foreach (Transform val in array) { string text = ((Object)val).name.ToLower(); if (text.Contains("left") && (text.Contains("arm") || text.Contains("upperarm"))) { leftArmBone = val; } else if (text.Contains("right") && (text.Contains("arm") || text.Contains("upperarm"))) { rightArmBone = val; } else if (text.Contains("left") && (text.Contains("leg") || text.Contains("thigh") || text.Contains("upperleg"))) { leftLegBone = val; } else if (text.Contains("right") && (text.Contains("leg") || text.Contains("thigh") || text.Contains("upperleg"))) { rightLegBone = val; } else if (text.Contains("spine") || text.Contains("chest")) { spineBone = val; } } if ((Object)(object)leftArmBone != (Object)null) { originalLeftArmRotation = leftArmBone.localRotation; } if ((Object)(object)rightArmBone != (Object)null) { originalRightArmRotation = rightArmBone.localRotation; } originalArmRotationsSet = true; } private void UpdateProceduralWalkAnimation() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (!useProceduralWalk || isUnconscious || isPickingUp || (Object)(object)navMeshAgent == (Object)null) { return; } Vector3 velocity = navMeshAgent.velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; if (magnitude > 0.2f) { float num = Mathf.Clamp01(magnitude / navMeshAgent.speed); walkCycleTimer += Time.deltaTime * legSwingSpeed * num; if (walkCycleTimer > (float)Math.PI * 2f) { walkCycleTimer -= (float)Math.PI * 2f; } float leftSwing = Mathf.Sin(walkCycleTimer) * legSwingAmplitude * num; float rightSwing = Mathf.Sin(walkCycleTimer + (float)Math.PI) * legSwingAmplitude * num; float leftSwing2 = Mathf.Sin(walkCycleTimer) * ((!isEquipped) ? unarmedArmSwing : armedArmSwing) * num; float rightSwing2 = Mathf.Sin(walkCycleTimer + (float)Math.PI) * ((!isEquipped) ? unarmedArmSwing : armedArmSwing) * num; UpdateLegMovement(leftSwing, rightSwing); UpdateArmMovement(leftSwing2, rightSwing2); UpdateBodyBob(num); } else { walkCycleTimer = Mathf.Lerp(walkCycleTimer, 0f, Time.deltaTime * 5f); RestoreBones(); } } private void UpdateLegMovement(float leftSwing, float rightSwing) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)leftLegBone != (Object)null && (Object)(object)rightLegBone != (Object)null) { leftLegBone.localRotation = Quaternion.Euler(leftSwing, 0f, 0f); rightLegBone.localRotation = Quaternion.Euler(rightSwing, 0f, 0f); } } private void UpdateArmMovement(float leftSwing, float rightSwing) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) if (!originalArmRotationsSet) { return; } if ((Object)(object)leftArmBone != (Object)null) { if (isEquipped && currentState == NPCState.Aim) { float num = Mathf.Sin(walkCycleTimer * 3f) * 2f; leftArmBone.localRotation = originalLeftArmRotation * Quaternion.Euler(num * 0.3f, 10f, 5f); } else { leftArmBone.localRotation = originalLeftArmRotation * Quaternion.Euler(leftSwing, 0f, 0f); } } if ((Object)(object)rightArmBone != (Object)null) { if (isEquipped && currentState == NPCState.Aim) { float num2 = Mathf.Sin(walkCycleTimer * 3f + (float)Math.PI) * 2f; rightArmBone.localRotation = originalRightArmRotation * Quaternion.Euler(num2 * 0.3f, -10f, -5f); } else { rightArmBone.localRotation = originalRightArmRotation * Quaternion.Euler(rightSwing, 0f, 0f); } } } private void UpdateBodyBob(float speedFactor) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)spineBone != (Object)null) { float num = Mathf.Sin(walkCycleTimer * bodyBobSpeed) * bodyBobAmplitude * speedFactor; Vector3 localPosition = originalBodyPosition; localPosition.y = originalBodyPosition.y + num; spineBone.localPosition = localPosition; } } private void RestoreBones() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)leftLegBone != (Object)null) { leftLegBone.localRotation = Quaternion.Slerp(leftLegBone.localRotation, Quaternion.identity, Time.deltaTime * 8f); } if ((Object)(object)rightLegBone != (Object)null) { rightLegBone.localRotation = Quaternion.Slerp(rightLegBone.localRotation, Quaternion.identity, Time.deltaTime * 8f); } if (originalArmRotationsSet) { if ((Object)(object)leftArmBone != (Object)null) { leftArmBone.localRotation = Quaternion.Slerp(leftArmBone.localRotation, originalLeftArmRotation, Time.deltaTime * 8f); } if ((Object)(object)rightArmBone != (Object)null) { rightArmBone.localRotation = Quaternion.Slerp(rightArmBone.localRotation, originalRightArmRotation, Time.deltaTime * 8f); } } if ((Object)(object)spineBone != (Object)null) { spineBone.localPosition = Vector3.Lerp(spineBone.localPosition, originalBodyPosition, Time.deltaTime * 8f); } } private void Update() { //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) UpdateProceduralWalkAnimation(); if (isUnconscious) { HandleUnconsciousState(); return; } if (isEquipped) { Handgun component = currentWeapon.gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { return; } if (component.m_isSafetyEngaged) { component.ToggleSafety(); } if (currentState == NPCState.Aim && (Object)(object)CurrentTarget != (Object)null && isMagInSlot) { if (fireCD > 0f) { fireCD -= Time.deltaTime; } if (component.Chamber.IsFull && !component.Chamber.IsSpent && fireCD <= 0f) { if (Vector3.Angle(((Component)CurrentTarget).transform.position - ((Component)((FVRFireArm)component).MuzzlePos).transform.position, ((Component)((FVRFireArm)component).MuzzlePos).transform.forward) <= 15f) { component.Fire(); } fireCD = Random.Range(0.5f, 0.75f); } } if (((FVRFireArm)component).UsesMagazines) { if ((Object)(object)((FVRFireArm)component).Magazine == (Object)null) { if ((Object)(object)currentMag != (Object)null) { ((Component)rightHandGripPoint).transform.localPosition = Vector3.Lerp(((Component)rightHandGripPoint).transform.localPosition, ((Component)reloadPos).transform.localPosition, Time.deltaTime * 15f); ((Component)rightHandGripPoint).transform.localEulerAngles = ((Component)reloadPos).transform.localEulerAngles; if (isMagInSlot) { if ((Object)(object)newMag == (Object)null) { if (Vector3.Distance(((Component)leftHandGripPoint).transform.position, currentMag.gameObject.transform.position) > 0.05f) { ((Component)leftHandGripPoint).transform.position = Vector3.Lerp(((Component)leftHandGripPoint).transform.position, currentMag.transform.position, Time.deltaTime * 15f); } else if (Vector3.Distance(((Component)leftHandGripPoint).transform.position, currentMag.gameObject.transform.position) <= 0.05f) { GameObject val = Object.Instantiate(currentMag.gameObject, currentMag.gameObject.transform.position, currentMag.gameObject.transform.rotation); if ((Object)(object)val.gameObject.GetComponent() != (Object)null) { val.gameObject.GetComponent().useGravity = true; } if ((Object)(object)val.GetComponent() != (Object)null) { newMag = val.GetComponent(); } } } else if ((Object)(object)newMag != (Object)null) { ((Component)leftHandGripPoint).transform.position = Vector3.Lerp(((Component)leftHandGripPoint).transform.position, ((FVRFireArm)component).MagazineMountPos.position, Time.deltaTime * 15f); ((Component)newMag).gameObject.transform.position = ((Component)leftHandGripPoint).transform.position; ((Component)newMag).gameObject.transform.eulerAngles = ((FVRFireArm)component).MagazineMountPos.eulerAngles; if (Vector3.Distance(((Component)newMag).gameObject.transform.position, ((FVRFireArm)component).MagazineMountPos.position) <= 0.05f) { ((FVRFireArm)component).LoadMag(newMag); newMag.Load((FVRFireArm)(object)component); newMag = null; cocked = false; } } } } } else if ((Object)(object)((FVRFireArm)component).Magazine != (Object)null) { if ((Object)(object)currentMag == (Object)null) { ((FVRFireArm)component).EjectMag(false); } if ((int)component.Slide.CurPos == 0 && cocked && !component.Chamber.IsFull) { component.Slide.KnockToRear(); } if (component.IsSlideLockUp) { component.DisEngageSlideLockMechanism(); component.DropSlideRelease(); } ((Component)leftHandGripPoint).transform.localPosition = ((Component)rightHandGripPoint).transform.localPosition; ((Component)leftHandGripPoint).transform.localEulerAngles = ((Component)rightHandGripPoint).transform.localEulerAngles; if (!component.Chamber.IsFull && !cocked) { if (((FVRFireArm)component).Magazine.m_numRounds <= 0) { ((FVRFireArm)component).EjectMag(false); } component.Slide.KnockToRear(); cocked = true; } else if (component.Chamber.IsFull) { cocked = false; } } } } UpdatePerception(); UpdateStateMachine(); UpdateIKWeights(); if (!isEquipped && !isPickingUp && !isUnconscious) { UpdateArmSwingVisual(); } } private void LateUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!isUnconscious && !isEquipped && !isPickingUp && (Object)(object)navMeshAgent != (Object)null) { Vector3 velocity = navMeshAgent.velocity; float speedRatio = ((Vector3)(ref velocity)).magnitude / navMeshAgent.speed; UpdateArmSwingBySpeed(speedRatio); } } private void ValidateComponents() { if ((Object)(object)fullBodyBipedIK == (Object)null) { fullBodyBipedIK = ((Component)this).GetComponent(); } if ((Object)(object)aimIK == (Object)null) { aimIK = ((Component)this).GetComponent(); } if ((Object)(object)ragdollUtility == (Object)null) { ragdollUtility = ((Component)this).GetComponent(); } if ((Object)(object)navMeshAgent == (Object)null) { navMeshAgent = ((Component)this).GetComponent(); } if ((Object)(object)fullBodyBipedIK == (Object)null) { Debug.LogError((object)"NPCIKController: 缺少FullBodyBipedIK组件!"); } if ((Object)(object)navMeshAgent == (Object)null) { Debug.LogError((object)"NPCIKController: 缺少NavMeshAgent组件!"); } } private void InitializeComponents() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)navMeshAgent != (Object)null) { navMeshAgent.speed = walkSpeed; navMeshAgent.stoppingDistance = stoppingDistance; navMeshAgent.autoBraking = true; originalAgentHeight = navMeshAgent.height; originalAgentRadius = navMeshAgent.radius; } originalArmSwingSpeed = armSwingSpeed; originalArmSwingAmplitude = armSwingAmplitude; originalPosition = ((Component)this).transform.position; SetEquippedState(equipped: false); SetMovementEnabled(enabled: true); } private void InitializeStateMachine() { if (patrolPoints.Count > 0) { ChangeState(NPCState.Patrol); } else { ChangeState(NPCState.Idle); } } private void UpdateStateMachine() { switch (currentState) { case NPCState.Idle: UpdateIdleState(); break; case NPCState.Patrol: UpdatePatrolState(); break; case NPCState.MoveToPickup: UpdateMoveToPickupState(); UpdateMoveToPickupStateMag(); break; case NPCState.Pickup: UpdatePickupState(); break; case NPCState.Chase: UpdateChaseState(); break; case NPCState.Aim: UpdateAimState(); break; } } private void ChangeState(NPCState newState) { if (currentState != newState) { ExitState(currentState); previousState = currentState; currentState = newState; EnterState(newState); } } private void EnterState(NPCState state) { switch (state) { case NPCState.Idle: if ((Object)(object)navMeshAgent != (Object)null) { navMeshAgent.isStopped = true; } break; case NPCState.Patrol: if ((Object)(object)navMeshAgent != (Object)null) { navMeshAgent.isStopped = false; } MoveToNextPatrolPoint(); break; case NPCState.MoveToPickup: if ((Object)(object)navMeshAgent != (Object)null) { navMeshAgent.isStopped = false; navMeshAgent.speed = runSpeed; } break; case NPCState.Pickup: if ((Object)(object)navMeshAgent != (Object)null) { navMeshAgent.isStopped = true; } ((MonoBehaviour)this).StartCoroutine(PickupWeaponCoroutine()); break; case NPCState.Chase: if ((Object)(object)navMeshAgent != (Object)null) { navMeshAgent.isStopped = false; navMeshAgent.speed = runSpeed; } break; case NPCState.Aim: if ((Object)(object)navMeshAgent != (Object)null) { navMeshAgent.isStopped = true; } break; } } private void ExitState(NPCState state) { if (state == NPCState.Pickup) { isPickingUp = false; } } private void UpdateIdleState() { if (((Object)(object)targetWeapon != (Object)null && !isEquipped) || (isEquipped && !isMagInSlot && (Object)(object)targetMag != (Object)null)) { ChangeState(NPCState.MoveToPickup); } else if (patrolPoints.Count > 0) { ChangeState(NPCState.Patrol); } } private void UpdatePatrolState() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (((Object)(object)targetWeapon != (Object)null && !isEquipped && Vector3.Distance(((Component)this).transform.position, targetWeapon.transform.position) < pickupSearchRange) || (!isMagInSlot && (Object)(object)targetMag != (Object)null && isEquipped && Vector3.Distance(((Component)this).transform.position, targetMag.transform.position) < pickupSearchRange)) { ChangeState(NPCState.MoveToPickup); } else if ((Object)(object)currentTarget != (Object)null && chaseWhenSeeWeapon) { ChangeState(NPCState.Chase); } else { if (!((Object)(object)navMeshAgent != (Object)null) || !(navMeshAgent.remainingDistance <= navMeshAgent.stoppingDistance)) { return; } if (waitTimer <= 0f) { waitTimer = Random.Range(waitTimeRange.x, waitTimeRange.y); navMeshAgent.isStopped = true; return; } waitTimer -= Time.deltaTime; if (waitTimer <= 0f) { navMeshAgent.isStopped = false; MoveToNextPatrolPoint(); } } } private void UpdateMoveToPickupState() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetWeapon == (Object)null) { ChangeState((previousState == NPCState.Patrol) ? NPCState.Patrol : NPCState.Idle); } else if ((Object)(object)navMeshAgent != (Object)null && (Object)(object)targetWeapon != (Object)null) { navMeshAgent.SetDestination(targetWeapon.transform.position); float num = Vector3.Distance(((Component)this).transform.position, targetWeapon.transform.position); if (num <= handReachDistance + 0.5f) { ChangeState(NPCState.Pickup); } } } private void UpdateMoveToPickupStateMag() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetWeapon == (Object)null || (Object)(object)targetMag == (Object)null) { ChangeState((previousState == NPCState.Patrol) ? NPCState.Patrol : NPCState.Idle); } else if ((Object)(object)navMeshAgent != (Object)null && (Object)(object)targetMag != (Object)null) { navMeshAgent.SetDestination(targetMag.transform.position); float num = Vector3.Distance(((Component)this).transform.position, targetMag.transform.position); if (num <= handReachDistance + 0.5f) { ChangeState(NPCState.Pickup); } } } private void UpdatePickupState() { } private void UpdateChaseState() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)currentTarget == (Object)null) { ChangeState((previousState == NPCState.Patrol) ? NPCState.Patrol : NPCState.Idle); return; } float num = Vector3.Distance(((Component)this).transform.position, currentTarget.position); if (num <= aimRange && isEquipped && isMagInSlot) { ChangeState(NPCState.Aim); } else if (num <= visionRange) { if ((Object)(object)navMeshAgent != (Object)null) { navMeshAgent.SetDestination(currentTarget.position); } } else { currentTarget = null; ChangeState((previousState == NPCState.Patrol) ? NPCState.Patrol : NPCState.Idle); } if (((Object)(object)targetWeapon != (Object)null && !isEquipped && Vector3.Distance(((Component)this).transform.position, targetWeapon.transform.position) < pickupSearchRange) || (!isMagInSlot && (Object)(object)targetMag != (Object)null && isEquipped && Vector3.Distance(((Component)this).transform.position, targetMag.transform.position) < pickupSearchRange)) { ChangeState(NPCState.MoveToPickup); } } private void UpdateAimState() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)currentTarget == (Object)null || !isEquipped) { ChangeState((previousState == NPCState.Patrol) ? NPCState.Patrol : NPCState.Idle); return; } float num = Vector3.Distance(((Component)this).transform.position, currentTarget.position); if (num > aimRange) { ChangeState(NPCState.Chase); return; } Vector3 val = currentTarget.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; normalized.y = 0f; if (normalized != Vector3.zero) { float num2 = 3f; Quaternion val2 = Quaternion.LookRotation(normalized); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val2, Time.deltaTime * num2); } } private void UpdatePerception() { DetectWeapons(); DetectMags(); DetectTargets(); } private void DetectWeapons() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if (isEquipped) { return; } Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, pickupSearchRange); GameObject val = null; float num = pickupSearchRange; Collider[] array2 = array; foreach (Collider val2 in array2) { Handgun component = ((Component)val2).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).gameObject != (Object)(object)currentWeapon && ((FVRFireArm)component).UsesMagazines) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (num2 < num) { num = num2; val = ((Component)val2).gameObject; } } } targetWeapon = val; hasWeaponInRange = (Object)(object)targetWeapon != (Object)null; } private void DetectMags() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if (!isEquipped) { return; } Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, pickupSearchRange); GameObject val = null; float num = pickupSearchRange; Collider[] array2 = array; foreach (Collider val2 in array2) { Handgun component = currentWeapon.GetComponent(); FVRFireArmMagazine component2 = ((Component)val2).GetComponent(); if ((Object)(object)component2 != (Object)null && (Object)(object)component != (Object)null && (Object)(object)((Component)component2).gameObject != (Object)(object)currentMag && component2.MagazineType == ((FVRFireArm)component).MagazineType) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (num2 < num) { num = num2; val = ((Component)val2).gameObject; } } } targetMag = val; hasMagInRange = (Object)(object)targetMag != (Object)null; } private void DetectTargets() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) Sosig[] array = Object.FindObjectsOfType(); Transform val = null; float num = visionRange; Sosig[] array2 = array; RaycastHit val4 = default(RaycastHit); foreach (Sosig val2 in array2) { if (!((Object)(object)val2.Links[0] != (Object)null)) { continue; } float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2.Links[0]).gameObject.transform.position); if (num2 <= visionRange) { Vector3 val3 = ((Component)val2.Links[0]).gameObject.transform.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; float num3 = Vector3.Angle(((Component)this).transform.forward, normalized); if (num3 <= visionAngle / 2f && Physics.Raycast(((Component)this).transform.position + Vector3.up * 1f, normalized, ref val4, visionRange) && ((Component)((RaycastHit)(ref val4)).transform).CompareTag("Player") && num2 < num) { num = num2; val = ((Component)val2.Links[0]).gameObject.transform; } } } currentTarget = val; } private IEnumerator PickupWeaponCoroutine() { isPickingUp = true; isCrouching = true; ApplyCrouch(crouch: true); float originalSpeed = navMeshAgent.speed; navMeshAgent.speed = walkSpeed * 0.5f; if ((Object)(object)targetWeapon != (Object)null) { navMeshAgent.SetDestination(targetWeapon.transform.position); float timeout = 3f; float elapsed = 0f; while (navMeshAgent.remainingDistance > handReachDistance && elapsed < timeout && !isUnconscious) { elapsed += Time.deltaTime; yield return null; } } if (!isUnconscious && (Object)(object)targetWeapon != (Object)null) { yield return ((MonoBehaviour)this).StartCoroutine(ReachAndPickup(targetWeapon.transform)); } if (!IsUnconscious && (Object)(object)targetMag != (Object)null && isEquipped) { yield return ((MonoBehaviour)this).StartCoroutine(ReachAndPickupMag(targetMag.transform)); } isCrouching = false; ApplyCrouch(crouch: false); navMeshAgent.speed = originalSpeed; isPickingUp = false; if (previousState == NPCState.Patrol) { ChangeState(NPCState.Patrol); } else { ChangeState(NPCState.Idle); } } private IEnumerator ReachAndPickup(Transform weaponTransform) { fullBodyBipedIK.solver.rightHandEffector.target = weaponTransform; float reachTime = 0.4f; float elapsed = 0f; while (elapsed < reachTime && !isUnconscious) { elapsed += Time.deltaTime; float t = elapsed / reachTime; fullBodyBipedIK.solver.rightHandEffector.positionWeight = t; yield return null; } float handDistance = GetRightHandDistanceToTarget(weaponTransform); if (handDistance <= handReachDistance) { PerformPickup(targetWeapon); } fullBodyBipedIK.solver.rightHandEffector.target = null; fullBodyBipedIK.solver.rightHandEffector.positionWeight = 0f; } private IEnumerator ReachAndPickupMag(Transform magTransform) { fullBodyBipedIK.solver.leftHandEffector.target = magTransform; float reachTime = 0.4f; float elapsed = 0f; while (elapsed < reachTime && !isUnconscious) { elapsed += Time.deltaTime; float t = elapsed / reachTime; fullBodyBipedIK.solver.leftHandEffector.positionWeight = t; yield return null; } float handDistance = GetRightHandDistanceToTargetOtherHand(magTransform); if (handDistance <= handReachDistance) { PerformPickupMag(targetMag); } fullBodyBipedIK.solver.leftHandEffector.target = null; fullBodyBipedIK.solver.leftHandEffector.positionWeight = 0f; } private float GetRightHandDistanceToTarget(Transform target) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fullBodyBipedIK == (Object)null || (Object)(object)fullBodyBipedIK.solver.rightHandEffector.bone == (Object)null) { return float.MaxValue; } Vector3 position = fullBodyBipedIK.solver.rightHandEffector.bone.position; return Vector3.Distance(position, target.position); } private float GetRightHandDistanceToTargetOtherHand(Transform target) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fullBodyBipedIK == (Object)null || (Object)(object)fullBodyBipedIK.solver.leftHandEffector.bone == (Object)null) { return float.MaxValue; } Vector3 position = fullBodyBipedIK.solver.leftHandEffector.bone.position; return Vector3.Distance(position, target.position); } private void PerformPickup(GameObject weapon) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) Handgun component = weapon.GetComponent(); if (!((Object)(object)component == (Object)null)) { currentWeapon = weapon; if ((Object)(object)rightHandGripPoint != (Object)null) { weapon.transform.parent = rightHandGripPoint; weapon.transform.localPosition = Vector3.zero; weapon.transform.localRotation = Quaternion.identity; } else { weapon.transform.parent = ((Component)this).transform; } ((FVRInteractiveObject)component).SetAllCollidersToLayer(false, "NoCol"); SetEquippedState(equipped: true); targetWeapon = null; } } private void PerformPickupMag(GameObject mag) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) FVRFireArmMagazine component = mag.GetComponent(); if (!((Object)(object)mag == (Object)null)) { currentWeapon = mag; if ((Object)(object)magPouch != (Object)null) { mag.transform.parent = magPouch; mag.transform.localPosition = Vector3.zero; mag.transform.localRotation = Quaternion.identity; } else { mag.transform.parent = ((Component)this).transform; } ((FVRInteractiveObject)component).SetAllCollidersToLayer(false, "NoCol"); SetEquippedState(equipped: true); targetMag = null; } } private void ApplyCrouch(bool crouch) { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)navMeshAgent == (Object)null)) { if (crouch) { navMeshAgent.height = originalAgentHeight * 0.6f; navMeshAgent.radius = originalAgentRadius * 0.8f; Vector3 position = ((Component)this).transform.position; position.y = originalPosition.y + crouchHeightOffset; ((Component)this).transform.position = position; } else { navMeshAgent.height = originalAgentHeight; navMeshAgent.radius = originalAgentRadius; Vector3 position2 = ((Component)this).transform.position; position2.y = originalPosition.y; ((Component)this).transform.position = position2; } } } private void SetEquippedState(bool equipped) { isEquipped = equipped; if ((Object)(object)currentWeapon != (Object)null) { currentWeapon.SetActive(isEquipped); } if (isEquipped) { leftHandWeight = 0.2f; rightHandWeight = 1f; armSwingAmplitude = 5f; armSwingSpeed = 1.5f; } else { leftHandWeight = 0.5f; rightHandWeight = 0.5f; armSwingAmplitude = originalArmSwingAmplitude; armSwingSpeed = originalArmSwingSpeed; } } private void UpdateIKWeights() { if ((Object)(object)fullBodyBipedIK == (Object)null) { return; } ((IKSolver)fullBodyBipedIK.solver).SetIKPositionWeight(1f); if (isEquipped && !isPickingUp && !isUnconscious) { if ((Object)(object)rightHandGripPoint != (Object)null) { fullBodyBipedIK.solver.rightHandEffector.target = rightHandGripPoint; fullBodyBipedIK.solver.rightHandEffector.positionWeight = 1f; fullBodyBipedIK.solver.rightHandEffector.rotationWeight = 0.8f; } if ((Object)(object)leftHandGripPoint != (Object)null) { Handgun component = currentWeapon.gameObject.GetComponent(); if (((Object)(object)((FVRFireArm)component).Magazine != (Object)null && isMagInSlot) || ((Object)(object)((FVRFireArm)component).Magazine == (Object)null && !isMagInSlot)) { fullBodyBipedIK.solver.leftHandEffector.target = leftHandGripPoint; fullBodyBipedIK.solver.leftHandEffector.positionWeight = leftHandWeight; fullBodyBipedIK.solver.leftHandEffector.rotationWeight = 0.4f; } } if ((Object)(object)aimIK != (Object)null && (Object)(object)aimTarget != (Object)null && currentState == NPCState.Aim) { ((IKSolverHeuristic)aimIK.solver).target = aimTarget; if (!((Behaviour)aimIK).enabled) { ((Behaviour)aimIK).enabled = true; } ((IKSolver)aimIK.solver).SetIKPositionWeight(aimWeightValue); } else if ((Object)(object)aimIK != (Object)null) { float iKPositionWeight = ((IKSolver)aimIK.solver).GetIKPositionWeight(); iKPositionWeight = Mathf.Lerp(iKPositionWeight, 0f, Time.deltaTime * 5f); ((IKSolver)aimIK.solver).SetIKPositionWeight(iKPositionWeight); if (iKPositionWeight <= 0.01f && ((Behaviour)aimIK).enabled) { ((Behaviour)aimIK).enabled = false; } } } else { fullBodyBipedIK.solver.rightHandEffector.target = null; fullBodyBipedIK.solver.leftHandEffector.target = null; fullBodyBipedIK.solver.rightHandEffector.positionWeight = rightHandWeight; fullBodyBipedIK.solver.leftHandEffector.positionWeight = leftHandWeight; if ((Object)(object)aimIK != (Object)null) { ((IKSolver)aimIK.solver).SetIKPositionWeight(0f); ((Behaviour)aimIK).enabled = false; } } } private void UpdateArmSwingVisual() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fullBodyBipedIK == (Object)null) { return; } if ((Object)(object)navMeshAgent != (Object)null) { Vector3 velocity = navMeshAgent.velocity; if (((Vector3)(ref velocity)).magnitude > 0.1f) { armSwingTimer += Time.deltaTime * armSwingSpeed; return; } } armSwingTimer = Mathf.Lerp(armSwingTimer, 0f, Time.deltaTime * 5f); } private void UpdateArmSwingBySpeed(float speedRatio) { if (!((Object)(object)fullBodyBipedIK == (Object)null)) { float num = Mathf.Sin(armSwingTimer) * armSwingAmplitude * speedRatio; float num2 = Mathf.Sin(armSwingTimer + (float)Math.PI) * armSwingAmplitude * speedRatio; float positionWeight = leftHandWeight * (0.4f + Mathf.Abs(num) * 0.6f * speedRatio); float positionWeight2 = rightHandWeight * (0.4f + Mathf.Abs(num2) * 0.6f * speedRatio); fullBodyBipedIK.solver.leftHandEffector.positionWeight = positionWeight; fullBodyBipedIK.solver.rightHandEffector.positionWeight = positionWeight2; } } private void MoveToNextPatrolPoint() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (patrolPoints.Count == 0) { return; } if (currentPatrolIndex >= patrolPoints.Count) { if (!loopPatrol) { return; } currentPatrolIndex = 0; } if ((Object)(object)patrolPoints[currentPatrolIndex] != (Object)null) { navMeshAgent.SetDestination(patrolPoints[currentPatrolIndex].position); } currentPatrolIndex++; } public void AddPatrolPoint(Transform point) { if (!patrolPoints.Contains(point)) { patrolPoints.Add(point); } } public void ClearPatrolPoints() { patrolPoints.Clear(); } private void HandleUnconsciousState() { if (autoRecoveryTime > 0f) { autoRecoveryTimer -= Time.deltaTime; if (autoRecoveryTimer <= 0f) { SetUnconscious(unconscious: false); } } } public void SetUnconscious(bool unconscious) { if ((Object)(object)ragdollUtility == (Object)null) { Debug.LogWarning((object)"RagdollUtility未设置"); } else { if (unconscious == isUnconscious) { return; } isUnconscious = unconscious; if (isUnconscious) { ChangeState(NPCState.Unconscious); ragdollUtility.EnableRagdoll(); if (isEquipped) { Handgun component = currentWeapon.gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { return; } ((FVRInteractiveObject)component).SetAllCollidersToLayer(false, "Default"); currentWeapon.gameObject.transform.SetParent((Transform)null); currentWeapon = null; isEquipped = false; } if (isMagInSlot) { FVRFireArmMagazine component2 = currentMag.gameObject.GetComponent(); if ((Object)(object)component2 == (Object)null) { return; } ((FVRInteractiveObject)component2).SetAllCollidersToLayer(false, "Default"); currentMag.gameObject.transform.SetParent((Transform)null); currentMag = null; isMagInSlot = false; } if ((Object)(object)navMeshAgent != (Object)null) { ((Behaviour)navMeshAgent).enabled = false; } if (autoRecoveryTime > 0f) { autoRecoveryTimer = autoRecoveryTime; } } else { ((MonoBehaviour)this).StartCoroutine(RecoverFromRagdoll()); } } } private IEnumerator RecoverFromRagdoll() { ragdollUtility.DisableRagdoll(); float elapsed = 0f; while (elapsed < ragdollRecoveryTime) { elapsed += Time.deltaTime; yield return null; } if ((Object)(object)navMeshAgent != (Object)null) { ((Behaviour)navMeshAgent).enabled = true; } RaycastHit hit = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position + Vector3.up, Vector3.down, ref hit, 2f)) { Vector3 position = ((Component)this).transform.position; position.y = ((RaycastHit)(ref hit)).point.y; ((Component)this).transform.position = position; if ((Object)(object)navMeshAgent != (Object)null) { navMeshAgent.Warp(position); } } if (patrolPoints.Count > 0) { ChangeState(NPCState.Patrol); } else { ChangeState(NPCState.Idle); } } public void SetMovementEnabled(bool enabled) { if ((Object)(object)navMeshAgent != (Object)null) { navMeshAgent.isStopped = !enabled; } } public void MoveToPosition(Vector3 position) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)navMeshAgent != (Object)null) { navMeshAgent.SetDestination(position); ChangeState(NPCState.Chase); currentTarget = null; } } public void SetTarget(Transform target) { currentTarget = target; if ((Object)(object)target != (Object)null) { ChangeState(NPCState.Chase); } } public void ForceEquipWeapon(GameObject weapon) { if ((Object)(object)currentWeapon != (Object)null) { UnequipWeapon(); } PerformPickup(weapon); } public void UnequipWeapon() { if ((Object)(object)currentWeapon != (Object)null) { currentWeapon.SetActive(false); } SetEquippedState(equipped: false); currentWeapon = null; } } } namespace JerryComponent { public class knobrot : FVRInteractiveObject { public Transform RotPiece; private Quaternion targetRotation; private Quaternion lastRotation; private float angularSpeedDeg; [NonSerialized] public float m_curRot; public GameObject rotknob; [NonSerialized] public Vector3 lastHandForward = Vector3.zero; public override void BeginInteraction(FVRViveHand hand) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).BeginInteraction(hand); lastHandForward = Vector3.ProjectOnPlane(((HandInput)(ref base.m_hand.Input)).Up, ((Component)this).transform.right); } public override void EndInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).EndInteraction(hand); } private void Start() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) lastRotation = ((Component)RotPiece).transform.localRotation; } public void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) Quaternion val = ((Component)RotPiece).transform.localRotation * Quaternion.Inverse(lastRotation); float num = default(float); Vector3 val2 = default(Vector3); ((Quaternion)(ref val)).ToAngleAxis(ref num, ref val2); angularSpeedDeg = num / Time.deltaTime; rotknob.transform.localEulerAngles = new Vector3(0f, 0.1f * Time.deltaTime * angularSpeedDeg, 0f); if (rotknob.transform.localEulerAngles.y > 90f) { rotknob.transform.localEulerAngles = new Vector3(0f, 90f, 0f); } else if (rotknob.transform.localEulerAngles.y < 0f) { rotknob.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } lastRotation = ((Component)RotPiece).transform.localRotation; if (((FVRInteractiveObject)this).IsHeld) { float curRot = m_curRot; Vector3 val3 = Vector3.ProjectOnPlane(((HandInput)(ref base.m_hand.Input)).Up, -((Component)this).transform.right); Vector3 val4 = Vector3.ProjectOnPlane(lastHandForward, -((Component)this).transform.right); float num2 = Mathf.Atan2(Vector3.Dot(-((Component)this).transform.right, Vector3.Cross(val3, val4)), Vector3.Dot(val3, val4)) * 57.29578f; m_curRot -= num2; if (m_curRot <= -360f) { RotPiece.localEulerAngles = new Vector3(0f, 0f, 0f); m_curRot = 0f; } else if (m_curRot >= 0f) { RotPiece.localEulerAngles = new Vector3(0f, 0f, 360f); m_curRot = 0f; } else { RotPiece.localEulerAngles = new Vector3(0f, 0f, 0f - m_curRot); } lastHandForward = val3; } } } public class PassOut : MonoBehaviour { private GM gm; public SkinnedMeshRenderer skin; public int mouth2 = 322; public int eye3 = 15; public int eye2 = 67; public SkinnedMeshRenderer skin2; public SkinnedMeshRenderer skinhappy; public SkinnedMeshRenderer skinmad; public Material socks; public Material pantyhose; public Material pants; public Material hoody; public Material shirt; public float happyness = 0f; public SkinnedMeshRenderer ough; public bool isOugh = false; public Collider oughCol; public GameObject ForeArmL; public Vector3 ForeArmL_S; public GameObject ForeArmR; public Vector3 ForeArmR_S; public GameObject UpperArmL; public Vector3 UpperArmL_S; public GameObject UpperArmR; public Vector3 UpperArmR_S; [Header("定位点(世界坐标)")] public Transform[] waypoints; public BlinkCustom blink; public bool isLower = false; public PassOut otherPO; public bool isNPC = false; public Ragdoll Gunner; public Transform forehead; public Transform[] GetWaypoints() { return waypoints; } private void Start() { if (!isLower && !isNPC) { gm = GameObject.Find("_GameManager(Clone)").GetComponent(); } } private void OnTriggerStay(Collider other) { if (!isLower && (Object)(object)oughCol == (Object)null && (Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && ((Component)other).gameObject.GetComponent().radius <= 0.02f) { oughCol = other; isOugh = true; } if (isLower && (Object)(object)otherPO != (Object)null && (Object)(object)otherPO.oughCol == (Object)null && (Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && ((Component)other).gameObject.GetComponent().radius <= 0.02f) { otherPO.oughCol = other; otherPO.isOugh = true; } } private void OnTriggerExit(Collider other) { if (!isLower && (Object)(object)oughCol != (Object)null && (Object)(object)other == (Object)(object)oughCol) { isOugh = false; oughCol = null; } if (isLower && (Object)(object)otherPO != (Object)null && (Object)(object)otherPO.oughCol != (Object)null && (Object)(object)other == (Object)(object)otherPO.oughCol) { otherPO.isOugh = false; otherPO.oughCol = null; } } private void OnShotFired(FVRFireArm firearm) { if (!isLower && !isNPC) { if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable != (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent() != (Object)null && (Object)(object)firearm == (Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent()) { happyness += 1f; } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable != (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent() != (Object)null && (Object)(object)firearm == (Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent()) { happyness += 1f; } } } private void Awake() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown if (!isLower && !isNPC) { GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(OnShotFired); } } private void FixedUpdate() { //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0a9f: Unknown result type (might be due to invalid IL or missing references) //IL_0ab5: Unknown result type (might be due to invalid IL or missing references) //IL_0acb: Unknown result type (might be due to invalid IL or missing references) //IL_0ae1: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0757: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_0799: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0947: Unknown result type (might be due to invalid IL or missing references) //IL_096b: Unknown result type (might be due to invalid IL or missing references) //IL_098f: Unknown result type (might be due to invalid IL or missing references) //IL_09b3: Unknown result type (might be due to invalid IL or missing references) if (!isLower && !isNPC && (Object)(object)GM.CurrentPlayerBody != (Object)null) { if (!gm.m_isDead) { if ((float)GM.CurrentPlayerBody.GetPlayerHealthRaw() <= 0.25f * (float)GM.CurrentPlayerBody.GetMaxHealthPlayerRaw()) { if (!isOugh) { ((Component)skin).gameObject.SetActive(false); ((Component)skinhappy).gameObject.SetActive(false); if (happyness >= 20f) { ((Component)skin2).gameObject.SetActive(false); ((Component)skinmad).gameObject.SetActive(true); } if (happyness < 20f) { ((Component)skin2).gameObject.SetActive(true); ((Component)skinmad).gameObject.SetActive(false); } ((Component)ough).gameObject.SetActive(false); } else if (isOugh) { ((Component)skin).gameObject.SetActive(false); ((Component)skin2).gameObject.SetActive(false); ((Component)skinhappy).gameObject.SetActive(false); ((Component)skinmad).gameObject.SetActive(false); ((Component)ough).gameObject.SetActive(true); } socks.SetFloat("_DissolveCutoff", 0.5f); pantyhose.SetFloat("_DissolveCutoff", 0.5f); pants.SetFloat("_DissolveCutoff", 0.5f); hoody.SetFloat("_DissolveCutoff", 0.5f); shirt.SetFloat("_DissolveCutoff", 0.5f); ForeArmL.transform.localScale = ForeArmL_S; ForeArmR.transform.localScale = ForeArmR_S; UpperArmL.transform.localScale = UpperArmL_S; UpperArmR.transform.localScale = UpperArmR_S; } if ((float)GM.CurrentPlayerBody.GetPlayerHealthRaw() > 0.25f * (float)GM.CurrentPlayerBody.GetMaxHealthPlayerRaw()) { if (!isOugh) { ((Component)skinmad).gameObject.SetActive(false); ((Component)skin2).gameObject.SetActive(false); if (happyness >= 20f) { ((Component)skin).gameObject.SetActive(false); ((Component)skinhappy).gameObject.SetActive(true); } if (happyness < 20f) { ((Component)skin).gameObject.SetActive(true); ((Component)skinhappy).gameObject.SetActive(false); } ((Component)ough).gameObject.SetActive(false); } else if (isOugh) { ((Component)skin).gameObject.SetActive(false); ((Component)skin2).gameObject.SetActive(false); ((Component)skinhappy).gameObject.SetActive(false); ((Component)skinmad).gameObject.SetActive(false); ((Component)ough).gameObject.SetActive(true); } socks.SetFloat("_DissolveCutoff", 0f); pantyhose.SetFloat("_DissolveCutoff", 0f); pants.SetFloat("_DissolveCutoff", 0f); hoody.SetFloat("_DissolveCutoff", 0f); shirt.SetFloat("_DissolveCutoff", 0f); ForeArmL.transform.localScale = new Vector3(0f, 0f, 0f); ForeArmR.transform.localScale = new Vector3(0f, 0f, 0f); UpperArmL.transform.localScale = new Vector3(0f, 0f, 0f); UpperArmR.transform.localScale = new Vector3(0f, 0f, 0f); } } else if (gm.m_isDead) { ((Component)skin).gameObject.SetActive(true); ((Component)skin2).gameObject.SetActive(false); ((Component)skinhappy).gameObject.SetActive(false); ((Component)skinmad).gameObject.SetActive(false); ((Component)ough).gameObject.SetActive(false); socks.SetFloat("_DissolveCutoff", 0.5f); pantyhose.SetFloat("_DissolveCutoff", 0.5f); pants.SetFloat("_DissolveCutoff", 0.5f); hoody.SetFloat("_DissolveCutoff", 0.5f); shirt.SetFloat("_DissolveCutoff", 0.5f); ForeArmL.transform.localScale = ForeArmL_S; ForeArmR.transform.localScale = ForeArmR_S; UpperArmL.transform.localScale = UpperArmL_S; UpperArmR.transform.localScale = UpperArmR_S; } } if (isLower || !isNPC || !((Object)(object)Gunner != (Object)null)) { return; } if (!Gunner.dead) { if (Gunner.isLowHealth) { if (!isOugh) { ((Component)skin).gameObject.SetActive(false); ((Component)skinmad).gameObject.SetActive(false); if (happyness >= 20f) { ((Component)skin2).gameObject.SetActive(false); ((Component)skinhappy).gameObject.SetActive(true); } if (happyness < 20f) { ((Component)skin2).gameObject.SetActive(true); ((Component)skinhappy).gameObject.SetActive(false); } ((Component)ough).gameObject.SetActive(false); } else if (isOugh) { ((Component)skin).gameObject.SetActive(false); ((Component)skin2).gameObject.SetActive(false); ((Component)skinhappy).gameObject.SetActive(false); ((Component)skinmad).gameObject.SetActive(false); ((Component)ough).gameObject.SetActive(true); } socks.SetFloat("_DissolveCutoff", 0.5f); pantyhose.SetFloat("_DissolveCutoff", 0.5f); pants.SetFloat("_DissolveCutoff", 0.5f); hoody.SetFloat("_DissolveCutoff", 0.5f); shirt.SetFloat("_DissolveCutoff", 0.5f); ForeArmL.transform.localScale = ForeArmL_S; ForeArmR.transform.localScale = ForeArmR_S; UpperArmL.transform.localScale = UpperArmL_S; UpperArmR.transform.localScale = UpperArmR_S; } if (Gunner.isLowHealth) { return; } if (!isOugh) { ((Component)skinmad).gameObject.SetActive(false); ((Component)skin2).gameObject.SetActive(false); if (happyness >= 20f) { ((Component)skin).gameObject.SetActive(false); ((Component)skinhappy).gameObject.SetActive(true); } if (happyness < 20f) { ((Component)skin).gameObject.SetActive(true); ((Component)skinhappy).gameObject.SetActive(false); } ((Component)ough).gameObject.SetActive(false); } else if (isOugh) { ((Component)skin).gameObject.SetActive(false); ((Component)skin2).gameObject.SetActive(false); ((Component)skinhappy).gameObject.SetActive(false); ((Component)skinmad).gameObject.SetActive(false); ((Component)ough).gameObject.SetActive(true); } socks.SetFloat("_DissolveCutoff", 0f); pantyhose.SetFloat("_DissolveCutoff", 0f); pants.SetFloat("_DissolveCutoff", 0f); hoody.SetFloat("_DissolveCutoff", 0f); shirt.SetFloat("_DissolveCutoff", 0f); ForeArmL.transform.localScale = new Vector3(0f, 0f, 0f); ForeArmR.transform.localScale = new Vector3(0f, 0f, 0f); UpperArmL.transform.localScale = new Vector3(0f, 0f, 0f); UpperArmR.transform.localScale = new Vector3(0f, 0f, 0f); } else if (Gunner.dead) { ((Component)skin).gameObject.SetActive(true); ((Component)skin2).gameObject.SetActive(false); ((Component)skinhappy).gameObject.SetActive(false); ((Component)skinmad).gameObject.SetActive(false); ((Component)ough).gameObject.SetActive(false); socks.SetFloat("_DissolveCutoff", 0.5f); pantyhose.SetFloat("_DissolveCutoff", 0.5f); pants.SetFloat("_DissolveCutoff", 0.5f); hoody.SetFloat("_DissolveCutoff", 0.5f); shirt.SetFloat("_DissolveCutoff", 0.5f); ForeArmL.transform.localScale = ForeArmL_S; ForeArmR.transform.localScale = ForeArmR_S; UpperArmL.transform.localScale = UpperArmL_S; UpperArmR.transform.localScale = UpperArmR_S; } } private void Update() { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) if (!isLower && !isNPC) { happyness -= Time.deltaTime * 5f; if (happyness > 25f) { happyness = 25f; } if (happyness < 0f) { happyness = 0f; } if (Time.frameCount % 30 == 0) { PassedOut(); Wake(); } } if (isLower || !isNPC) { return; } if ((Object)(object)forehead != (Object)null) { if (Vector3.Distance(((Component)GM.CurrentMovementManager.Hands[0]).gameObject.transform.position, forehead.position) < 0.15f && ((Vector3)(ref GM.CurrentMovementManager.Hands[0].Input.VelLinearWorld)).magnitude >= 0.25f) { happyness += Time.deltaTime * 17.5f; } if (Vector3.Distance(((Component)GM.CurrentMovementManager.Hands[1]).gameObject.transform.position, forehead.position) < 0.15f && ((Vector3)(ref GM.CurrentMovementManager.Hands[1].Input.VelLinearWorld)).magnitude >= 0.25f) { happyness += Time.deltaTime * 17.5f; } } happyness -= Time.deltaTime * 5f; if (happyness > 25f) { happyness = 25f; } if (happyness < 0f) { happyness = 0f; } if (Time.frameCount % 30 == 0) { PassedOut(); Wake(); } } public void PassedOut() { if (!isLower && !isNPC) { float blendShapeWeight = skin.GetBlendShapeWeight(eye3); if ((Object)(object)blink != (Object)null) { ((Behaviour)blink).enabled = false; skin.SetBlendShapeWeight(eye3, 0f); } if (gm.m_isDead && blendShapeWeight == 0f) { skin.SetBlendShapeWeight(eye2, 100f); skin.SetBlendShapeWeight(mouth2, 50f); } } if (!isLower && isNPC) { float blendShapeWeight2 = skin.GetBlendShapeWeight(eye3); if ((Object)(object)blink != (Object)null) { ((Behaviour)blink).enabled = false; skin.SetBlendShapeWeight(eye3, 0f); } if ((!Gunner.conscious || Gunner.dead) && blendShapeWeight2 == 0f) { skin.SetBlendShapeWeight(eye2, 100f); skin.SetBlendShapeWeight(mouth2, 50f); } } } public void Wake() { if (!isLower && !isNPC) { if ((Object)(object)blink != (Object)null) { ((Behaviour)blink).enabled = true; } if (!gm.m_isDead) { skin.SetBlendShapeWeight(eye2, 0f); skin.SetBlendShapeWeight(mouth2, 0f); } } if (!isLower && isNPC) { if ((Object)(object)blink != (Object)null) { ((Behaviour)blink).enabled = true; } if (!Gunner.dead && Gunner.conscious) { skin.SetBlendShapeWeight(eye2, 0f); skin.SetBlendShapeWeight(mouth2, 0f); } } } private void OnDestroy() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown if (!isLower && !isNPC) { GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(OnShotFired); } } } public class PlayerSize : MonoBehaviour { public float size; private void Awake() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) ((Component)GM.CurrentMovementManager).transform.localScale = new Vector3(size, size, size); } private void Start() { } private void Update() { } private void OnDestroy() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((Component)GM.CurrentMovementManager).transform.localScale = new Vector3(1f, 1f, 1f); } } public class TakingDamage : MonoBehaviour { private ParticleSystem ps; private FVRPlayerBody pbh; public SkinnedMeshRenderer skin; public int num; public int eye2; public int mouth; public int mouth2; public int eye3; private void Start() { ps = GameObject.Find("DamagePSystemLight").GetComponent(); pbh = GameObject.Find("[CameraRig]Fixed").GetComponent(); } private void Update() { if (Time.frameCount % 10 == 0) { Blinkeyes100(); Openeyes75(); } } private void Blinkeyes100() { if ((float)ps.particleCount > 0f) { skin.SetBlendShapeWeight(eye3, 0f); skin.SetBlendShapeWeight(num, 100f); skin.SetBlendShapeWeight(mouth, 50f); } } public void Openeyes75() { if ((float)ps.particleCount <= 0f) { skin.SetBlendShapeWeight(num, 0f); skin.SetBlendShapeWeight(mouth, 0f); } } } public class LookAtPlayer : MonoBehaviour { public GameObject obj; private void Start() { } private void FixedUpdate() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { AxisLookAt(obj.transform, GM.CurrentPlayerBody.Head.position, Vector3.forward); } } private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f); } } public class BugMaster : MonoBehaviour { public GameObject rot; public GameObject steve; public GameObject glyphid; private void Start() { } public void OnTriggerStay(Collider other) { if (((Object)((Component)other).gameObject).name == "steveAI") { steve = ((Component)other).gameObject; } } private void Update() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)steve == (Object)null) { } if (rot.transform.localEulerAngles.x > 45f && (Object)(object)steve == (Object)null) { Object.Instantiate(glyphid, ((Component)this).gameObject.transform.position, new Quaternion(0f, 0f, 0f, 0f)); } } } public class Glyphid : MonoBehaviour { public NavMeshAgent agent; public bool is_dead = false; public List currentAI = null; public Transform nearestAI = null; public Transform player; public GameObject bait; public GameObject teeth; public GameObject deathbody; public GameObject deadpos; public GameObject main; public void OnTriggerEnter(Collider other) { if (((Object)((Component)other).gameObject).name == "BugMaster(Clone)") { bait = ((Component)other).gameObject; } if (((Object)((Component)other).gameObject).name == "Sosig_Torso") { currentAI.Add(((Component)other).gameObject.GetComponent()); } } public void Update() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) if (is_dead) { Object.Destroy((Object)(object)main); Object.Destroy((Object)(object)teeth); } if ((Object)(object)bait != (Object)null) { agent.stoppingDistance = 4f; agent.SetDestination(bait.transform.position); teeth.SetActive(false); } if (currentAI == null || (Object)(object)nearestAI == (Object)null || (Object)(object)bait == (Object)null) { } if (currentAI != null && (Object)(object)nearestAI != (Object)null) { agent.stoppingDistance = 0f; agent.SetDestination(((Component)nearestAI).transform.position); teeth.SetActive(true); } if (currentAI == null) { return; } for (int i = 0; i < currentAI.Count; i++) { if ((Object)(object)currentAI[i] == (Object)null) { currentAI.Remove(currentAI[i]); } } nearestAI = GetNearestGameObject(player, currentAI); } public Transform GetNearestGameObject(Transform player, List objects) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) Transform val = null; if (objects == null || (Object)(object)val == (Object)null) { } if (objects.Count > 0 && (Object)(object)objects[0] != (Object)null) { val = ((Component)objects[0]).transform; float num = Vector3.Distance(player.position, ((Component)objects[0]).transform.position); for (int i = 1; i < objects.Count; i++) { float num2 = Vector3.Distance(player.position, ((Component)objects[i]).transform.position); if (num > num2) { num = num2; val = ((Component)objects[i]).transform; } } } return val; } public void OnDestroy() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Object.Instantiate(deathbody, deadpos.transform.position, deadpos.transform.rotation); } } public class GlyphidDead : MonoBehaviour { public Rigidbody chest; public Rigidbody back; public Rigidbody head; public Rigidbody LF1; public Rigidbody RF1; public Rigidbody LF2; public Rigidbody RF2; public Rigidbody LF3; public Rigidbody RF3; public Rigidbody L11; public Rigidbody R11; public Rigidbody L12; public Rigidbody R12; public Rigidbody L21; public Rigidbody R21; public Rigidbody L22; public Rigidbody R22; public Rigidbody L31; public Rigidbody R31; public Rigidbody L32; public Rigidbody R32; private void Start() { } private void Update() { chest.isKinematic = false; back.isKinematic = false; head.isKinematic = false; LF1.isKinematic = false; LF2.isKinematic = false; LF3.isKinematic = false; RF1.isKinematic = false; RF2.isKinematic = false; RF3.isKinematic = false; L11.isKinematic = false; L12.isKinematic = false; R11.isKinematic = false; R12.isKinematic = false; L21.isKinematic = false; L22.isKinematic = false; R21.isKinematic = false; R22.isKinematic = false; L31.isKinematic = false; L32.isKinematic = false; R31.isKinematic = false; R32.isKinematic = false; } } public class deathofabug : MonoBehaviour, IFVRDamageable { public Glyphid bug; public float MinDamageRequired = 10000f; public float MaxDamageRequired = 50000f; private float _damageRequired; private float _damageReceived; private void Start() { _damageRequired = Random.Range(MinDamageRequired, MaxDamageRequired); } public void Damage(Damage dam) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if ((int)dam.Class == 1) { Vector3 val = dam.point + dam.hitNormal * Random.Range(0.002f, 0.008f); _damageReceived += dam.Dam_Blunt; if (_damageReceived >= _damageRequired) { bug.is_dead = true; } } } private void Update() { } } public class HLAHeadCrab : MonoBehaviour, IFVRDamageable { public VRMAP VRMAP; public FOOTIK FOOTIK; public Jump Jump; public VRRIG VRRIG; public VRanimatorcontroller VRAC; public float att = 2.5f; public AudioEvent death; public AudioEvent chir; public NavMeshAgent NMA; public Rigidbody R; public RagdollUtility RDU; public float sleeptime = 15f; public GameObject view; public GameObject viewback; public float m_Range = 10f; public Animator A; public bool Greetings = false; public float jumpforce = 50f; public float forcerad = 4f; public float upfor = 1f; public bool dead = false; public KillAfter KA; private void Start() { RDU.DisableRagdoll(); ((Behaviour)NMA).enabled = true; ((Behaviour)KA).enabled = false; } public void Damage(Damage dam) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Invalid comparison between Unknown and I4 if (((int)dam.Class == 0 || (int)dam.Class == 4 || (int)dam.Class == 2 || (int)dam.Class == 3 || (int)dam.Class == 1) && !dead) { dead = true; SM.PlayCoreSound((FVRPooledAudioType)41, death, ((Component)this).gameObject.transform.position); } } private void Update() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) if (dead) { ((Behaviour)VRMAP).enabled = false; ((Behaviour)FOOTIK).enabled = false; ((Behaviour)Jump).enabled = false; ((Behaviour)VRRIG).enabled = false; ((Behaviour)VRAC).enabled = false; RDU.EnableRagdoll(); ((Behaviour)NMA).enabled = false; ((Behaviour)KA).enabled = true; } else { if (dead) { return; } ((Behaviour)KA).enabled = false; if (!((Object)(object)GM.CurrentPlayerBody != (Object)null)) { return; } if (Vector3.Distance(GM.CurrentPlayerBody.Head.position, ((Component)this).gameObject.transform.position) > 15f) { ((Behaviour)VRMAP).enabled = true; ((Behaviour)FOOTIK).enabled = true; ((Behaviour)Jump).enabled = true; ((Behaviour)VRRIG).enabled = true; ((Behaviour)VRAC).enabled = true; ((Behaviour)NMA).enabled = true; RDU.DisableRagdoll(); sleeptime -= Time.deltaTime; if (sleeptime > 0f) { A.SetBool("Sleep", false); if (!NMA.pathPending && !(NMA.remainingDistance > 0.1f)) { NMA.destination = Vector2.op_Implicit(m_Range * Random.insideUnitCircle); } } else if (sleeptime <= 0f) { A.SetBool("Sleep", true); } } else if (Vector3.Distance(GM.CurrentPlayerBody.Head.position, ((Component)this).gameObject.transform.position) < 15f && Vector3.Distance(GM.CurrentPlayerBody.Head.position, ((Component)this).gameObject.transform.position) > 5f) { ((Behaviour)VRMAP).enabled = true; ((Behaviour)FOOTIK).enabled = true; ((Behaviour)Jump).enabled = true; ((Behaviour)VRRIG).enabled = true; ((Behaviour)VRAC).enabled = true; ((Behaviour)NMA).enabled = true; RDU.DisableRagdoll(); sleeptime = 15f; A.SetBool("Sleep", false); NMA.SetDestination(GM.CurrentPlayerBody.Head.position); } else { if (!(Vector3.Distance(GM.CurrentPlayerBody.Head.position, ((Component)this).gameObject.transform.position) < 5f)) { return; } if (!Greetings) { ((Behaviour)VRMAP).enabled = true; ((Behaviour)FOOTIK).enabled = true; ((Behaviour)Jump).enabled = true; ((Behaviour)VRRIG).enabled = true; ((Behaviour)VRAC).enabled = true; ((Behaviour)NMA).enabled = true; RDU.DisableRagdoll(); A.SetTrigger("Greeting"); if (att > 0f) { att -= Time.deltaTime; } else if (att <= 0f) { AxisLookAt(view.transform, ((Component)GM.CurrentPlayerBody.Head).transform.position, Vector3.forward); SM.PlayCoreSound((FVRPooledAudioType)41, chir, ((Component)this).transform.position); att = 2.5f; Greetings = true; } } else { if (!Greetings) { return; } ((Behaviour)VRMAP).enabled = false; ((Behaviour)FOOTIK).enabled = false; ((Behaviour)Jump).enabled = false; ((Behaviour)VRRIG).enabled = false; ((Behaviour)VRAC).enabled = false; ((Behaviour)NMA).enabled = false; RDU.EnableRagdoll(); R.AddExplosionForce(jumpforce, viewback.transform.position, forcerad, upfor, (ForceMode)2); float num = 5f; if (Vector3.Distance(((Component)this).gameObject.transform.position, GM.CurrentPlayerBody.Head.position) > 0.1f) { if (num > 0f) { num -= Time.deltaTime; } if (num <= 0f) { Greetings = false; num = 5f; } } else if (Vector3.Distance(((Component)this).gameObject.transform.position, GM.CurrentPlayerBody.Head.position) < 0.1f) { ((Component)this).gameObject.transform.position = new Vector3(GM.CurrentPlayerBody.Head.position.x, GM.CurrentPlayerBody.Head.position.y + 0.05f, GM.CurrentPlayerBody.Head.position.z); ((Component)this).gameObject.transform.eulerAngles = GM.CurrentPlayerBody.Head.eulerAngles; FVRPlayerBody currentPlayerBody = GM.CurrentPlayerBody; currentPlayerBody.Health -= 2.5f * Time.deltaTime; } } } } } private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f); } } } public class DDOL : MonoBehaviour { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); } private void Update() { } } namespace JerryLegsIK { public class MPResizer : MonoBehaviour { public GameObject Obj; public float curSize; public AR15HandleSightFlipper Plus; public AR15HandleSightFlipper Minus; public float Max; public float Min; private void Start() { curSize = 1f; } private void Update() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) if (!Plus.m_isLargeAperture && ((Component)Plus.Flipsight).transform.localEulerAngles.x > 45f) { Plus.m_isLargeAperture = true; curSize += 0.05f; } if (!Minus.m_isLargeAperture && ((Component)Minus.Flipsight).transform.localEulerAngles.x > 45f) { Minus.m_isLargeAperture = true; curSize -= 0.05f; } Obj.transform.localScale = new Vector3(curSize, curSize, curSize); curSize = Mathf.Clamp(curSize, Min, Max); } } } namespace JerryComponent { public class HideBreast : MonoBehaviour { public FVRQuickBeltSlot slotBackpack; public FVRQuickBeltSlot slotArmor; public SkinnedMeshRenderer Bra; public SkinnedMeshRenderer Body; public GameObject colL; public GameObject colR; public GameObject trigger; private void FixedUpdate() { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)slotArmor.CurObject != (Object)null || (Object)(object)slotBackpack.CurObject != (Object)null) { Bra.SetBlendShapeWeight(1, 0f); Bra.SetBlendShapeWeight(2, 100f); Bra.SetBlendShapeWeight(3, 0f); Body.SetBlendShapeWeight(7, 0f); Body.SetBlendShapeWeight(8, 100f); Body.SetBlendShapeWeight(9, 0f); colL.transform.localScale = new Vector3(0f, 0f, 0f); colR.transform.localScale = new Vector3(0f, 0f, 0f); } else if ((Object)(object)slotArmor.CurObject == (Object)null && (Object)(object)slotBackpack.CurObject == (Object)null) { if (trigger.transform.localEulerAngles.x > 45f) { Bra.SetBlendShapeWeight(1, 100f); Bra.SetBlendShapeWeight(2, 0f); Bra.SetBlendShapeWeight(3, 100f); Body.SetBlendShapeWeight(7, 100f); Body.SetBlendShapeWeight(8, 0f); Body.SetBlendShapeWeight(9, 100f); } else if (trigger.transform.localEulerAngles.x <= 45f) { Bra.SetBlendShapeWeight(1, 0f); Bra.SetBlendShapeWeight(2, 100f); Bra.SetBlendShapeWeight(3, 0f); Body.SetBlendShapeWeight(7, 0f); Body.SetBlendShapeWeight(8, 100f); Body.SetBlendShapeWeight(9, 0f); } colL.transform.localScale = new Vector3(0.07f, 0.07f, 0.07f); colR.transform.localScale = new Vector3(0.07f, 0.07f, 0.07f); } } } public class IgnorrCol : MonoBehaviour { public Collider[] cols; public Collider thiscol; private void FixedUpdate() { Collider[] array = cols; foreach (Collider val in array) { Physics.IgnoreCollision(val, thiscol); } } } } public class LateEnable : MonoBehaviour { public GameObject obj; public float cd = 0.05f; private void Start() { } private void Update() { if (cd > 0f) { cd -= Time.deltaTime; } else if (cd <= 0f) { obj.SetActive(true); ((Behaviour)this).enabled = false; } } } public class NPCCoordinator : MonoBehaviour { public enum ControlMode { Idle, Moving, Shooting, Ragdoll, Sloping } [Serializable] public class SlopeSettings { public bool enableHeightAdjustment = true; public bool enableSpeedAdjustment = true; public float heightMultiplier = 1f; public float speedMultiplier = 1f; public float slopeStartAngle = 15f; public float slopeMaxAngle = 40f; } public Rigidbody[] rigs; public ControlMode currentMode = ControlMode.Idle; public ActiveRagdoll activeRagdoll; public npcBasic npcBasic; public SOSIGHMGUNNER aiBrain; [Header("Slope Integration")] public bool enableSlopeAdaptation = true; private float currentSlopeAngle = 0f; private float originalStandHeight; private float originalSpeed; private float modeTransitionTime = 0f; private ControlMode targetMode; private Dictionary modeSettings; private void Start() { if ((Object)(object)activeRagdoll != (Object)null) { originalStandHeight = activeRagdoll.standHeight; } if ((Object)(object)npcBasic != (Object)null) { originalSpeed = npcBasic.speed; } InitializeModeSettings(); } private void InitializeModeSettings() { modeSettings = new Dictionary { { ControlMode.Idle, new SlopeSettings { enableHeightAdjustment = true, enableSpeedAdjustment = false, heightMultiplier = 1f, speedMultiplier = 1f } }, { ControlMode.Moving, new SlopeSettings { enableHeightAdjustment = true, enableSpeedAdjustment = true, heightMultiplier = 0.7f, speedMultiplier = 0.8f } }, { ControlMode.Shooting, new SlopeSettings { enableHeightAdjustment = true, enableSpeedAdjustment = true, heightMultiplier = 0.85f, speedMultiplier = 0.5f } }, { ControlMode.Sloping, new SlopeSettings { enableHeightAdjustment = true, enableSpeedAdjustment = true, heightMultiplier = 0.6f, speedMultiplier = 0.6f } } }; } private void Update() { if (aiBrain.isContious) { for (int i = 0; i < rigs.Length; i++) { rigs[i].isKinematic = true; } } if (!aiBrain.isContious) { for (int j = 0; j < rigs.Length; j++) { rigs[j].isKinematic = false; } } if (!enableSlopeAdaptation) { DetermineMode(); ApplyModeSettings(); } else { UpdateCurrentSlope(); DetermineModeWithSlope(); ApplyModeSettingsWithSlope(); } } private void UpdateCurrentSlope() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) NavMeshHit val = default(NavMeshHit); if (!((Object)(object)npcBasic != (Object)null) || !((Object)(object)npcBasic.cachedAgent != (Object)null) || !npcBasic.cachedAgent.isOnNavMesh || !NavMesh.SamplePosition(((Component)this).transform.position, ref val, 0.5f, npcBasic.cachedAgent.areaMask)) { return; } currentSlopeAngle = Vector3.Angle(((NavMeshHit)(ref val)).normal, Vector3.up); if ((Object)(object)aiBrain != (Object)null && (Object)(object)aiBrain.nearestAI != (Object)null) { Vector3 val2 = aiBrain.nearestAI.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(((NavMeshHit)(ref val)).normal.x, 0f, ((NavMeshHit)(ref val)).normal.z); Vector3 normalized2 = ((Vector3)(ref val3)).normalized; float num = Vector3.Dot(normalized, normalized2); if (num < 0f) { currentSlopeAngle = 0f - currentSlopeAngle; } } } private void DetermineModeWithSlope() { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) if (aiBrain.R.ragdolled) { targetMode = ControlMode.Ragdoll; } else if (Mathf.Abs(currentSlopeAngle) > 30f && Mathf.Abs(currentSlopeAngle) < 60f && ((Object)(object)aiBrain.nearestAI == (Object)null || !aiBrain.fire)) { targetMode = ControlMode.Sloping; } else if ((Object)(object)aiBrain.nearestAI != (Object)null && aiBrain.fire) { targetMode = ControlMode.Shooting; } else { if ((Object)(object)aiBrain.NMA != (Object)null) { Vector3 velocity = aiBrain.NMA.velocity; if (((Vector3)(ref velocity)).magnitude > 0.5f) { targetMode = ControlMode.Moving; goto IL_0105; } } targetMode = ControlMode.Idle; } goto IL_0105; IL_0105: if (targetMode != currentMode) { currentMode = targetMode; modeTransitionTime = 0.2f; } } private void ApplyModeSettingsWithSlope() { SlopeSettings slopeSettings = modeSettings[currentMode]; float num = CalculateSlopeFactor(); switch (currentMode) { case ControlMode.Idle: if ((Object)(object)npcBasic != (Object)null) { ((Behaviour)npcBasic).enabled = false; } if ((Object)(object)activeRagdoll != (Object)null) { ((Behaviour)activeRagdoll).enabled = true; activeRagdoll.rotationForce = 8; if (slopeSettings.enableHeightAdjustment && activeRagdoll.adaptToSlope) { ApplySlopeHeightAdjustment(slopeSettings, num); } } break; case ControlMode.Moving: if ((Object)(object)npcBasic != (Object)null) { ((Behaviour)npcBasic).enabled = true; if (slopeSettings.enableSpeedAdjustment) { float num5 = originalSpeed * slopeSettings.speedMultiplier * num; npcBasic.speed = Mathf.Lerp(npcBasic.speed, num5, Time.deltaTime * 3f); } } if ((Object)(object)activeRagdoll != (Object)null) { ((Behaviour)activeRagdoll).enabled = true; activeRagdoll.isControlledByCoordinator = true; activeRagdoll.enableDynamicGait = true; activeRagdoll.takeArmControl = true; if ((Object)(object)activeRagdoll.leftArmTarget == (Object)null && (Object)(object)aiBrain != (Object)null) { activeRagdoll.leftArmTarget = aiBrain.handL; activeRagdoll.rightArmTarget = aiBrain.handR; } if (slopeSettings.enableHeightAdjustment && activeRagdoll.adaptToSlope) { ApplySlopeHeightAdjustment(slopeSettings, num); } } break; case ControlMode.Shooting: if ((Object)(object)npcBasic != (Object)null) { ((Behaviour)npcBasic).enabled = true; float num6 = originalSpeed * slopeSettings.speedMultiplier * num; npcBasic.speed = Mathf.Lerp(npcBasic.speed, num6, Time.deltaTime * 3f); npcBasic.stabilityForce = 35f; } if ((Object)(object)activeRagdoll != (Object)null) { activeRagdoll.enableDynamicGait = true; activeRagdoll.armSwingAmplitude = 10f; activeRagdoll.maxHeightSwing = 0.03f; ApplySlopeHeightAdjustment(slopeSettings, num); } break; case ControlMode.Sloping: if ((Object)(object)npcBasic != (Object)null) { ((Behaviour)npcBasic).enabled = true; float num2 = originalSpeed * 0.4f; npcBasic.speed = Mathf.Lerp(npcBasic.speed, num2, Time.deltaTime * 4f); npcBasic.stabilityForce = 45f; } if ((Object)(object)activeRagdoll != (Object)null) { ((Behaviour)activeRagdoll).enabled = true; activeRagdoll.enableBodyHeightControl = true; float num3 = Mathf.Clamp01(1f - Mathf.Abs(currentSlopeAngle) / 60f); float num4 = originalStandHeight * (0.5f + num3 * 0.3f); activeRagdoll.standHeight = Mathf.Lerp(activeRagdoll.standHeight, num4, Time.deltaTime * 5f); } break; case ControlMode.Ragdoll: break; } } private float CalculateSlopeFactor() { if (Mathf.Abs(currentSlopeAngle) < 10f) { return 1f; } if (currentSlopeAngle > 0f) { return Mathf.Clamp01(1f - currentSlopeAngle / 50f); } return Mathf.Clamp01(1f - Mathf.Abs(currentSlopeAngle) / 60f); } private void ApplySlopeHeightAdjustment(SlopeSettings settings, float slopeFactor) { if (!((Object)(object)activeRagdoll == (Object)null)) { activeRagdoll.adaptToSlope = true; float num = originalStandHeight * (1f - settings.heightMultiplier); activeRagdoll.maxHeightAdjustment = num * slopeFactor; activeRagdoll.slopeStartAngle = settings.slopeStartAngle; activeRagdoll.slopeMaxAngle = settings.slopeMaxAngle; } } private void DetermineMode() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (aiBrain.R.ragdolled) { targetMode = ControlMode.Ragdoll; } else if ((Object)(object)aiBrain.nearestAI != (Object)null && aiBrain.fire) { targetMode = ControlMode.Shooting; } else { if ((Object)(object)aiBrain.NMA != (Object)null) { Vector3 velocity = aiBrain.NMA.velocity; if (((Vector3)(ref velocity)).magnitude > 0.5f) { targetMode = ControlMode.Moving; goto IL_00a7; } } targetMode = ControlMode.Idle; } goto IL_00a7; IL_00a7: if (targetMode != currentMode) { currentMode = targetMode; modeTransitionTime = 0.2f; } } private void ApplyModeSettings() { switch (currentMode) { case ControlMode.Idle: if ((Object)(object)npcBasic != (Object)null) { ((Behaviour)npcBasic).enabled = false; } if ((Object)(object)activeRagdoll != (Object)null) { ((Behaviour)activeRagdoll).enabled = true; } activeRagdoll.rotationForce = 8; activeRagdoll.rotationSmoothness = 3; break; case ControlMode.Moving: if ((Object)(object)npcBasic != (Object)null) { ((Behaviour)npcBasic).enabled = true; } if ((Object)(object)activeRagdoll != (Object)null) { ((Behaviour)activeRagdoll).enabled = true; } break; case ControlMode.Shooting: if ((Object)(object)npcBasic != (Object)null) { ((Behaviour)npcBasic).enabled = true; } npcBasic.speed = 0.5f; npcBasic.stabilityForce = 35f; break; } } public float GetCurrentSlopeAngle() { return currentSlopeAngle; } public bool IsOnSlope() { return Mathf.Abs(currentSlopeAngle) > 15f; } public bool IsGoingDownhill() { return currentSlopeAngle > 10f; } } namespace JerryComponent { public class PilotJumpKitIndi : FVRPhysicalObject { public float checkDistance = 2f; public float wallAngleThreshold = 75f; public float wallOffset = 0.2f; public float rotationSpeed = 10f; private Vector3 currentVelocity; private bool isNearWall; private Vector3 wallNormal; private Vector3 wallPoint; private Vector3 followDirection; private float cd = 0.25f; public bool slideslow; public bool justWallran; public bool jumpOffWall; public Transform[] BoostEffectPoints; public Transform BlastDirection; public Transform BlastDirectionWall; public float JumpForce = 15f; public bool hasDoubleJumped; public int jumpAmount = 2; public int timesJumped; public bool Grounded; public AudioEvent jumpsound; public AudioEvent jumpstep; public GameObject wallrunningsound; public GameObject wallrunningeffect; public GameObject jumpeffect; public bool isWallrunningL; public bool isWallrunningR; private bool slowdown; private float timerJ = 0f; private float timerSlide = 0f; private float timerS = 0f; private LayerMask mask; private LayerMask resets; public float velocityForWallRun = 0.5f; public float velocityForSlide = 0.1f; private Vector3 lastVelocity; private Vector3 Velocity; public bool isWallrunning; public float MultVelBy = 0.7f; private bool jumpButtonPressed; private bool jumpButtonDown; private bool slidingHeld; private bool SlidePrepped; public bool slidingCast; private double JumpTimeDelay; private bool didAllowAirControl; public float slopeMultiplier = 1f; private float SlopeMultiplier; private GravityMode StoredGravityMode; public GameObject slideaud; public GameObject switchbutton; public Transform _KHandL; public Transform _KHandR; private Vector3 previousposL; private Vector3 previousposR; private Vector3 nextposL; private Vector3 nextposR; public float speedL; public float speedR; private void CheckForWalls(Vector3 y) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)GM.CurrentMovementManager.Head).gameObject.transform.position; Vector3 forward = ((Component)this).transform.forward; RaycastHit val = default(RaycastHit); if (Physics.Raycast(position, y, ref val, checkDistance, LayerMask.op_Implicit(mask))) { Debug.DrawLine(position, ((RaycastHit)(ref val)).point, Color.red, 0.1f); float num = Vector3.Angle(forward, -((RaycastHit)(ref val)).normal); if (num < wallAngleThreshold) { isNearWall = true; wallNormal = ((RaycastHit)(ref val)).normal; wallPoint = ((RaycastHit)(ref val)).point; DetermineFollowDirection(); } else { isNearWall = false; } } else { isNearWall = false; } } private void DetermineFollowDirection() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(wallNormal, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; float num = Vector3.Dot(((Component)this).transform.forward, normalized); followDirection = ((!(num > 0f)) ? (-normalized) : normalized); Debug.DrawRay(wallPoint, followDirection * 1.5f, Color.green, 0.5f); } private void MoveAlongWall() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) currentVelocity = GM.CurrentMovementManager.m_smoothLocoVelocity; if (isNearWall) { Vector3 val = wallPoint + wallNormal * wallOffset; Vector3 val2 = currentVelocity; Vector3 val3 = val - ((Component)this).transform.position; Vector3 val4 = val2 + ((Vector3)(ref val3)).normalized * 0.5f; Transform transform = ((Component)GM.CurrentMovementManager).gameObject.transform; transform.position += val4 * Time.deltaTime; } } public void Slowdowncontinue() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (slidingCast) { GM.CurrentMovementManager.m_smoothLocoVelocity.x = GM.CurrentMovementManager.m_smoothLocoVelocity.x * 0.98f; GM.CurrentMovementManager.m_smoothLocoVelocity.z = GM.CurrentMovementManager.m_smoothLocoVelocity.z * 0.98f; } if (!slidingCast) { Velocity = VelocitySet(GM.CurrentMovementManager); } } public void Start() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) jumpAmount = 1; JumpForce = 18f; velocityForWallRun = 0.5f; velocityForSlide = 0.1f; MultVelBy = 0.8f; slopeMultiplier = 0.9f; mask = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "Environment" })); resets = LayerMask.op_Implicit(LayerMask.GetMask(new string[3] { "NavBlock", "Environment", "TeleValid" })); StoredGravityMode = GM.Options.SimulationOptions.PlayerGravityMode; didAllowAirControl = GM.CurrentSceneSettings.DoesAllowAirControl; } public void Update() { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_07e6: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_0b24: Unknown result type (might be due to invalid IL or missing references) //IL_0b29: Unknown result type (might be due to invalid IL or missing references) //IL_0b35: Unknown result type (might be due to invalid IL or missing references) //IL_0b3a: Unknown result type (might be due to invalid IL or missing references) //IL_0b46: Unknown result type (might be due to invalid IL or missing references) //IL_0b4b: Unknown result type (might be due to invalid IL or missing references) //IL_0b71: Unknown result type (might be due to invalid IL or missing references) //IL_0b75: Unknown result type (might be due to invalid IL or missing references) //IL_0b7a: Unknown result type (might be due to invalid IL or missing references) //IL_0b85: Unknown result type (might be due to invalid IL or missing references) //IL_0827: Unknown result type (might be due to invalid IL or missing references) //IL_1149: Unknown result type (might be due to invalid IL or missing references) //IL_0b99: Unknown result type (might be due to invalid IL or missing references) //IL_0b9d: Unknown result type (might be due to invalid IL or missing references) //IL_0ba2: Unknown result type (might be due to invalid IL or missing references) //IL_0bad: Unknown result type (might be due to invalid IL or missing references) //IL_0848: Unknown result type (might be due to invalid IL or missing references) //IL_1177: Unknown result type (might be due to invalid IL or missing references) //IL_0c68: Unknown result type (might be due to invalid IL or missing references) //IL_0ccb: Unknown result type (might be due to invalid IL or missing references) //IL_0ccf: Unknown result type (might be due to invalid IL or missing references) //IL_0cd4: Unknown result type (might be due to invalid IL or missing references) //IL_0cdf: Unknown result type (might be due to invalid IL or missing references) //IL_0bc1: Unknown result type (might be due to invalid IL or missing references) //IL_0bc5: Unknown result type (might be due to invalid IL or missing references) //IL_0bca: Unknown result type (might be due to invalid IL or missing references) //IL_0bd5: Unknown result type (might be due to invalid IL or missing references) //IL_08d9: Unknown result type (might be due to invalid IL or missing references) //IL_11bf: Unknown result type (might be due to invalid IL or missing references) //IL_11c9: Unknown result type (might be due to invalid IL or missing references) //IL_11ce: Unknown result type (might be due to invalid IL or missing references) //IL_1206: Unknown result type (might be due to invalid IL or missing references) //IL_120b: Unknown result type (might be due to invalid IL or missing references) //IL_0d03: Unknown result type (might be due to invalid IL or missing references) //IL_0d07: Unknown result type (might be due to invalid IL or missing references) //IL_0d0c: Unknown result type (might be due to invalid IL or missing references) //IL_0d17: Unknown result type (might be due to invalid IL or missing references) //IL_0be9: Unknown result type (might be due to invalid IL or missing references) //IL_0bed: Unknown result type (might be due to invalid IL or missing references) //IL_0bf2: Unknown result type (might be due to invalid IL or missing references) //IL_0bfd: Unknown result type (might be due to invalid IL or missing references) //IL_0904: Unknown result type (might be due to invalid IL or missing references) //IL_08ef: Unknown result type (might be due to invalid IL or missing references) //IL_0de4: Unknown result type (might be due to invalid IL or missing references) //IL_0de9: Unknown result type (might be due to invalid IL or missing references) //IL_0f87: Unknown result type (might be due to invalid IL or missing references) //IL_0f8c: Unknown result type (might be due to invalid IL or missing references) //IL_0ed2: Unknown result type (might be due to invalid IL or missing references) //IL_0ed7: Unknown result type (might be due to invalid IL or missing references) //IL_0f06: Unknown result type (might be due to invalid IL or missing references) //IL_0f0b: Unknown result type (might be due to invalid IL or missing references) //IL_0f2c: Unknown result type (might be due to invalid IL or missing references) //IL_108a: Unknown result type (might be due to invalid IL or missing references) //IL_108f: Unknown result type (might be due to invalid IL or missing references) //IL_10bc: Unknown result type (might be due to invalid IL or missing references) //IL_0fee: Unknown result type (might be due to invalid IL or missing references) //IL_0fc7: Unknown result type (might be due to invalid IL or missing references) //IL_0fcc: Unknown result type (might be due to invalid IL or missing references) //IL_10eb: Unknown result type (might be due to invalid IL or missing references) //IL_10f0: Unknown result type (might be due to invalid IL or missing references) if (!Grounded) { cd -= Time.deltaTime; } if (Grounded) { cd = 0.25f; } if (isWallrunning) { Vector3 y = default(Vector3); ((Vector3)(ref y))..ctor(0f, ((Component)GM.CurrentMovementManager.Head).gameObject.transform.eulerAngles.y, 0f); CheckForWalls(y); MoveAlongWall(); } previousposL = _KHandL.localPosition; previousposR = _KHandR.localPosition; speedL = Vector3.Magnitude(previousposL - nextposL) / Time.deltaTime; speedR = Vector3.Magnitude(previousposR - nextposR) / Time.deltaTime; nextposL = previousposL; nextposR = previousposR; if ((Object)(object)GM.CurrentMovementManager != (Object)null) { ((Component)_KHandL).transform.position = GM.CurrentMovementManager.LeftHand.position; ((Component)_KHandL).transform.eulerAngles = GM.CurrentMovementManager.LeftHand.eulerAngles; ((Component)_KHandR).transform.position = GM.CurrentMovementManager.RightHand.position; ((Component)_KHandR).transform.eulerAngles = GM.CurrentMovementManager.RightHand.eulerAngles; } if (slideslow) { slideaud.SetActive(true); Velocity *= 0.995f; Vector3 smoothLocoVelocity = default(Vector3); ((Vector3)(ref smoothLocoVelocity))..ctor(Velocity.x, 0f, Velocity.z); GM.CurrentMovementManager.m_smoothLocoVelocity = smoothLocoVelocity; } if (!slideslow) { slideaud.SetActive(false); } if ((slidingCast && !Physics.Raycast(((Component)GM.CurrentPlayerBody.EyeCam).transform.position, Vector3.down, ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y + 0.25f, LayerMask.op_Implicit(mask))) || (slidingCast && Mathf.Abs(VelocitySet(GM.CurrentMovementManager).x) + Mathf.Abs(VelocitySet(GM.CurrentMovementManager).z) < 1f) || (slidingCast && speedL >= 3.3f && speedR >= 3.3f)) { slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Velocity = VelocitySet(GM.CurrentMovementManager); GM.CurrentMovementManager.DelayGround(0.2f); GM.CurrentMovementManager.m_isGrounded = true; } if (slidingCast && !Physics.Raycast(((Component)GM.CurrentPlayerBody.EyeCam).transform.position, Vector3.down, ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y + 0.25f, LayerMask.op_Implicit(mask))) { slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Velocity = VelocitySet(GM.CurrentMovementManager); GM.CurrentMovementManager.DelayGround(0.2f); GM.CurrentMovementManager.m_isGrounded = true; } if (slidingCast && ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y > 1.5f) { slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Velocity = VelocitySet(GM.CurrentMovementManager); GM.CurrentMovementManager.DelayGround(0.2f); GM.CurrentMovementManager.m_isGrounded = true; } timerJ += Time.deltaTime; if (slidingCast) { GM.CurrentMovementManager.correctionDir.y = 0f; } if (JumpTimeDelay > 0.0) { JumpTimeDelay -= Time.deltaTime; } if ((Object)(object)base.m_quickbeltSlot == (Object)null || switchbutton.transform.localEulerAngles.x < 45f) { Grounded = true; SlidePrepped = false; slidingHeld = false; jumpButtonDown = false; jumpButtonPressed = false; GM.CurrentSceneSettings.DoesAllowAirControl = didAllowAirControl; } GM.CurrentSceneSettings.DoesAllowAirControl = true; if (GM.CurrentMovementManager.Hands[0].Input.AXButtonPressed && GM.CurrentMovementManager.Hands[1].Input.AXButtonPressed) { jumpButtonPressed = true; } else if (speedL >= 2.5f && speedR >= 2.5f) { jumpButtonPressed = true; } else if (Convert.ToInt32(GM.Options.MovementOptions.CurrentMovementMode) == 6 && Convert.ToInt32(GM.Options.MovementOptions.TwinStickJumpState) == 1) { if (Convert.ToInt32(GM.CurrentMovementManager.Hands[0].CMode) == 1 || Convert.ToInt32(GM.CurrentMovementManager.Hands[1].CMode) == 1) { if (speedL >= 2.5f && speedR >= 2.5f && (GM.CurrentMovementManager.Hands[0].Input.TouchpadSouthPressed || GM.CurrentMovementManager.Hands[1].Input.TouchpadSouthPressed)) { jumpButtonPressed = true; Debug.Log((object)"touchpad south pressed 1"); } } else if ((int)GM.CurrentMovementManager.Hands[0].CMode == 0 || (int)GM.CurrentMovementManager.Hands[1].CMode == 0) { if (speedL >= 2.5f && speedR >= 2.5f && (GM.CurrentMovementManager.Hands[0].Input.TouchpadSouthPressed || GM.CurrentMovementManager.Hands[1].Input.TouchpadSouthPressed)) { jumpButtonPressed = true; Debug.Log((object)"touchpad south pressed 2"); } } else if (speedL >= 2.5f && speedR >= 2.5f && (GM.CurrentMovementManager.Hands[0].Input.Secondary2AxisSouthPressed || GM.CurrentMovementManager.Hands[1].Input.Secondary2AxisSouthPressed)) { jumpButtonPressed = true; Debug.Log((object)"secondary 2axis south pressed"); } } else { jumpButtonPressed = false; } if (GM.CurrentMovementManager.Hands[0].Input.AXButtonDown || GM.CurrentMovementManager.Hands[1].Input.AXButtonDown) { jumpButtonDown = true; } else if (Convert.ToInt32(GM.Options.MovementOptions.CurrentMovementMode) == 6 && Convert.ToInt32(GM.Options.MovementOptions.TwinStickJumpState) == 1) { if (Convert.ToInt32(GM.CurrentMovementManager.Hands[0].CMode) == 1 || Convert.ToInt32(GM.CurrentMovementManager.Hands[1].CMode) == 1) { if (speedL >= 2.5f && speedR >= 2.5f && (GM.CurrentMovementManager.Hands[0].Input.TouchpadSouthDown || GM.CurrentMovementManager.Hands[1].Input.TouchpadSouthDown)) { jumpButtonDown = true; Debug.Log((object)"touchpad south down 1"); } } else if ((int)GM.CurrentMovementManager.Hands[0].CMode == 0 || (int)GM.CurrentMovementManager.Hands[1].CMode == 0) { if (Convert.ToInt32(GM.Options.MovementOptions.Touchpad_Confirm) == 1) { if (speedL >= 2.5f && speedR >= 2.5f && ((GM.CurrentMovementManager.Hands[0].Input.TouchpadDown && GM.CurrentMovementManager.Hands[0].Input.TouchpadSouthPressed) || (GM.CurrentMovementManager.Hands[1].Input.TouchpadDown && GM.CurrentMovementManager.Hands[1].Input.TouchpadSouthPressed))) { jumpButtonDown = true; Debug.Log((object)"touchpad south down and clicked 1"); } } else if (speedL >= 2.5f && speedR >= 2.5f && (GM.CurrentMovementManager.Hands[0].Input.TouchpadSouthDown || GM.CurrentMovementManager.Hands[1].Input.TouchpadSouthDown)) { jumpButtonDown = true; Debug.Log((object)"touchpad south down 2"); } } else if (speedL >= 2.5f && speedR >= 2.5f && (GM.CurrentMovementManager.Hands[0].Input.Secondary2AxisSouthDown || GM.CurrentMovementManager.Hands[1].Input.Secondary2AxisSouthDown)) { jumpButtonDown = true; Debug.Log((object)"secondary 2axis south down"); } } else { jumpButtonDown = false; } if (!Grounded && (Mathf.Abs(GM.CurrentMovementManager.m_smoothLocoVelocity.x) + Mathf.Abs(GM.CurrentMovementManager.m_smoothLocoVelocity.z) > velocityForWallRun || Mathf.Abs(GM.CurrentMovementManager.m_smoothLocoVelocity.x) + Mathf.Abs(GM.CurrentMovementManager.m_smoothLocoVelocity.z) > velocityForWallRun)) { Vector3 position = GM.CurrentPlayerBody.LeftHand.position; Vector3 position2 = GM.CurrentPlayerBody.RightHand.position; Vector3 position3 = GM.CurrentPlayerBody.Torso.position; Transform torso = GM.CurrentPlayerBody.Torso; Transform leftHand = GM.CurrentPlayerBody.LeftHand; Transform rightHand = GM.CurrentPlayerBody.RightHand; if (Physics.Raycast(position3, torso.TransformDirection(Vector3.left), 0.6f, LayerMask.op_Implicit(mask)) || Physics.Raycast(position3, torso.TransformDirection(Vector3.right), 0.6f, LayerMask.op_Implicit(mask)) || Physics.Raycast(position3, torso.TransformDirection(Vector3.forward), 0.6f, LayerMask.op_Implicit(mask)) || Physics.Raycast(position3, torso.TransformDirection(Vector3.back), 0.6f, LayerMask.op_Implicit(mask))) { if (!isWallrunning) { isWallrunning = true; GM.CurrentMovementManager.m_smoothLocoVelocity.y = 0f; GM.CurrentMovementManager.m_smoothLocoVelocity.y = 0f; Velocity.y = 0f; GM.Options.SimulationOptions.PlayerGravityMode = (GravityMode)2; GM.CurrentMovementManager.m_smoothLocoVelocity.y = 0f; GM.CurrentMovementManager.m_smoothLocoVelocity.y = 0f; Velocity.y = 0f; timesJumped = 0; jumpAmount = 1; wallrunningsound.SetActive(true); wallrunningeffect.SetActive(true); if (Physics.Raycast(position3, torso.TransformDirection(Vector3.left), 0.6f, LayerMask.op_Implicit(mask))) { isWallrunningR = true; isWallrunningL = false; } if (Physics.Raycast(position3, torso.TransformDirection(Vector3.right), 0.6f, LayerMask.op_Implicit(mask))) { isWallrunningL = true; isWallrunningR = false; } } if (!isWallrunning && timesJumped == jumpAmount) { timesJumped--; } if (isWallrunning) { timesJumped = 0; jumpAmount = 1; hasDoubleJumped = false; justWallran = false; } } else if (isWallrunning) { wallrunningsound.SetActive(false); isWallrunning = false; isWallrunningL = false; isWallrunningR = false; justWallran = true; wallrunningeffect.SetActive(false); GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; } } if (!Grounded && Velocity.y <= -7f) { GM.CurrentMovementManager.m_smoothLocoVelocity.y = GM.CurrentMovementManager.m_smoothLocoVelocity.y + 1f; wallrunningeffect.SetActive(true); } if (!Grounded && !hasDoubleJumped && jumpButtonPressed && cd <= 0f && (double)timerJ >= 0.2) { if (!isWallrunning && speedL >= 2.5f && speedR >= 2.5f) { if (slidingCast) { GM.CurrentMovementManager.Blast(-((Component)BlastDirectionWall).transform.forward, JumpForce - 15f, true); JumpSlidingCull(); slidingCast = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; GM.CurrentMovementManager.DelayGround(0.3f); SM.PlayCoreSound((FVRPooledAudioType)0, jumpstep, ((Component)this).transform.position); jumpeffect.SetActive(true); timesJumped++; if (timesJumped >= jumpAmount) { hasDoubleJumped = true; } timerJ = 0f; } GM.CurrentMovementManager.Blast(-((Component)BlastDirection).transform.forward, JumpForce - 5f, true); if (slidingCast) { JumpSlidingCull(); slidingCast = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; } GM.CurrentMovementManager.DelayGround(0.3f); SM.PlayCoreSound((FVRPooledAudioType)0, jumpsound, ((Component)this).transform.position); jumpeffect.SetActive(true); timesJumped++; if (timesJumped >= jumpAmount) { hasDoubleJumped = true; } timerJ = 0f; } else if (isWallrunning && jumpButtonPressed && (double)speedL >= 7.5 && speedR >= 7.5f) { GM.CurrentMovementManager.Blast(-((Component)BlastDirectionWall).transform.forward, JumpForce, true); GM.CurrentMovementManager.DelayGround(0.3f); SM.PlayCoreSound((FVRPooledAudioType)0, jumpstep, ((Component)this).transform.position); if (slidingCast) { JumpSlidingCull(); slidingCast = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; } jumpeffect.SetActive(true); timesJumped++; if (timesJumped >= jumpAmount) { hasDoubleJumped = true; } timerJ = 0f; jumpOffWall = true; } } if ((Convert.ToInt32(GM.Options.MovementOptions.CurrentMovementMode) == 4 && GM.CurrentMovementManager.m_isGrounded) || (Convert.ToInt32(GM.Options.MovementOptions.CurrentMovementMode) == 6 && GM.CurrentMovementManager.m_isGrounded)) { hasDoubleJumped = false; timesJumped = 0; jumpAmount = 1; Grounded = true; Velocity = VelocitySet(GM.CurrentMovementManager) * 1.5f; wallrunningsound.SetActive(false); isWallrunning = false; isWallrunningL = false; isWallrunningR = false; justWallran = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; jumpeffect.SetActive(false); } else { Grounded = false; } } public Vector3 VelocitySet(FVRMovementManager body) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Invalid comparison between Unknown and I4 //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Vector3 result = default(Vector3); if ((int)body.Mode == 4) { return body.m_smoothLocoVelocity; } if ((int)body.Mode == 6) { return body.m_smoothLocoVelocity; } return result; } public void LateUpdate() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) if (!Grounded && !isWallrunning && Velocity.y <= -1f && Mathf.Abs(VelocitySet(GM.CurrentMovementManager).x) + Mathf.Abs(VelocitySet(GM.CurrentMovementManager).z) > 5f && ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y <= 1.5f) { SlidePrepped = true; } else if (SlidePrepped || slidingCast || GM.Options.SimulationOptions.PlayerGravityMode != StoredGravityMode) { SlidePrepped = false; } if (SlidePrepped) { GM.CurrentMovementManager.m_isGrounded = false; GM.CurrentMovementManager.DelayGround(10f); if (!Grounded && !isWallrunning && Velocity.y <= -1f && Mathf.Abs(VelocitySet(GM.CurrentMovementManager).x) + Mathf.Abs(VelocitySet(GM.CurrentMovementManager).z) > 5f) { GM.CurrentMovementManager.DelayGround(10f); if (Physics.Raycast(((Component)GM.CurrentPlayerBody.EyeCam).transform.position, Vector3.down, ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y + 0.05f, LayerMask.op_Implicit(mask)) && ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y <= 1.5f) { GM.Options.SimulationOptions.PlayerGravityMode = (GravityMode)3; slidingCast = true; } else if (slidingCast && Mathf.Abs(VelocitySet(GM.CurrentMovementManager).x) + Mathf.Abs(VelocitySet(GM.CurrentMovementManager).z) < 0.5f) { slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Velocity = VelocitySet(GM.CurrentMovementManager); Debug.Log((object)"slidecast stopped by boost"); } if (slidingCast) { timerSlide += Time.deltaTime; timesJumped = 0; jumpAmount = 1; hasDoubleJumped = false; GM.CurrentMovementManager.m_smoothLocoVelocity.y = 0f; Velocity.y = 0f; Velocity *= 1.25f; slideslow = true; } } } else if (timerSlide >= 5f) { slidingCast = false; SlidePrepped = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Velocity = VelocitySet(GM.CurrentMovementManager); Debug.Log((object)"slidecast stopped at timeout"); timerSlide = 0f; } Velocity = VelocitySet(GM.CurrentMovementManager); } public void SlidingCull() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) SlidePrepped = false; slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Debug.Log((object)"isculled"); } public void JumpSlidingCull() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) SlidePrepped = false; slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Debug.Log((object)"isjumpculled"); } } public class PilotJumpKitOnBody : MonoBehaviour { public bool slideslow; public bool justWallran; public bool jumpOffWall; public Transform[] BoostEffectPoints; public Transform BlastDirection; public Transform BlastDirectionWall; public float JumpForce = 15f; public bool hasDoubleJumped; public int jumpAmount = 2; public int timesJumped; public bool Grounded; public AudioEvent jumpsound; public AudioEvent jumpstep; public GameObject wallrunningsound; public GameObject wallrunningeffect; public GameObject jumpeffect; public GameObject leftHand; public GameObject rightHand; public bool isWallrunningL; public bool isWallrunningR; public Kick KickForJump; private bool slowdown; private float timerJ = 0f; private float timerSlide = 0f; private float timerS = 0f; private LayerMask mask; private LayerMask resets; public float velocityForWallRun = 0.5f; public float velocityForSlide = 0.1f; private Vector3 lastVelocity; private Vector3 Velocity; public bool isWallrunning; public float MultVelBy = 0.7f; private bool jumpButtonPressed; private bool jumpButtonDown; private bool slidingHeld; private bool SlidePrepped; public bool slidingCast; private double JumpTimeDelay; private bool didAllowAirControl; public float slopeMultiplier = 1f; private float SlopeMultiplier; private GravityMode StoredGravityMode; public GameObject slideaud; public void Slowdowncontinue() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (slidingCast) { GM.CurrentMovementManager.m_smoothLocoVelocity.x = GM.CurrentMovementManager.m_smoothLocoVelocity.x * 0.98f; GM.CurrentMovementManager.m_smoothLocoVelocity.z = GM.CurrentMovementManager.m_smoothLocoVelocity.z * 0.98f; } if (!slidingCast) { Velocity = VelocitySet(GM.CurrentMovementManager); } } public void Start() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) jumpAmount = 1; JumpForce = 18f; velocityForWallRun = 0.5f; velocityForSlide = 0.1f; MultVelBy = 0.8f; slopeMultiplier = 0.9f; mask = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "Environment" })); resets = LayerMask.op_Implicit(LayerMask.GetMask(new string[3] { "NavBlock", "Environment", "TeleValid" })); StoredGravityMode = GM.Options.SimulationOptions.PlayerGravityMode; didAllowAirControl = GM.CurrentSceneSettings.DoesAllowAirControl; } public void Update() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_0673: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_09ba: Unknown result type (might be due to invalid IL or missing references) //IL_09bf: Unknown result type (might be due to invalid IL or missing references) //IL_09cb: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Unknown result type (might be due to invalid IL or missing references) //IL_09dc: Unknown result type (might be due to invalid IL or missing references) //IL_09e1: Unknown result type (might be due to invalid IL or missing references) //IL_0a07: Unknown result type (might be due to invalid IL or missing references) //IL_0a0b: Unknown result type (might be due to invalid IL or missing references) //IL_0a10: Unknown result type (might be due to invalid IL or missing references) //IL_0a1b: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Unknown result type (might be due to invalid IL or missing references) //IL_0fde: Unknown result type (might be due to invalid IL or missing references) //IL_0a2f: Unknown result type (might be due to invalid IL or missing references) //IL_0a33: Unknown result type (might be due to invalid IL or missing references) //IL_0a38: Unknown result type (might be due to invalid IL or missing references) //IL_0a43: Unknown result type (might be due to invalid IL or missing references) //IL_06b6: Unknown result type (might be due to invalid IL or missing references) //IL_100c: Unknown result type (might be due to invalid IL or missing references) //IL_0afe: Unknown result type (might be due to invalid IL or missing references) //IL_0b61: Unknown result type (might be due to invalid IL or missing references) //IL_0b65: Unknown result type (might be due to invalid IL or missing references) //IL_0b6a: Unknown result type (might be due to invalid IL or missing references) //IL_0b75: Unknown result type (might be due to invalid IL or missing references) //IL_0a57: Unknown result type (might be due to invalid IL or missing references) //IL_0a5b: Unknown result type (might be due to invalid IL or missing references) //IL_0a60: Unknown result type (might be due to invalid IL or missing references) //IL_0a6b: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_1054: Unknown result type (might be due to invalid IL or missing references) //IL_105e: Unknown result type (might be due to invalid IL or missing references) //IL_1063: Unknown result type (might be due to invalid IL or missing references) //IL_109b: Unknown result type (might be due to invalid IL or missing references) //IL_10a0: Unknown result type (might be due to invalid IL or missing references) //IL_0b99: Unknown result type (might be due to invalid IL or missing references) //IL_0b9d: Unknown result type (might be due to invalid IL or missing references) //IL_0ba2: Unknown result type (might be due to invalid IL or missing references) //IL_0bad: Unknown result type (might be due to invalid IL or missing references) //IL_0a7f: Unknown result type (might be due to invalid IL or missing references) //IL_0a83: Unknown result type (might be due to invalid IL or missing references) //IL_0a88: Unknown result type (might be due to invalid IL or missing references) //IL_0a93: Unknown result type (might be due to invalid IL or missing references) //IL_077c: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_0c7a: Unknown result type (might be due to invalid IL or missing references) //IL_0c7f: Unknown result type (might be due to invalid IL or missing references) //IL_0e17: Unknown result type (might be due to invalid IL or missing references) //IL_0e1c: Unknown result type (might be due to invalid IL or missing references) //IL_0d62: Unknown result type (might be due to invalid IL or missing references) //IL_0d67: Unknown result type (might be due to invalid IL or missing references) //IL_0d96: Unknown result type (might be due to invalid IL or missing references) //IL_0d9b: Unknown result type (might be due to invalid IL or missing references) //IL_0dbc: Unknown result type (might be due to invalid IL or missing references) //IL_0f1f: Unknown result type (might be due to invalid IL or missing references) //IL_0f24: Unknown result type (might be due to invalid IL or missing references) //IL_0f51: Unknown result type (might be due to invalid IL or missing references) //IL_0e7e: Unknown result type (might be due to invalid IL or missing references) //IL_0e57: Unknown result type (might be due to invalid IL or missing references) //IL_0e5c: Unknown result type (might be due to invalid IL or missing references) //IL_0f80: Unknown result type (might be due to invalid IL or missing references) //IL_0f85: Unknown result type (might be due to invalid IL or missing references) if (slideslow) { slideaud.SetActive(true); Velocity *= 0.995f; Vector3 smoothLocoVelocity = default(Vector3); ((Vector3)(ref smoothLocoVelocity))..ctor(Velocity.x, 0f, Velocity.z); GM.CurrentMovementManager.m_smoothLocoVelocity = smoothLocoVelocity; } if (!slideslow) { slideaud.SetActive(false); } if ((slidingCast && !Physics.Raycast(((Component)GM.CurrentPlayerBody.EyeCam).transform.position, Vector3.down, ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y + 0.25f, LayerMask.op_Implicit(mask))) || (slidingCast && Mathf.Abs(VelocitySet(GM.CurrentMovementManager).x) + Mathf.Abs(VelocitySet(GM.CurrentMovementManager).z) < 1f) || (slidingCast && KickForJump.speedL >= 3.3f && KickForJump.speedR >= 3.3f)) { slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Velocity = VelocitySet(GM.CurrentMovementManager); GM.CurrentMovementManager.DelayGround(0.2f); GM.CurrentMovementManager.m_isGrounded = true; } if (slidingCast && !Physics.Raycast(((Component)GM.CurrentPlayerBody.EyeCam).transform.position, Vector3.down, ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y + 0.25f, LayerMask.op_Implicit(mask))) { slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Velocity = VelocitySet(GM.CurrentMovementManager); GM.CurrentMovementManager.DelayGround(0.2f); GM.CurrentMovementManager.m_isGrounded = true; } if (slidingCast && ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y > 1.5f) { slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Velocity = VelocitySet(GM.CurrentMovementManager); GM.CurrentMovementManager.DelayGround(0.2f); GM.CurrentMovementManager.m_isGrounded = true; } timerJ += Time.deltaTime; if (slidingCast) { GM.CurrentMovementManager.correctionDir.y = 0f; } if (JumpTimeDelay > 0.0) { JumpTimeDelay -= Time.deltaTime; } GM.CurrentSceneSettings.DoesAllowAirControl = true; if (GM.CurrentMovementManager.Hands[0].Input.AXButtonPressed && GM.CurrentMovementManager.Hands[1].Input.AXButtonPressed) { jumpButtonPressed = true; } else if (KickForJump.speedL >= 3f && KickForJump.speedR >= 3f && GM.CurrentMovementManager.Hands[0].Input.GripPressed && GM.CurrentMovementManager.Hands[1].Input.GripPressed) { jumpButtonPressed = true; } else if (Convert.ToInt32(GM.Options.MovementOptions.CurrentMovementMode) == 6 && Convert.ToInt32(GM.Options.MovementOptions.TwinStickJumpState) == 1) { if (Convert.ToInt32(GM.CurrentMovementManager.Hands[0].CMode) == 1 || Convert.ToInt32(GM.CurrentMovementManager.Hands[1].CMode) == 1) { if (KickForJump.speedL >= 3f && KickForJump.speedR >= 3f && (GM.CurrentMovementManager.Hands[0].Input.TouchpadSouthPressed || GM.CurrentMovementManager.Hands[1].Input.TouchpadSouthPressed)) { jumpButtonPressed = true; Debug.Log((object)"touchpad south pressed 1"); } } else if ((int)GM.CurrentMovementManager.Hands[0].CMode == 0 || (int)GM.CurrentMovementManager.Hands[1].CMode == 0) { if (KickForJump.speedL >= 3f && KickForJump.speedR >= 3f && (GM.CurrentMovementManager.Hands[0].Input.TouchpadSouthPressed || GM.CurrentMovementManager.Hands[1].Input.TouchpadSouthPressed)) { jumpButtonPressed = true; Debug.Log((object)"touchpad south pressed 2"); } } else if (KickForJump.speedL >= 3f && KickForJump.speedR >= 3f && (GM.CurrentMovementManager.Hands[0].Input.Secondary2AxisSouthPressed || GM.CurrentMovementManager.Hands[1].Input.Secondary2AxisSouthPressed)) { jumpButtonPressed = true; Debug.Log((object)"secondary 2axis south pressed"); } } else { jumpButtonPressed = false; } if (GM.CurrentMovementManager.Hands[0].Input.AXButtonDown || GM.CurrentMovementManager.Hands[1].Input.AXButtonDown) { jumpButtonDown = true; } else if (Convert.ToInt32(GM.Options.MovementOptions.CurrentMovementMode) == 6 && Convert.ToInt32(GM.Options.MovementOptions.TwinStickJumpState) == 1) { if (Convert.ToInt32(GM.CurrentMovementManager.Hands[0].CMode) == 1 || Convert.ToInt32(GM.CurrentMovementManager.Hands[1].CMode) == 1) { if (KickForJump.speedL >= 3f && KickForJump.speedR >= 3f && (GM.CurrentMovementManager.Hands[0].Input.TouchpadSouthDown || GM.CurrentMovementManager.Hands[1].Input.TouchpadSouthDown)) { jumpButtonDown = true; Debug.Log((object)"touchpad south down 1"); } } else if ((int)GM.CurrentMovementManager.Hands[0].CMode == 0 || (int)GM.CurrentMovementManager.Hands[1].CMode == 0) { if (Convert.ToInt32(GM.Options.MovementOptions.Touchpad_Confirm) == 1) { if (KickForJump.speedL >= 3f && KickForJump.speedR >= 3f && ((GM.CurrentMovementManager.Hands[0].Input.TouchpadDown && GM.CurrentMovementManager.Hands[0].Input.TouchpadSouthPressed) || (GM.CurrentMovementManager.Hands[1].Input.TouchpadDown && GM.CurrentMovementManager.Hands[1].Input.TouchpadSouthPressed))) { jumpButtonDown = true; Debug.Log((object)"touchpad south down and clicked 1"); } } else if (KickForJump.speedL >= 3f && KickForJump.speedR >= 3f && (GM.CurrentMovementManager.Hands[0].Input.TouchpadSouthDown || GM.CurrentMovementManager.Hands[1].Input.TouchpadSouthDown)) { jumpButtonDown = true; Debug.Log((object)"touchpad south down 2"); } } else if (KickForJump.speedL >= 3f && KickForJump.speedR >= 3f && (GM.CurrentMovementManager.Hands[0].Input.Secondary2AxisSouthDown || GM.CurrentMovementManager.Hands[1].Input.Secondary2AxisSouthDown)) { jumpButtonDown = true; Debug.Log((object)"secondary 2axis south down"); } } else { jumpButtonDown = false; } if (!Grounded && (Mathf.Abs(GM.CurrentMovementManager.m_smoothLocoVelocity.x) + Mathf.Abs(GM.CurrentMovementManager.m_smoothLocoVelocity.z) > velocityForWallRun || Mathf.Abs(GM.CurrentMovementManager.m_smoothLocoVelocity.x) + Mathf.Abs(GM.CurrentMovementManager.m_smoothLocoVelocity.z) > velocityForWallRun)) { Vector3 position = GM.CurrentPlayerBody.LeftHand.position; Vector3 position2 = GM.CurrentPlayerBody.RightHand.position; Vector3 position3 = GM.CurrentPlayerBody.Torso.position; Transform torso = GM.CurrentPlayerBody.Torso; Transform val = GM.CurrentPlayerBody.LeftHand; Transform val2 = GM.CurrentPlayerBody.RightHand; if (Physics.Raycast(position3, torso.TransformDirection(Vector3.left), 0.6f, LayerMask.op_Implicit(mask)) || Physics.Raycast(position3, torso.TransformDirection(Vector3.right), 0.6f, LayerMask.op_Implicit(mask)) || Physics.Raycast(position3, torso.TransformDirection(Vector3.forward), 0.6f, LayerMask.op_Implicit(mask)) || Physics.Raycast(position3, torso.TransformDirection(Vector3.back), 0.6f, LayerMask.op_Implicit(mask))) { if (!isWallrunning) { isWallrunning = true; GM.CurrentMovementManager.m_smoothLocoVelocity.y = 0f; GM.CurrentMovementManager.m_smoothLocoVelocity.y = 0f; Velocity.y = 0f; GM.Options.SimulationOptions.PlayerGravityMode = (GravityMode)2; GM.CurrentMovementManager.m_smoothLocoVelocity.y = 0f; GM.CurrentMovementManager.m_smoothLocoVelocity.y = 0f; Velocity.y = 0f; timesJumped = 0; jumpAmount = 1; wallrunningsound.SetActive(true); wallrunningeffect.SetActive(true); if (Physics.Raycast(position3, torso.TransformDirection(Vector3.left), 0.6f, LayerMask.op_Implicit(mask))) { isWallrunningR = true; isWallrunningL = false; } if (Physics.Raycast(position3, torso.TransformDirection(Vector3.right), 0.6f, LayerMask.op_Implicit(mask))) { isWallrunningL = true; isWallrunningR = false; } } if (!isWallrunning && timesJumped == jumpAmount) { timesJumped--; } if (isWallrunning) { timesJumped = 0; jumpAmount = 1; hasDoubleJumped = false; justWallran = false; } } else if (isWallrunning) { wallrunningsound.SetActive(false); isWallrunning = false; isWallrunningL = false; isWallrunningR = false; justWallran = true; wallrunningeffect.SetActive(false); GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; } } if (!Grounded && Velocity.y <= -7f) { GM.CurrentMovementManager.m_smoothLocoVelocity.y = GM.CurrentMovementManager.m_smoothLocoVelocity.y + 1f; wallrunningeffect.SetActive(true); } if (!Grounded && !hasDoubleJumped && jumpButtonPressed && (double)timerJ >= 0.2) { if (!isWallrunning && KickForJump.speedL >= 3.3f && KickForJump.speedR >= 3.3f) { if (slidingCast) { GM.CurrentMovementManager.Blast(-((Component)BlastDirectionWall).transform.forward, JumpForce - 15f, true); JumpSlidingCull(); slidingCast = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; GM.CurrentMovementManager.DelayGround(0.3f); SM.PlayCoreSound((FVRPooledAudioType)0, jumpstep, ((Component)this).transform.position); jumpeffect.SetActive(true); timesJumped++; if (timesJumped >= jumpAmount) { hasDoubleJumped = true; } timerJ = 0f; } GM.CurrentMovementManager.Blast(-((Component)BlastDirection).transform.forward, JumpForce - 5f, true); if (slidingCast) { JumpSlidingCull(); slidingCast = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; } GM.CurrentMovementManager.DelayGround(0.3f); SM.PlayCoreSound((FVRPooledAudioType)0, jumpsound, ((Component)this).transform.position); jumpeffect.SetActive(true); timesJumped++; if (timesJumped >= jumpAmount) { hasDoubleJumped = true; } timerJ = 0f; } else if (isWallrunning && jumpButtonPressed && KickForJump.speedL >= 3.3f && KickForJump.speedR >= 3.3f) { GM.CurrentMovementManager.Blast(-((Component)BlastDirectionWall).transform.forward, JumpForce, true); GM.CurrentMovementManager.DelayGround(0.3f); SM.PlayCoreSound((FVRPooledAudioType)0, jumpstep, ((Component)this).transform.position); if (slidingCast) { JumpSlidingCull(); slidingCast = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; } jumpeffect.SetActive(true); timesJumped++; if (timesJumped >= jumpAmount) { hasDoubleJumped = true; } timerJ = 0f; jumpOffWall = true; } } if ((Convert.ToInt32(GM.Options.MovementOptions.CurrentMovementMode) == 4 && GM.CurrentMovementManager.m_isGrounded) || (Convert.ToInt32(GM.Options.MovementOptions.CurrentMovementMode) == 6 && GM.CurrentMovementManager.m_isGrounded)) { hasDoubleJumped = false; timesJumped = 0; jumpAmount = 1; Grounded = true; Velocity = VelocitySet(GM.CurrentMovementManager) * 1.5f; wallrunningsound.SetActive(false); isWallrunning = false; isWallrunningL = false; isWallrunningR = false; justWallran = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; jumpeffect.SetActive(false); } else { Grounded = false; } } public Vector3 VelocitySet(FVRMovementManager body) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Invalid comparison between Unknown and I4 //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Vector3 result = default(Vector3); if ((int)body.Mode == 4) { return body.m_smoothLocoVelocity; } if ((int)body.Mode == 6) { return body.m_smoothLocoVelocity; } return result; } public void LateUpdate() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) if (!Grounded && !isWallrunning && Velocity.y <= -1f && Mathf.Abs(VelocitySet(GM.CurrentMovementManager).x) + Mathf.Abs(VelocitySet(GM.CurrentMovementManager).z) > 5f && ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y <= 1.5f) { SlidePrepped = true; } else if (SlidePrepped || slidingCast || GM.Options.SimulationOptions.PlayerGravityMode != StoredGravityMode) { SlidePrepped = false; } if (SlidePrepped) { GM.CurrentMovementManager.m_isGrounded = false; GM.CurrentMovementManager.DelayGround(10f); if (!Grounded && !isWallrunning && Velocity.y <= -1f && Mathf.Abs(VelocitySet(GM.CurrentMovementManager).x) + Mathf.Abs(VelocitySet(GM.CurrentMovementManager).z) > 5f) { GM.CurrentMovementManager.DelayGround(10f); if (Physics.Raycast(((Component)GM.CurrentPlayerBody.EyeCam).transform.position, Vector3.down, ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y + 0.05f, LayerMask.op_Implicit(mask)) && ((Component)GM.CurrentPlayerBody.EyeCam).transform.localPosition.y <= 1.5f) { GM.Options.SimulationOptions.PlayerGravityMode = (GravityMode)3; slidingCast = true; } else if (slidingCast && Mathf.Abs(VelocitySet(GM.CurrentMovementManager).x) + Mathf.Abs(VelocitySet(GM.CurrentMovementManager).z) < 0.5f) { slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Velocity = VelocitySet(GM.CurrentMovementManager); Debug.Log((object)"slidecast stopped by boost"); } if (slidingCast) { timerSlide += Time.deltaTime; timesJumped = 0; jumpAmount = 1; hasDoubleJumped = false; GM.CurrentMovementManager.m_smoothLocoVelocity.y = 0f; Velocity.y = 0f; Velocity *= 1.25f; slideslow = true; } } } else if (timerSlide >= 5f) { slidingCast = false; SlidePrepped = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Velocity = VelocitySet(GM.CurrentMovementManager); Debug.Log((object)"slidecast stopped at timeout"); timerSlide = 0f; } Velocity = VelocitySet(GM.CurrentMovementManager); } public void SlidingCull() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) SlidePrepped = false; slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Debug.Log((object)"isculled"); } public void JumpSlidingCull() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) SlidePrepped = false; slidingCast = false; slideslow = false; GM.Options.SimulationOptions.PlayerGravityMode = StoredGravityMode; Debug.Log((object)"isjumpculled"); } } public class WallRunningWithLimits : MonoBehaviour { public PilotJumpKitOnBody pjkob; public TransformVelocity myDel; public GameObject head; public LayerMask lm; public float maxdist; public Vector3 dirnormal; public float speedoffwall = 0f; public void TransformVel(ref Vector3 vel, ref bool isGrounded, ref bool didChange) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (pjkob.isWallrunning) { vel = ((Component)this).transform.forward * speedoffwall; didChange = true; } else { didChange = false; } } private void Update() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) if (pjkob.isWallrunning) { RaycastHit val = default(RaycastHit); if (Physics.SphereCast(head.transform.position, 0.6f, head.transform.up, ref val, maxdist, LayerMask.op_Implicit(lm))) { dirnormal = ((RaycastHit)(ref val)).normal; if (Vector3.Distance(((Component)this).transform.position, ((RaycastHit)(ref val)).point) < 0.5f) { speedoffwall = 10f * (0.5f - Vector3.Distance(((Component)this).transform.position, ((RaycastHit)(ref val)).point)); } else if (Vector3.Distance(((Component)this).transform.position, ((RaycastHit)(ref val)).point) > 0.5f && Vector3.Distance(((Component)this).transform.position, ((RaycastHit)(ref val)).point) < 0.6f) { speedoffwall = 10f * (0.5f - Vector3.Distance(((Component)this).transform.position, ((RaycastHit)(ref val)).point)); } } myDel = new TransformVelocity(TransformVel); GM.CurrentMovementManager.RegisterSmoothLocoAdder(myDel); } else { GM.CurrentMovementManager.DeregisterSmoothLocoAdder(myDel); } } } } namespace JerryLegsIK { public class Wallrunning : MonoBehaviour { public PilotJumpKitOnBody PJK_W; public Animator WallR; private void Start() { } private void Update() { if (PJK_W.isWallrunning) { if (PJK_W.isWallrunningL) { WallR.SetBool("IsWallrunningL", true); } else if (PJK_W.isWallrunningR) { WallR.SetBool("IsWallrunningR", true); } } else if (!PJK_W.isWallrunning) { WallR.SetBool("IsWallrunningL", false); WallR.SetBool("IsWallrunningR", false); } } } } namespace JerryComponent { public class LightOn : MonoBehaviour { public Light lit; private float timel = 0f; public GameObject rot; public float inten = 5f; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (rot.transform.localEulerAngles.x >= 50f) { timel += Time.deltaTime * 0.1f; lit.intensity = timel; if (lit.intensity >= inten) { lit.intensity = inten; timel = inten; } } if (rot.transform.localEulerAngles.x < 50f) { lit.intensity = 0f; timel = 0f; } } } } public class AccelerationCharacterController : MonoBehaviour { private CharacterMotor motor; public float sensitivityX = 15f; public float sensitivityY = 15f; public float accelerationSpeed = 1f; private float rotationX = 0f; private float rotationY = 0f; private Quaternion originalRotation; private void Start() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) motor = ((Component)this).GetComponent(typeof(CharacterMotor)) as CharacterMotor; if ((Object)(object)motor == (Object)null) { Debug.Log((object)"Motor is null!!"); } originalRotation = ((Component)this).transform.localRotation; } private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) Vector3 desiredMovementDirection = motor.desiredMovementDirection; desiredMovementDirection.z += Input.GetAxis("Vertical") * Time.deltaTime * accelerationSpeed; desiredMovementDirection.x += Input.GetAxis("Horizontal") * Time.deltaTime * accelerationSpeed; if (((Vector3)(ref desiredMovementDirection)).magnitude > 1f) { desiredMovementDirection = ((Vector3)(ref desiredMovementDirection)).normalized; } rotationX += Input.GetAxis("Mouse X") * sensitivityX; rotationY += Input.GetAxis("Mouse Y") * sensitivityY; rotationX = Mathf.Repeat(rotationX, 360f); rotationY = Mathf.Clamp(rotationY, -90f, 90f); Quaternion val = Quaternion.AngleAxis(rotationX, Vector3.up); Quaternion val2 = Quaternion.AngleAxis(rotationY, -Vector3.right); motor.desiredFacingDirection = originalRotation * val * val2 * Vector3.forward; motor.desiredMovementDirection = desiredMovementDirection; } } public class AimLookCharacterController : MonoBehaviour { private CharacterMotor motor; private static bool loggedInputInfo = false; private void Start() { motor = ((Component)this).GetComponent(typeof(CharacterMotor)) as CharacterMotor; if ((Object)(object)motor == (Object)null) { Debug.Log((object)"Motor is null!!"); } } private void Update() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; try { ((Vector3)(ref val))..ctor(Input.GetAxis("Horizontal2"), Input.GetAxis("Vertical2"), 0f); } catch (UnityException ex) { UnityException ex2 = ex; if (!loggedInputInfo) { Debug.Log((object)("Hint: Setup axes \"Horizontal2\" and \"Vertical2\" to support aiming direction. This is optional.\nYou can map them to whichever keys or joystick axes you want to control aiming direction.\n" + ((Exception)(object)ex2).StackTrace), (Object)(object)this); loggedInputInfo = true; } } if (((Vector3)(ref val)).magnitude > 1f) { val = ((Vector3)(ref val)).normalized; } val = ((Component)Camera.main).transform.rotation * val; Quaternion val2 = Quaternion.FromToRotation(((Component)Camera.main).transform.forward * -1f, ((Component)this).transform.up); val = val2 * val; motor.desiredFacingDirection = val; } } public abstract class CharacterMotor : MonoBehaviour { public float maxForwardSpeed = 1.5f; public float maxBackwardsSpeed = 1.5f; public float maxSidewaysSpeed = 1.5f; public float maxVelocityChange = 0.2f; public float gravity = 10f; public bool canJump = true; public float jumpHeight = 1f; public Vector3 forwardVector = Vector3.forward; protected Quaternion alignCorrection; private bool m_Grounded = false; private bool m_Jumping = false; private Vector3 m_desiredMovementDirection; private Vector3 m_desiredFacingDirection; public bool grounded { get { return m_Grounded; } protected set { m_Grounded = value; } } public bool jumping { get { return m_Jumping; } protected set { m_Jumping = value; } } public Vector3 desiredMovementDirection { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return m_desiredMovementDirection; } set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) m_desiredMovementDirection = value; if (((Vector3)(ref m_desiredMovementDirection)).magnitude > 1f) { m_desiredMovementDirection = ((Vector3)(ref m_desiredMovementDirection)).normalized; } } } public Vector3 desiredFacingDirection { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return m_desiredFacingDirection; } set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) m_desiredFacingDirection = value; if (((Vector3)(ref m_desiredFacingDirection)).magnitude > 1f) { m_desiredFacingDirection = ((Vector3)(ref m_desiredFacingDirection)).normalized; } } } public Vector3 desiredVelocity { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) if (m_desiredMovementDirection == Vector3.zero) { return Vector3.zero; } float num = ((!(m_desiredMovementDirection.z > 0f)) ? maxBackwardsSpeed : maxForwardSpeed) / maxSidewaysSpeed; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(m_desiredMovementDirection.x, 0f, m_desiredMovementDirection.z / num); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(normalized.x, 0f, normalized.z * num); float num2 = ((Vector3)(ref val2)).magnitude * maxSidewaysSpeed; Vector3 val3 = m_desiredMovementDirection * num2; return ((Component)this).transform.rotation * val3; } } private void Start() { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) alignCorrection = default(Quaternion); ((Quaternion)(ref alignCorrection)).SetLookRotation(forwardVector, Vector3.up); alignCorrection = Quaternion.Inverse(alignCorrection); } } public class FPSCharacterController : MonoBehaviour { private CharacterMotor motor; public float walkMultiplier = 0.5f; public bool defaultIsWalk = false; private void Start() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) motor = ((Component)this).GetComponent(typeof(CharacterMotor)) as CharacterMotor; if ((Object)(object)motor == (Object)null) { Debug.Log((object)"Motor is null!!"); } motor.desiredFacingDirection = ((Component)this).transform.forward; } private void Update() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical")); if (((Vector3)(ref val)).magnitude > 1f) { val = ((Vector3)(ref val)).normalized; } if (walkMultiplier != 1f && (Input.GetKey("left shift") || Input.GetKey("right shift")) != defaultIsWalk) { val *= walkMultiplier; } motor.desiredMovementDirection = val; } } public class Follower : MonoBehaviour { public float desiredDistance; public GameObject target; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = target.transform.position - ((Component)this).transform.position; Vector3 val2 = Util.ProjectOntoPlane(val, ((Component)this).transform.up); val = ((Vector3)(ref val2)).normalized * ((Vector3)(ref val)).magnitude; float num = (((Vector3)(ref val)).magnitude - desiredDistance) * 2f; Vector3 desiredMovementDirection = ((Vector3)(ref val)).normalized * num; CharacterMotor characterMotor = ((Component)this).GetComponent(typeof(CharacterMotor)) as CharacterMotor; characterMotor.desiredMovementDirection = desiredMovementDirection; characterMotor.desiredFacingDirection = val; } } [RequireComponent(typeof(AlignmentTracker))] public class JumpAndIdle : MonoBehaviour { public AnimationClip jumpingAnimation; public float jumpTimeStart = 0f; public float fallTimeThreshold = 0.2f; public AnimationClip waitingAnimation; private bool doJumping = false; private bool doWaiting = false; private AlignmentTracker align; private CharacterMotor cm; private bool grounded; private bool waiting = false; private float idleTimer = 0f; private float fallingTimer = 0f; private void Start() { align = ((Component)this).GetComponent(typeof(AlignmentTracker)) as AlignmentTracker; cm = ((Component)this).GetComponent(typeof(CharacterMotor)) as CharacterMotor; grounded = false; if ((Object)(object)jumpingAnimation != (Object)null) { ((Component)this).GetComponent()[((Object)jumpingAnimation).name].wrapMode = (WrapMode)8; doJumping = true; } if ((Object)(object)waitingAnimation != (Object)null) { ((Component)this).GetComponent()[((Object)waitingAnimation).name].wrapMode = (WrapMode)8; doWaiting = true; } } private void OnEnable() { if ((TrackedReference)(object)((Component)this).GetComponent()["locomotion"] != (TrackedReference)null) { ((Component)this).GetComponent()["locomotion"].weight = 1f; } } private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = align.velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; if (doJumping) { if (cm.jumping) { grounded = false; waiting = false; ((Component)this).GetComponent().CrossFade(((Object)jumpingAnimation).name, 0.1f); ((Component)this).GetComponent()[((Object)jumpingAnimation).name].time = jumpTimeStart; ((Component)this).GetComponent()[((Object)jumpingAnimation).name].wrapMode = (WrapMode)8; } else if (grounded && !cm.grounded) { grounded = false; waiting = false; } else if (!grounded && cm.grounded) { grounded = true; waiting = false; fallingTimer = 0f; ((Component)this).GetComponent().CrossFade("locomotion", 0.1f); } else if (!grounded && fallingTimer < fallTimeThreshold) { fallingTimer += Time.deltaTime; if (fallingTimer >= fallTimeThreshold) { ((Component)this).GetComponent().CrossFade(((Object)jumpingAnimation).name, 0.2f); ((Component)this).GetComponent()[((Object)jumpingAnimation).name].time = jumpTimeStart; ((Component)this).GetComponent()[((Object)jumpingAnimation).name].wrapMode = (WrapMode)8; } } } if (!doWaiting) { return; } if (magnitude == 0f) { idleTimer += Time.deltaTime; if (idleTimer > 3f) { if (((Component)this).GetComponent()[((Object)waitingAnimation).name].time == 0f || ((Component)this).GetComponent()[((Object)waitingAnimation).name].time >= ((Component)this).GetComponent()[((Object)waitingAnimation).name].length) { ((Component)this).GetComponent()[((Object)waitingAnimation).name].time = 0f; ((Component)this).GetComponent().CrossFade(((Object)waitingAnimation).name); ((Component)this).GetComponent()[((Object)waitingAnimation).name].wrapMode = (WrapMode)8; waiting = true; } idleTimer = 0f - (2f + 4f * Random.value); } } else if (magnitude > 0f && waiting) { ((Component)this).GetComponent().CrossFade("locomotion"); waiting = false; idleTimer = 0f; } } } public class MouseLookCharacterController : MonoBehaviour { private CharacterMotor motor; public float sensitivityX = 15f; public float sensitivityY = 15f; private float rotationX = 0f; private float rotationY = 0f; private Quaternion originalRotation; private static bool loggedInputInfo = false; private void Start() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) motor = ((Component)this).GetComponent(typeof(CharacterMotor)) as CharacterMotor; if ((Object)(object)motor == (Object)null) { Debug.Log((object)"Motor is null!!"); } originalRotation = ((Component)this).transform.localRotation; } private void Update() { //IL_008b: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) rotationX += Input.GetAxis("Mouse X") * sensitivityX; rotationY += Input.GetAxis("Mouse Y") * sensitivityY; try { rotationX += Input.GetAxis("Horizontal2") * Time.deltaTime * 300f; rotationY += Input.GetAxis("Vertical2") * Time.deltaTime * 300f; } catch (UnityException ex) { UnityException ex2 = ex; if (!loggedInputInfo) { Debug.Log((object)("Hint: Setup axes \"Horizontal2\" and \"Vertical2\" to support aiming direction. This is optional.\nYou can map them to whichever keys or joystick axes you want to control aiming direction.\n" + ((Exception)(object)ex2).StackTrace), (Object)(object)this); loggedInputInfo = true; } } rotationX = Mathf.Repeat(rotationX, 360f); rotationY = Mathf.Clamp(rotationY, -85f, 85f); Quaternion val = Quaternion.AngleAxis(rotationX, Vector3.up); Quaternion val2 = Quaternion.AngleAxis(rotationY, -Vector3.right); motor.desiredFacingDirection = originalRotation * val * val2 * Vector3.forward; } } [RequireComponent(typeof(CharacterController))] public class NormalCharacterMotor : CharacterMotor { public float maxRotationSpeed = 270f; private bool firstframe = true; private void OnEnable() { firstframe = true; } private void UpdateFacingDirection() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) Vector3 val = base.desiredFacingDirection; float magnitude = ((Vector3)(ref val)).magnitude; Vector3 val2 = ((Component)this).transform.rotation * base.desiredMovementDirection * (1f - magnitude) + base.desiredFacingDirection * magnitude; val2 = Util.ProjectOntoPlane(val2, ((Component)this).transform.up); val2 = alignCorrection * val2; if (((Vector3)(ref val2)).sqrMagnitude > 0.01f) { Vector3 v = Util.ConstantSlerp(((Component)this).transform.forward, val2, maxRotationSpeed * Time.deltaTime); v = Util.ProjectOntoPlane(v, ((Component)this).transform.up); Quaternion rotation = default(Quaternion); ((Quaternion)(ref rotation)).SetLookRotation(v, ((Component)this).transform.up); ((Component)this).transform.rotation = rotation; } } private void UpdateVelocity() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Invalid comparison between Unknown and I4 //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) Component component = ((Component)this).GetComponent(typeof(CharacterController)); CharacterController val = (CharacterController)(object)((component is CharacterController) ? component : null); Vector3 val2 = val.velocity; if (firstframe) { val2 = Vector3.zero; firstframe = false; } if (base.grounded) { val2 = Util.ProjectOntoPlane(val2, ((Component)this).transform.up); } Vector3 val3 = val2; base.jumping = false; if (base.grounded) { Vector3 val4 = base.desiredVelocity - val2; if (((Vector3)(ref val4)).magnitude > maxVelocityChange) { val4 = ((Vector3)(ref val4)).normalized * maxVelocityChange; } val3 += val4; if (canJump && Input.GetButton("Jump")) { val3 += ((Component)this).transform.up * Mathf.Sqrt(2f * jumpHeight * gravity); base.jumping = true; } } val3 += ((Component)this).transform.up * (0f - gravity) * Time.deltaTime; if (base.jumping) { val3 -= ((Component)this).transform.up * (0f - gravity) * Time.deltaTime / 2f; } CollisionFlags val5 = val.Move(val3 * Time.deltaTime); base.grounded = (val5 & 4) != 0; } private void Update() { UpdateFacingDirection(); UpdateVelocity(); } } [RequireComponent(typeof(Rigidbody))] [RequireComponent(typeof(CapsuleCollider))] public class PhysicsCharacterMotor : CharacterMotor { public float maxRotationSpeed = 270f; public bool useCentricGravity = false; public LayerMask groundLayers; public Vector3 gravityCenter = Vector3.zero; private void Awake() { ((Component)this).GetComponent().freezeRotation = true; ((Component)this).GetComponent().useGravity = false; } private void AdjustToGravity() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) int layer = ((Component)this).gameObject.layer; ((Component)this).gameObject.layer = 2; Vector3 up = ((Component)this).transform.up; float num = Mathf.Clamp01(Time.deltaTime * 5f); Vector3 val = Vector3.zero; RaycastHit val3 = default(RaycastHit); for (int i = 0; i < 8; i++) { Vector3 val2 = ((Component)this).transform.position + ((Component)this).transform.up + Quaternion.AngleAxis((float)(360 * i) / 8f, ((Component)this).transform.up) * (((Component)this).transform.right * 0.5f) + base.desiredVelocity * 0.2f; if (Physics.Raycast(val2, ((Component)this).transform.up * -2f, ref val3, 3f, ((LayerMask)(ref groundLayers)).value)) { val += ((RaycastHit)(ref val3)).normal; } } Vector3 val4 = up + val; val = ((Vector3)(ref val4)).normalized; Vector3 val5 = up + val * num; Vector3 normalized = ((Vector3)(ref val5)).normalized; float num2 = Vector3.Angle(up, normalized); if ((double)num2 > 0.01) { Vector3 val6 = Vector3.Cross(up, normalized); Vector3 normalized2 = ((Vector3)(ref val6)).normalized; Quaternion val7 = Quaternion.AngleAxis(num2, normalized2); ((Component)this).transform.rotation = val7 * ((Component)this).transform.rotation; } ((Component)this).gameObject.layer = layer; } private void UpdateFacingDirection() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) Vector3 val = base.desiredFacingDirection; float magnitude = ((Vector3)(ref val)).magnitude; Vector3 val2 = ((Component)this).transform.rotation * base.desiredMovementDirection * (1f - magnitude) + base.desiredFacingDirection * magnitude; val2 = Util.ProjectOntoPlane(val2, ((Component)this).transform.up); val2 = alignCorrection * val2; if (((Vector3)(ref val2)).sqrMagnitude > 0.1f) { Vector3 v = Util.ConstantSlerp(((Component)this).transform.forward, val2, maxRotationSpeed * Time.deltaTime); v = Util.ProjectOntoPlane(v, ((Component)this).transform.up); Quaternion rotation = default(Quaternion); ((Quaternion)(ref rotation)).SetLookRotation(v, ((Component)this).transform.up); ((Component)this).transform.rotation = rotation; } } private void UpdateVelocity() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).GetComponent().velocity; if (base.grounded) { val = Util.ProjectOntoPlane(val, ((Component)this).transform.up); } base.jumping = false; if (base.grounded) { Vector3 val2 = base.desiredVelocity - val; if (((Vector3)(ref val2)).magnitude > maxVelocityChange) { val2 = ((Vector3)(ref val2)).normalized * maxVelocityChange; } ((Component)this).GetComponent().AddForce(val2, (ForceMode)2); if (canJump && Input.GetButton("Jump")) { ((Component)this).GetComponent().velocity = val + ((Component)this).transform.up * Mathf.Sqrt(2f * jumpHeight * gravity); base.jumping = true; } } ((Component)this).GetComponent().AddForce(((Component)this).transform.up * (0f - gravity) * ((Component)this).GetComponent().mass); base.grounded = false; } private void OnCollisionStay() { base.grounded = true; } private void FixedUpdate() { if (useCentricGravity) { AdjustToGravity(); } UpdateFacingDirection(); UpdateVelocity(); } } public class PlatformCharacterController : MonoBehaviour { private CharacterMotor motor; public float walkMultiplier = 0.5f; public bool defaultIsWalk = false; private static bool loggedInputInfo = false; private void Start() { motor = ((Component)this).GetComponent(typeof(CharacterMotor)) as CharacterMotor; if ((Object)(object)motor == (Object)null) { Debug.Log((object)"Motor is null!!"); } } private void Update() { //IL_00dd: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0f); if (((Vector3)(ref val)).magnitude > 1f) { val = ((Vector3)(ref val)).normalized; } val = ((Vector3)(ref val)).normalized * Mathf.Pow(((Vector3)(ref val)).magnitude, 2f); val = ((Component)Camera.main).transform.rotation * val; Quaternion val2 = Quaternion.FromToRotation(((Component)Camera.main).transform.forward * -1f, ((Component)this).transform.up); val = val2 * val; val = Quaternion.Inverse(((Component)this).transform.rotation) * val; if (walkMultiplier != 1f) { bool flag = false; try { flag = Input.GetButton("Sneak"); } catch (UnityException ex) { UnityException ex2 = ex; if (!loggedInputInfo) { Debug.Log((object)("Hint: Setup button \"Sneak\" to support walking slowly. This is optional.\nYou can map it to whichever key or joystick button you want to control walking speed.\n" + ((Exception)(object)ex2).StackTrace), (Object)(object)this); loggedInputInfo = true; } } if ((Input.GetKey("left shift") || Input.GetKey("right shift") || flag) != defaultIsWalk) { val *= walkMultiplier; } } motor.desiredMovementDirection = val; } } public class WanderingAICharacterController : MonoBehaviour { public bool onlyWalkForward; public float idleThreshold = 0.1f; private CharacterMotor motor; private float moveDirection = 0f; private float faceDirection = 0f; private float acceleration; private float moveSpeed = 0f; private float turnSpeed = 0f; private float faceSpeed = 0f; private void Start() { motor = ((Component)this).GetComponent(typeof(CharacterMotor)) as CharacterMotor; } private void Update() { //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)motor == (Object)null) { return; } turnSpeed += (Random.value - 0.5f) * Time.deltaTime * 5f; faceSpeed += (Random.value - 0.5f) * Time.deltaTime * 5f; turnSpeed = Mathf.Clamp(turnSpeed, -1f, 1f) * Mathf.Pow(0.5f, Time.deltaTime); faceSpeed = Mathf.Clamp(faceSpeed, -1f, 1f) * Mathf.Pow(0.5f, Time.deltaTime); moveDirection += turnSpeed * Time.deltaTime; faceDirection += faceSpeed * Time.deltaTime; moveDirection = Util.Mod(moveDirection); faceDirection = Util.Mod(faceDirection); acceleration += (Random.value - 0.5f) * Time.deltaTime / 10f; acceleration = Mathf.Clamp(acceleration, -1f, 1f); moveSpeed += acceleration; moveSpeed = Mathf.Clamp(moveSpeed, 0f, 1f); if (acceleration < 0f && moveSpeed == 0f) { acceleration = 0f; } if (acceleration > 0f && moveSpeed == 1f) { acceleration = 0f; } if (Time.time < 5f) { moveDirection = 0f; moveSpeed = 1f; } Vector3 val = Quaternion.AngleAxis(moveDirection * 360f, Vector3.up) * Vector3.forward * moveSpeed; Vector3 val2 = Quaternion.AngleAxis(faceDirection * 360f, Vector3.up) * Vector3.forward; val2 += val * 0.5f; val2 = ((Vector3)(ref val2)).normalized; if (onlyWalkForward) { val2 = ((Vector3)(ref val)).normalized; } float magnitude = ((Vector3)(ref val)).magnitude; motor.desiredFacingDirection = val2; if (magnitude < idleThreshold) { motor.desiredMovementDirection = Vector3.zero; if (onlyWalkForward) { motor.desiredFacingDirection = Vector3.zero; } } else { motor.desiredMovementDirection = Quaternion.Inverse(((Component)this).transform.rotation) * (val / magnitude) * ((magnitude - idleThreshold) / (1f - idleThreshold)); } } } public class FramesPerSecond : MonoBehaviour { public float updateInterval = 0.5f; private float accum = 0f; private int frames = 0; private float timeleft; private string fps; private void Start() { timeleft = updateInterval; } private void Update() { timeleft -= Time.deltaTime; accum += Time.timeScale / Time.deltaTime; frames++; if ((double)timeleft <= 0.0) { fps = "" + (accum / (float)frames).ToString("f2"); timeleft = updateInterval; accum = 0f; frames = 0; } } private void OnGUI() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) GUI.Label(new Rect((float)(Screen.width - 70), 0f, 70f, 20f), "FPS " + fps); } } public class PlanetCamera : MonoBehaviour { public GameObject character; public Vector3 positionVector; public Vector3 lookVector; private SmoothFollower posFollow; private SmoothFollower lookFollow; private Vector3 lastVelocityDir; private Vector3 lastPos; private void Start() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) posFollow = new SmoothFollower(0.5f, 0.5f); lookFollow = new SmoothFollower(0.1f, 0f); posFollow.Update(((Component)this).transform.position, 0f, reset: true); lookFollow.Update(character.transform.position, 0f, reset: true); lastVelocityDir = character.transform.forward; lastPos = character.transform.position; } private void LateUpdate() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) lastVelocityDir += (character.transform.position - lastPos) * 8f; lastPos = character.transform.position; lastVelocityDir += character.transform.forward * Time.deltaTime; lastVelocityDir = ((Vector3)(ref lastVelocityDir)).normalized; Vector3 val = ((Component)this).transform.position - character.transform.position; Vector3 val2 = val; Vector3 up = character.transform.up; Vector3.OrthoNormalize(ref up, ref val2); if (((Vector3)(ref val)).sqrMagnitude > ((Vector3)(ref val2)).sqrMagnitude) { val = val2; } ((Component)this).transform.position = posFollow.Update(character.transform.position + val * Mathf.Abs(positionVector.z) + up * positionVector.y, Time.deltaTime); val = lastVelocityDir; Vector3 val3 = lookFollow.Update(character.transform.position + val * lookVector.z - up * lookVector.y, Time.deltaTime); ((Component)this).transform.rotation = Quaternion.FromToRotation(((Component)this).transform.forward, val3 - ((Component)this).transform.position) * ((Component)this).transform.rotation; } } public class SmoothFollowCamera : MonoBehaviour { public GameObject target; public float smoothingTime = 0.5f; public Vector3 offset = Vector3.zero; public float rotateAngle = 45f; public float rotateTime = 25f; public bool useBounds = false; private SmoothFollower follower; private void Start() { follower = new SmoothFollower(smoothingTime); } private void LateUpdate() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null) { return; } Vector3 val = target.transform.position; if (useBounds) { Component componentInChildren = target.GetComponentInChildren(typeof(Renderer)); Renderer val2 = (Renderer)(object)((componentInChildren is Renderer) ? componentInChildren : null); Bounds bounds = val2.bounds; Vector3 center = ((Bounds)(ref bounds)).center; if (!float.IsNaN(center.x) && ((Vector3)(ref center)).magnitude < 10000f) { val = center; } } ((Component)this).transform.position = follower.Update(val + offset, Time.deltaTime); ((Component)this).transform.rotation = Quaternion.AngleAxis(Mathf.Sin(Time.time * 2f * (float)Math.PI / rotateTime) * rotateAngle, Vector3.up); } } public class SmoothFollowCamera2 : MonoBehaviour { public GameObject target; public Transform cam; public float smoothingTime = 0.5f; public Vector3 offset = Vector3.zero; public bool useBounds = false; private SmoothFollower follower; public int cameraMode = 0; public float cameraRotSide = 0f; public float cameraRotUp = 0f; private float cameraRotSideCur = 0f; private float cameraRotUpCur = 0f; public float distance = 4f; private void Start() { follower = new SmoothFollower(smoothingTime); } private void LateUpdate() { //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) if (Time.deltaTime == 0f || (Object)(object)target == (Object)null) { return; } bool flag = false; if (Input.GetKey((KeyCode)303) || Input.GetKey((KeyCode)304)) { flag = true; } if (Input.GetMouseButton(0) && !flag) { cameraRotSide += Input.GetAxis("Mouse X") * 5f; cameraRotUp -= Input.GetAxis("Mouse Y") * 5f; } cameraRotSideCur = Mathf.LerpAngle(cameraRotSideCur, cameraRotSide, Time.deltaTime * 5f); cameraRotUpCur = Mathf.Lerp(cameraRotUpCur, cameraRotUp, Time.deltaTime * 5f); if (Input.GetMouseButton(1) || (Input.GetMouseButton(0) && flag)) { distance *= 1f - 0.1f * Input.GetAxis("Mouse Y"); } distance *= 1f - 0.1f * Input.GetAxis("Mouse ScrollWheel"); Vector3 val = target.transform.position; if (useBounds) { Component componentInChildren = target.GetComponentInChildren(typeof(Renderer)); Renderer val2 = (Renderer)(object)((componentInChildren is Renderer) ? componentInChildren : null); Bounds bounds = val2.bounds; Vector3 center = ((Bounds)(ref bounds)).center; if (!float.IsNaN(center.x) && ((Vector3)(ref center)).magnitude < 10000f) { val = center; } } ((Component)this).transform.position = follower.Update(val + offset, Time.deltaTime); ((Component)this).transform.rotation = Quaternion.Euler(0f, cameraRotSideCur, cameraRotUpCur); float num = distance; if (Camera.main.orthographic) { num *= 4f; } float num2 = Mathf.Lerp(((Component)cam).transform.localPosition.x, num, Time.deltaTime * 5f); ((Component)cam).transform.localPosition = Vector3.right * num2; if (Camera.main.orthographic) { Camera.main.orthographicSize = num2 / 8f; } } } public class StepController : MonoBehaviour { public GameObject character; public GameObject box; public int stepAmount = 10; public float stepLength = 32f; public float slope = 0f; public float slopeJitter = 0f; public float step = 0f; public float stepJitter = 0f; public bool alternate = true; public float alternateFrequency = 3f; private float timer = 2f; private GameObject[] steps; private int leftmost; private int rightmost; private GameObject testStepA; private GameObject testStepB; private void Start() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) steps = (GameObject[])(object)new GameObject[stepAmount]; Random.seed = 123; Vector3 position = character.transform.position; for (int i = 0; i < stepAmount; i++) { steps[i] = Object.Instantiate(box, new Vector3(position.x, -0.5f, (float)(-stepAmount / 2 + i) + position.z), ((Component)this).transform.rotation); steps[i].transform.localScale = new Vector3(stepLength, 1f, 1f); steps[i].transform.parent = ((Component)this).transform; steps[i].GetComponent().material.mainTextureScale = new Vector2(stepLength, steps[i].GetComponent().material.mainTextureScale.y); } leftmost = 0; rightmost = stepAmount - 1; } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) Vector3 position = character.transform.position; Vector3 val = default(Vector3); Vector3 val2 = default(Vector3); for (int i = -1; i <= 1; i += 2) { int num = rightmost; int num2 = leftmost; if (i == -1) { num = leftmost; num2 = rightmost; } if (Mathf.Abs(steps[num].transform.position.z - position.z) < Mathf.Abs(steps[Util.Mod(num2 + i, stepAmount)].transform.position.z - position.z)) { float num3 = step + (Random.value - 0.5f) * stepJitter; if (Mathf.Abs(num3) < 0.05f) { num3 = 0f; } float num4 = Mathf.Abs(step) + stepJitter * 0.5f; if (num4 > 0.5f) { num3 /= num4 / 0.5f; } num3 *= 0.5f; float num5 = slope + (Random.value - 0.5f) * slopeJitter; num4 = Mathf.Abs(slope) + slopeJitter * 0.5f; if (num4 > 0.5f) { num5 /= num4 / 0.5f; } num5 *= 0.6f; ((Vector3)(ref val))..ctor(0f, num3, 0f); ((Vector3)(ref val2))..ctor(0f, num5, 1f); steps[num2].transform.position = Vector3.zero; steps[num2].transform.localScale = new Vector3(stepLength, 1f, ((Vector3)(ref val2)).magnitude); steps[num2].transform.rotation = default(Quaternion); steps[num2].transform.Rotate(Vector3.right, Mathf.Atan2(0f - val2.y, val2.z) * 57.29578f); steps[num2].transform.position = -steps[num2].transform.TransformPoint(new Vector3(0f, 0.5f, (float)(-i) * 0.5f)) + steps[num].transform.TransformPoint(new Vector3(0f, 0.5f, (float)i * 0.5f)) + val * (float)i; rightmost = Util.Mod(rightmost + i, stepAmount); leftmost = Util.Mod(leftmost + i, stepAmount); } } float x = position.x; for (int j = 0; j < steps.Length; j++) { steps[j].transform.position = new Vector3(x, steps[j].transform.position.y, steps[j].transform.position.z); steps[j].GetComponent().material.mainTextureOffset = new Vector2((0f - x) / steps[j].transform.lossyScale.x * steps[j].GetComponent().material.mainTextureScale.x, 0f); } if (!alternate) { return; } timer -= Time.deltaTime; if (timer < 0f) { timer = alternateFrequency; if (Random.value > 0.5f) { step = step * 0.7f + (Random.value - 0.5f) * 0.5f; } if (Random.value > 0.5f) { stepJitter = stepJitter * 0.6f + Random.value - 0.5f; } if (Random.value > 0.5f) { slope = slope * 0.7f + (Random.value - 0.5f) * 0.5f; } if (Random.value > 0.5f) { slopeJitter = slopeJitter * 0.6f + Random.value - 0.5f; } } } } public class StepWalkSwitcher : MonoBehaviour { public GameObject[] characters; public GameObject cameraController; public bool showGhost = false; private int showClones = 0; private float lastCloneTime = 0f; private Vector3[] characterBounds; private bool showOptions = false; private StepController sc; private int oldCharacter = 0; private int activeCharacter = 0; private float[] initHeights; private bool switchCharacter = false; private GameObject ghost = null; private List clones; public bool autoWalk = true; public bool autoSwitchCharacter = true; private float autoSwitchCharacterTime = 29f; private float autoSwitchCharacterTimer = 29f; private float autoSwitchCameraTime = 9f; private float autoSwitchCameraTimer = 9f; private bool renderFootMarkers = false; private bool renderBlendingGraph = false; private bool renderCycleGraph = false; private bool renderAnimationStates = false; private bool disableLocomotion = false; private void Awake() { sc = ((Component)this).GetComponent(typeof(StepController)) as StepController; sc.character = characters[0]; clones = new List(); SmoothFollowCamera2 smoothFollowCamera = cameraController.GetComponent(typeof(SmoothFollowCamera2)) as SmoothFollowCamera2; smoothFollowCamera.target = characters[0]; characterBounds = (Vector3[])(object)new Vector3[characters.Length]; } private void Start() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) initHeights = new float[characters.Length]; for (int i = 0; i < characters.Length; i++) { initHeights[i] = characters[i].transform.position.y; Component componentInChildren = characters[i].GetComponentInChildren(typeof(Renderer)); Renderer val = (Renderer)(object)((componentInChildren is Renderer) ? componentInChildren : null); ref Vector3 reference = ref characterBounds[i]; Bounds bounds = val.bounds; reference = ((Bounds)(ref bounds)).size; if (float.IsNaN(characterBounds[i].x) || ((Vector3)(ref characterBounds[i])).magnitude > 10000f) { ref Vector3 reference2 = ref characterBounds[i]; reference2 = Vector3.zero; } } UseCharacter(activeCharacter); ToggleAutoWalk(autoWalk); ToggleRenderFootMarkers(renderFootMarkers); ToggleRenderBlendingGraph(renderBlendingGraph); ToggleRenderCycleGraph(renderCycleGraph); ToggleRenderAnimationStates(renderAnimationStates); } private void Update() { //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown("return")) { switchCharacter = true; activeCharacter++; } if (Input.GetKeyDown((KeyCode)8)) { showOptions = !showOptions; } if (autoSwitchCharacter) { autoSwitchCharacterTimer -= Time.deltaTime; if (autoSwitchCharacterTimer <= 0f) { autoSwitchCharacterTimer = autoSwitchCharacterTime; activeCharacter++; switchCharacter = true; } autoSwitchCameraTimer -= Time.deltaTime; if (autoSwitchCameraTimer <= 0f) { autoSwitchCameraTimer = autoSwitchCameraTime; SmoothFollowCamera2 smoothFollowCamera = cameraController.GetComponent(typeof(SmoothFollowCamera2)) as SmoothFollowCamera2; smoothFollowCamera.cameraRotSide = Random.Range(-90, 90); smoothFollowCamera.cameraRotUp = Mathf.Pow(Random.value, 2f) * 50f; } } if (switchCharacter) { UseCharacter(activeCharacter % characters.Length); } switchCharacter = false; oldCharacter = activeCharacter; float num = 2.5f * Mathf.Max(Mathf.Max(characterBounds[activeCharacter].x, characterBounds[activeCharacter].y * 0.75f), characterBounds[activeCharacter].z); if (Input.GetKeyDown((KeyCode)99)) { showClones++; } if (Input.GetKeyDown((KeyCode)120)) { showClones = Mathf.Max(0, showClones - 1); } if (showClones > clones.Count - 1 && lastCloneTime < Time.time - 1f) { lastCloneTime = Time.time; Debug.Log((object)"Adding Clone"); GameObject val = Object.Instantiate(characters[activeCharacter]); clones.Add(val); Component[] components = val.GetComponents(typeof(Component)); Component[] array = components; foreach (Component val2 in array) { Type type = ((object)val2).GetType(); if ((object)type == typeof(PlatformCharacterController) || (object)type == typeof(AimLookCharacterController) || (object)type == typeof(AimLookCharacterController) || (object)type == typeof(WanderingAICharacterController)) { Object.Destroy((Object)(object)val2); } } val.transform.position = characters[activeCharacter].transform.position + new Vector3(-2f * num, 2f, 0f); } if (showClones < clones.Count - 1) { Debug.Log((object)"Removing Clone"); Object.Destroy((Object)(object)clones[clones.Count - 1]); clones.RemoveAt(clones.Count - 1); } for (int j = 1; j < clones.Count; j++) { if (clones[j].transform.position.y - clones[0].transform.position.y < -100f) { Object.Destroy((Object)(object)clones[j]); clones.RemoveAt(j); j--; } } Vector3 position = characters[activeCharacter].transform.position; if (clones.Count <= 1) { return; } for (int k = 1; k < clones.Count; k++) { Vector3 val3 = position - clones[k].transform.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; Vector3 val4 = Vector3.zero; for (int l = 0; l < clones.Count; l++) { if (k != l) { Vector3 val5 = clones[k].transform.position - clones[l].transform.position; float magnitude = ((Vector3)(ref val5)).magnitude; val4 += val5 / magnitude * Mathf.Pow(Mathf.Max(0f, num - magnitude), 2f); } } NormalCharacterMotor normalCharacterMotor = clones[k].GetComponent(typeof(NormalCharacterMotor)) as NormalCharacterMotor; Vector3 val6 = Util.ProjectOntoPlane(clones[k].transform.InverseTransformDirection(normalized * 2f + val4), Vector3.up); float magnitude2 = ((Vector3)(ref val6)).magnitude; if (magnitude2 == 0f) { normalCharacterMotor.desiredMovementDirection = Vector3.zero; } else { normalCharacterMotor.desiredMovementDirection = Vector3.Lerp(normalCharacterMotor.desiredMovementDirection, val6 / magnitude2 * Mathf.InverseLerp(0.2f, 1f, magnitude2), 0.5f); } } } private void UseCharacter(int nr) { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) activeCharacter = nr; for (int i = 0; i < characters.Length; i++) { if (i == nr) { characters[nr].SetActive(true); } else { characters[i].SetActive(false); } } SmoothFollowCamera2 smoothFollowCamera = cameraController.GetComponent(typeof(SmoothFollowCamera2)) as SmoothFollowCamera2; smoothFollowCamera.target = characters[activeCharacter]; if (showGhost) { smoothFollowCamera.offset = Vector3.right * (0f - ((Vector3)(ref characterBounds[activeCharacter])).magnitude) / 2f; } else { smoothFollowCamera.offset = Vector3.zero; } smoothFollowCamera.distance = ((Vector3)(ref characterBounds[activeCharacter])).magnitude * ((!showGhost) ? 1.2f : 1.8f); sc.character = characters[activeCharacter]; characters[activeCharacter].transform.position = characters[oldCharacter].transform.position + Vector3.up * (initHeights[activeCharacter] - initHeights[oldCharacter]); if (clones.Count > 0) { for (int j = 1; j < clones.Count; j++) { Object.Destroy((Object)(object)clones[j]); } } clones.Clear(); clones.Add(characters[activeCharacter]); if ((Object)(object)ghost != (Object)null) { Object.Destroy((Object)(object)ghost); ghost = null; } if (!showGhost) { return; } ghost = Object.Instantiate(characters[activeCharacter]); int num = 0; Component[] components; do { components = ghost.GetComponents(typeof(Component)); Component[] array = components; foreach (Component val in array) { Type type = ((object)val).GetType(); if ((object)type != typeof(Transform) && (object)type != typeof(Animation) && (num > 0 || ((object)type != typeof(LegController) && (object)type != typeof(CharacterController) && (object)type != typeof(AlignmentTracker)))) { Object.Destroy((Object)(object)val); } } num++; } while (components.Length > 2 && num < 2); GhostOriginal ghostOriginal = ghost.AddComponent(typeof(GhostOriginal)) as GhostOriginal; ghostOriginal.character = characters[activeCharacter]; ghostOriginal.offset = new Vector3(0f - ((Vector3)(ref characterBounds[activeCharacter])).magnitude, 0f, 0f); LegAnimator legAnimator = characters[activeCharacter].GetComponent(typeof(LegAnimator)) as LegAnimator; legAnimator.ghost = ghost; } private void WindowFunction(int id) { GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.Label("Automatic Demo:", (GUILayoutOption[])(object)new GUILayoutOption[0]); bool flag = autoWalk; autoWalk = GUILayout.Toggle(autoWalk, "Random Walking", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (flag != autoWalk) { ToggleAutoWalk(autoWalk); } flag = autoSwitchCharacter; autoSwitchCharacter = GUILayout.Toggle(autoSwitchCharacter, "Variate Character + Cam", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (flag != autoSwitchCharacter) { ToggleAutoSwitch(autoSwitchCharacter); } flag = sc.alternate; sc.alternate = GUILayout.Toggle(sc.alternate, "Variate Terrain", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (flag != sc.alternate) { ToggleVariateTerrain(sc.alternate); } GUILayout.Label("Visualization:", (GUILayoutOption[])(object)new GUILayoutOption[0]); flag = showGhost; showGhost = GUILayout.Toggle(showGhost, "Render Animation Ghost", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (flag != showGhost) { switchCharacter = true; } flag = renderFootMarkers; renderFootMarkers = GUILayout.Toggle(renderFootMarkers, "Render Foot Markers", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (flag != renderFootMarkers) { ToggleRenderFootMarkers(renderFootMarkers); } flag = renderCycleGraph; renderCycleGraph = GUILayout.Toggle(renderCycleGraph, "Render Cycle Graph", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (flag != renderCycleGraph) { ToggleRenderCycleGraph(renderCycleGraph); } flag = renderBlendingGraph; renderBlendingGraph = GUILayout.Toggle(renderBlendingGraph, "Render Blending Graph", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (flag != renderBlendingGraph) { ToggleRenderBlendingGraph(renderBlendingGraph); } flag = renderAnimationStates; renderAnimationStates = GUILayout.Toggle(renderAnimationStates, "Render Animation States", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (flag != renderAnimationStates) { ToggleRenderAnimationStates(renderAnimationStates); } GUILayout.EndVertical(); GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.Label("Characters: " + (showClones + 1), (GUILayoutOption[])(object)new GUILayoutOption[0]); showClones = (int)Mathf.Round(GUILayout.HorizontalSlider((float)showClones, 0f, 19f, (GUILayoutOption[])(object)new GUILayoutOption[0])); GUILayout.Label("Time Scale: " + Time.timeScale.ToString(".##"), (GUILayoutOption[])(object)new GUILayoutOption[0]); float num = Mathf.Log(Time.timeScale, 2f); num = GUILayout.HorizontalSlider(num, -3f, 3f, (GUILayoutOption[])(object)new GUILayoutOption[0]); if (num > -0.1f && num < 0.1f) { num = 0f; } Time.timeScale = Mathf.Pow(2f, num); GUILayout.Label("Other Options:", (GUILayoutOption[])(object)new GUILayoutOption[0]); flag = disableLocomotion; disableLocomotion = GUILayout.Toggle(disableLocomotion, "Disable Locomotion", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (flag != disableLocomotion) { ToggleDisableLocomotion(disableLocomotion); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); } private void OnGUI() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Expected O, but got Unknown //IL_03ee: Unknown result type (might be due to invalid IL or missing references) GUI.Label(new Rect(5f, 5f, 90f, 20f), "Step height:"); sc.step = GUI.HorizontalSlider(new Rect(80f, 10f, 100f, 15f), sc.step, -0.5f, 0.5f); if (Mathf.Abs(sc.step) < 0.05f) { sc.step = 0f; } GUI.Label(new Rect(195f, 5f, 90f, 20f), "Random:"); sc.stepJitter = GUI.HorizontalSlider(new Rect(260f, 10f, 50f, 15f), sc.stepJitter, 0f, 1f); GUI.Label(new Rect(5f, 25f, 90f, 20f), "Step slope:"); sc.slope = GUI.HorizontalSlider(new Rect(80f, 30f, 100f, 15f), sc.slope, -0.5f, 0.5f); if (Mathf.Abs(sc.slope) < 0.05f) { sc.slope = 0f; } GUI.Label(new Rect(195f, 25f, 90f, 20f), "Random:"); sc.slopeJitter = GUI.HorizontalSlider(new Rect(260f, 30f, 50f, 15f), sc.slopeJitter, 0f, 1f); GUI.Label(new Rect(328f, 5f, 90f, 20f), "Auto-Demo:"); bool flag = autoSwitchCharacter && autoWalk && sc.alternate; bool flag2 = flag; if (GUI.Toggle(new Rect(325f, 25f, 35f, 15f), flag, "On") && !flag2) { ToggleAutoSwitch(state: true); ToggleAutoWalk(state: true); ToggleVariateTerrain(state: true); } bool flag3 = !autoSwitchCharacter && !autoWalk && !sc.alternate; flag2 = flag3; if (GUI.Toggle(new Rect(360f, 25f, 40f, 15f), flag3, "Off") && !flag2) { ToggleAutoSwitch(state: false); ToggleAutoWalk(state: false); ToggleVariateTerrain(state: false); } GUILayout.BeginArea(new Rect(5f, (float)(Screen.height - 25), 500f, 25f)); GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]); if (GUILayout.Button("OPTIONS", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) })) { showOptions = !showOptions; } if (showOptions) { for (int i = 0; i < characters.Length; i++) { if (GUILayout.Button(((Object)characters[i]).name, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) })) { switchCharacter = true; activeCharacter = i; showOptions = false; } } } GUILayout.EndHorizontal(); GUILayout.EndArea(); if (showOptions) { GUI.Window(0, new Rect(5f, (float)(Screen.height - 280), 360f, 250f), new WindowFunction(WindowFunction), "Options"); } } private void ToggleAutoWalk(bool state) { autoWalk = state; for (int i = 0; i < characters.Length; i++) { WanderingAICharacterController wanderingAICharacterController = characters[i].GetComponent(typeof(WanderingAICharacterController)) as WanderingAICharacterController; ((Behaviour)wanderingAICharacterController).enabled = state; PlatformCharacterController platformCharacterController = characters[i].GetComponent(typeof(PlatformCharacterController)) as PlatformCharacterController; ((Behaviour)platformCharacterController).enabled = !state; } if (!state) { ToggleAutoSwitch(state: false); } } private void ToggleRenderFootMarkers(bool state) { for (int i = 0; i < characters.Length; i++) { LegAnimator legAnimator = characters[i].GetComponent(typeof(LegAnimator)) as LegAnimator; legAnimator.renderFootMarkers = state; } } private void ToggleRenderBlendingGraph(bool state) { for (int i = 0; i < characters.Length; i++) { LegAnimator legAnimator = characters[i].GetComponent(typeof(LegAnimator)) as LegAnimator; legAnimator.renderBlendingGraph = state; } } private void ToggleRenderCycleGraph(bool state) { for (int i = 0; i < characters.Length; i++) { LegAnimator legAnimator = characters[i].GetComponent(typeof(LegAnimator)) as LegAnimator; legAnimator.renderCycleGraph = state; } } private void ToggleRenderAnimationStates(bool state) { for (int i = 0; i < characters.Length; i++) { LegAnimator legAnimator = characters[i].GetComponent(typeof(LegAnimator)) as LegAnimator; legAnimator.renderAnimationStates = state; } } private void ToggleVariateTerrain(bool state) { sc.alternate = state; if (!sc.alternate) { sc.slope = 0f; sc.slopeJitter = 0f; sc.step = 0f; sc.stepJitter = 0f; } } private void ToggleAutoSwitch(bool state) { autoSwitchCharacter = state; autoSwitchCharacterTimer = autoSwitchCharacterTime; } private void ToggleDisableLocomotion(bool state) { disableLocomotion = state; for (int i = 0; i < clones.Count; i++) { LegAnimator legAnimator = clones[i].GetComponent(typeof(LegAnimator)) as LegAnimator; ((Behaviour)legAnimator).enabled = !state; HeadLookController headLookController = clones[i].GetComponent(typeof(HeadLookController)) as HeadLookController; ((Behaviour)headLookController).enabled = !state; } } } public class TestSwitcher : MonoBehaviour { public GameObject[] characters; [Space] public Material vertexColorMaterial; private GameObject currentCharacter; private AnimationClip currentAnimation; private LegController legC; private MotionAnalyzer analyzer; private int selectedCharacter; private int selectedAnimation; private string[] optionsCharacter; private string[] optionsAnimation; private string[] optionsLeg; private bool showOptions = true; private MotionAnalyzerDrawOptions opt = new MotionAnalyzerDrawOptions(); private void Start() { for (int i = 0; i < characters.Length; i++) { characters[i].SetActive(false); } selectedCharacter = 0; selectedAnimation = 0; opt.currentLeg = 0; UpdateOptions(); } private void UpdateOptions() { currentCharacter = characters[selectedCharacter]; legC = currentCharacter.GetComponent(typeof(LegController)) as LegController; currentCharacter.SetActive(true); if (!(legC.motions[selectedAnimation] is MotionAnalyzer motionAnalyzer)) { return; } analyzer = motionAnalyzer; currentAnimation = analyzer.animation; StartAnimation(); optionsCharacter = new string[characters.Length]; for (int i = 0; i < characters.Length; i++) { optionsCharacter[i] = ((Object)characters[i]).name; } optionsAnimation = new string[legC.motions.Length]; for (int j = 0; j < legC.motions.Length; j++) { if (legC.motions[j] is MotionAnalyzer) { optionsAnimation[j] = ((Object)legC.motions[j].animation).name; } else { optionsAnimation[j] = "N/A"; } } optionsLeg = new string[legC.legs.Length]; for (int k = 0; k < legC.legs.Length; k++) { optionsLeg[k] = "Leg " + (k + 1); } } private void StartAnimation() { currentCharacter.GetComponent().CrossFade(((Object)currentAnimation).name, 0f); currentCharacter.GetComponent()[((Object)currentAnimation).name].enabled = true; currentCharacter.GetComponent()[((Object)currentAnimation).name].wrapMode = (WrapMode)2; currentCharacter.GetComponent()[((Object)currentAnimation).name].speed = 1f; } private void Update() { if (Input.GetKeyDown("down")) { opt.currentLeg--; } if (Input.GetKeyDown("up")) { opt.currentLeg++; } if (opt.currentLeg < 0) { opt.currentLeg += legC.legs.Length; } if (opt.currentLeg >= legC.legs.Length) { opt.currentLeg -= legC.legs.Length; } if (Input.GetKeyDown("return")) { if (currentCharacter.GetComponent()[((Object)currentAnimation).name].speed == 0f) { currentCharacter.GetComponent()[((Object)currentAnimation).name].speed = 1f; } else { currentCharacter.GetComponent()[((Object)currentAnimation).name].speed = 0f; } } if (Input.GetKeyDown("left")) { currentCharacter.GetComponent()[((Object)currentAnimation).name].speed = 0f; currentCharacter.GetComponent()[((Object)currentAnimation).name].normalizedTime = Mathf.Floor(currentCharacter.GetComponent()[((Object)currentAnimation).name].normalizedTime * (float)analyzer.samples - 0.5f) / (float)analyzer.samples; } if (Input.GetKeyDown("right")) { currentCharacter.GetComponent()[((Object)currentAnimation).name].speed = 0f; currentCharacter.GetComponent()[((Object)currentAnimation).name].normalizedTime = Mathf.Ceil(currentCharacter.GetComponent()[((Object)currentAnimation).name].normalizedTime * (float)analyzer.samples + 0.5f) / (float)analyzer.samples; } if (Input.GetKeyDown("[+]")) { AnimationState obj = currentCharacter.GetComponent()[((Object)currentAnimation).name]; obj.speed *= 2f; } if (Input.GetKeyDown("[-]")) { AnimationState obj2 = currentCharacter.GetComponent()[((Object)currentAnimation).name]; obj2.speed /= 2f; } currentCharacter.GetComponent()[((Object)currentAnimation).name].normalizedTime = Util.Mod(currentCharacter.GetComponent()[((Object)currentAnimation).name].normalizedTime, 1f); if (Input.GetKeyDown((KeyCode)118)) { opt.isolateVertical = !opt.isolateVertical; if (opt.isolateVertical) { opt.isolateHorisontal = false; } } if (Input.GetKeyDown((KeyCode)104)) { opt.isolateHorisontal = !opt.isolateHorisontal; if (opt.isolateHorisontal) { opt.isolateVertical = false; } } opt.graphScaleH += ((!opt.isolateVertical) ? Time.deltaTime : (0f - Time.deltaTime)); opt.graphScaleV += ((!opt.isolateHorisontal) ? Time.deltaTime : (0f - Time.deltaTime)); opt.graphScaleH = Mathf.Clamp01(opt.graphScaleH); opt.graphScaleV = Mathf.Clamp01(opt.graphScaleV); } private void OnGUI() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Expected O, but got Unknown //IL_020c: Unknown result type (might be due to invalid IL or missing references) GUI.Label(new Rect(10f, 0f, 260f, 20f), "Use enter, +/-, and arrows for time control"); GUI.Label(new Rect(260f, 0f, 200f, 20f), $"Time: {currentCharacter.GetComponent()[((Object)currentAnimation).name].normalizedTime:0.000}"); selectedCharacter = GUI.Toolbar(new Rect(10f, 20f, 220f, 20f), selectedCharacter, optionsCharacter); selectedAnimation = GUI.Toolbar(new Rect(10f, 40f, 220f, 20f), selectedAnimation, optionsAnimation); opt.currentLeg = GUI.Toolbar(new Rect(10f, 60f, 220f, 20f), opt.currentLeg, optionsLeg); if (optionsCharacter[selectedCharacter] != ((Object)currentCharacter).name) { selectedAnimation = 0; opt.currentLeg = 0; currentCharacter.SetActive(false); UpdateOptions(); } else if (optionsAnimation[selectedAnimation] != ((Object)currentAnimation).name) { opt.currentLeg = 0; UpdateOptions(); } if (GUI.Button(new Rect((float)(Screen.width - 85), 5f, 80f, 25f), "OPTIONS")) { showOptions = !showOptions; } if (showOptions) { GUI.Window(0, new Rect((float)(Screen.width - 180 - 5), 30f, 180f, 375f), new WindowFunction(WindowFunction), "Options"); } } private void WindowFunction(int id) { GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[0]); bool flag = false; GUILayout.Label("Visualization:", (GUILayoutOption[])(object)new GUILayoutOption[0]); opt.drawAllFeet = GUILayout.Toggle(opt.drawAllFeet, "Show all feet", (GUILayoutOption[])(object)new GUILayoutOption[0]); opt.drawHeelToe = GUILayout.Toggle(opt.drawHeelToe, "Show heel and toe", (GUILayoutOption[])(object)new GUILayoutOption[0]); opt.drawFootBase = GUILayout.Toggle(opt.drawFootBase, "Show foot base", (GUILayoutOption[])(object)new GUILayoutOption[0]); opt.drawFootPrints = GUILayout.Toggle(opt.drawFootPrints, "Show foot prints", (GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.Label("Trajectories:", (GUILayoutOption[])(object)new GUILayoutOption[0]); opt.drawTrajectories = GUILayout.Toggle(opt.drawTrajectories, "Show trajectories", (GUILayoutOption[])(object)new GUILayoutOption[0]); opt.drawTrajectoriesProjected = GUILayout.Toggle(opt.drawTrajectoriesProjected, " Show projected", (GUILayoutOption[])(object)new GUILayoutOption[0]); opt.drawThreePoints = GUILayout.Toggle(opt.drawThreePoints, " Show dots and axis", (GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.Label("Graph:", (GUILayoutOption[])(object)new GUILayoutOption[0]); opt.drawGraph = GUILayout.Toggle(opt.drawGraph, "Show graph", (GUILayoutOption[])(object)new GUILayoutOption[0]); flag = opt.isolateHorisontal; opt.isolateHorisontal = GUILayout.Toggle(opt.isolateHorisontal, " Isolate horisontal", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (!flag && opt.isolateHorisontal) { opt.isolateVertical = false; } flag = opt.isolateVertical; opt.isolateVertical = GUILayout.Toggle(opt.isolateVertical, " Isolate vertical", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (!flag && opt.isolateVertical) { opt.isolateHorisontal = false; } opt.drawStanceMarkers = GUILayout.Toggle(opt.drawStanceMarkers, " Show stance markers", (GUILayoutOption[])(object)new GUILayoutOption[0]); opt.drawLiftedCurve = GUILayout.Toggle(opt.drawLiftedCurve, " Show lifting curve", (GUILayoutOption[])(object)new GUILayoutOption[0]); opt.drawBalanceCurve = GUILayout.Toggle(opt.drawBalanceCurve, " Show balance curve", (GUILayoutOption[])(object)new GUILayoutOption[0]); opt.normalizeGraph = GUILayout.Toggle(opt.normalizeGraph, " Show normalized", (GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.EndVertical(); } private void OnRenderObject() { analyzer.RenderGraph(opt, vertexColorMaterial); } } public class TimeController : MonoBehaviour { private bool paused = false; private float timeScale = 1f; private void Start() { } private void Update() { bool flag = false; if (Input.GetKeyDown("[+]")) { Time.timeScale *= 2f; flag = true; } if (Input.GetKeyDown("[-]")) { Time.timeScale /= 2f; flag = true; } if (flag && Time.timeScale > 0.75f && Time.timeScale < 1.5f) { Time.timeScale = 1f; } if (Input.GetKeyDown("p")) { paused = !paused; if (paused) { timeScale = Time.timeScale; Time.timeScale = 0.001f; } else { Time.timeScale = timeScale; } } } } public class AlignmentTracker : MonoBehaviour { public bool fixedUpdate = false; private float m_CurrentFixedTime; private float m_CurrentLateTime; private Vector3 m_Position = Vector3.zero; private Vector3 m_PositionPrev = Vector3.zero; private Vector3 m_Velocity = Vector3.zero; private Vector3 m_VelocityPrev = Vector3.zero; private Vector3 m_VelocitySmoothed = Vector3.zero; private Vector3 m_Acceleration = Vector3.zero; private Vector3 m_AccelerationSmoothed = Vector3.zero; private Quaternion m_Rotation = Quaternion.identity; private Quaternion m_RotationPrev = Quaternion.identity; private Vector3 m_AngularVelocity = Vector3.zero; private Vector3 m_AngularVelocitySmoothed = Vector3.zero; private Rigidbody m_Rigidbody; private Transform m_Transform; public Vector3 position => m_Position; public Vector3 velocity => m_Velocity; public Vector3 velocitySmoothed => m_VelocitySmoothed; public Vector3 acceleration => m_Acceleration; public Vector3 accelerationSmoothed => m_AccelerationSmoothed; public Quaternion rotation => m_Rotation; public Vector3 angularVelocity => m_AngularVelocity; public Vector3 angularVelocitySmoothed => m_AngularVelocitySmoothed; private void Awake() { Reset(); } private void OnEnable() { Reset(); } public void Reset() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) m_Rigidbody = ((Component)this).GetComponent(); m_Transform = ((Component)this).transform; m_CurrentLateTime = -1f; m_CurrentFixedTime = -1f; m_Position = (m_PositionPrev = m_Transform.position); m_Rotation = (m_RotationPrev = m_Transform.rotation); m_Velocity = Vector3.zero; m_VelocityPrev = Vector3.zero; m_VelocitySmoothed = Vector3.zero; m_Acceleration = Vector3.zero; m_AccelerationSmoothed = Vector3.zero; m_AngularVelocity = Vector3.zero; m_AngularVelocitySmoothed = Vector3.zero; } private Vector3 CalculateAngularVelocity(Quaternion prev, Quaternion current) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.Inverse(prev) * current; float num = 0f; Vector3 zero = Vector3.zero; ((Quaternion)(ref val)).ToAngleAxis(ref num, ref zero); if (zero == Vector3.zero || zero.x == float.PositiveInfinity || zero.x == float.NegativeInfinity) { return Vector3.zero; } if (num > 180f) { num -= 360f; } num /= Time.deltaTime; return ((Vector3)(ref zero)).normalized * num; } private void UpdateTracking() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) m_Position = m_Transform.position; m_Rotation = m_Transform.rotation; if ((Object)(object)m_Rigidbody != (Object)null) { m_Velocity = (m_Position - m_PositionPrev) / Time.deltaTime; m_AngularVelocity = CalculateAngularVelocity(m_RotationPrev, m_Rotation); } else { m_Velocity = (m_Position - m_PositionPrev) / Time.deltaTime; m_AngularVelocity = CalculateAngularVelocity(m_RotationPrev, m_Rotation); } m_Acceleration = (m_Velocity - m_VelocityPrev) / Time.deltaTime; m_PositionPrev = m_Position; m_RotationPrev = m_Rotation; m_VelocityPrev = m_Velocity; } public void ControlledFixedUpdate() { if (Time.deltaTime != 0f && Time.timeScale != 0f && m_CurrentFixedTime != Time.time) { m_CurrentFixedTime = Time.time; if (fixedUpdate) { UpdateTracking(); } } } public void ControlledLateUpdate() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) if (Time.deltaTime != 0f && Time.timeScale != 0f && m_CurrentLateTime != Time.time) { m_CurrentLateTime = Time.time; if (!fixedUpdate) { UpdateTracking(); } m_VelocitySmoothed = Vector3.Lerp(m_VelocitySmoothed, m_Velocity, Time.deltaTime * 10f); m_AccelerationSmoothed = Vector3.Lerp(m_AccelerationSmoothed, m_Acceleration, Time.deltaTime * 3f); m_AngularVelocitySmoothed = Vector3.Lerp(m_AngularVelocitySmoothed, m_AngularVelocity, Time.deltaTime * 3f); if (fixedUpdate) { m_Position += m_Velocity * Time.deltaTime; } } } } public class GhostOriginal : MonoBehaviour { public GameObject character; public Vector3 offset; public void Synch() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) foreach (AnimationState item in character.GetComponent()) { AnimationState val = item; AnimationState val2 = ((Component)this).GetComponent()[val.name]; if ((TrackedReference)(object)val2 == (TrackedReference)null) { ((Component)this).GetComponent().AddClip(val.clip, val.name); val2 = ((Component)this).GetComponent()[val.name]; } if (val2.enabled != val.enabled) { val2.wrapMode = val.wrapMode; val2.enabled = val.enabled; val2.speed = val.speed; } val2.weight = val.weight; val2.time = val.time; } } private void LateUpdate() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = character.transform.position + offset; ((Component)this).transform.rotation = character.transform.rotation; } } [RequireComponent(typeof(AlignmentTracker))] public class HeadLookController : MonoBehaviour { public Transform neck; public Transform head; public Vector3 headLookVector = Vector3.forward; public Vector3 headUpVector = Vector3.up; public float rotationMultiplier = 0.5f; private Vector3 referenceLookDir; private Vector3 referenceUpDir; private AlignmentTracker tr; private Vector3 lookDir; private Vector3 upDir; private void Start() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) tr = ((Component)this).GetComponent(typeof(AlignmentTracker)) as AlignmentTracker; Quaternion rotation = neck.parent.rotation; Quaternion val = Quaternion.Inverse(rotation); referenceLookDir = val * ((Component)this).transform.rotation * ((Vector3)(ref headLookVector)).normalized; referenceUpDir = val * ((Component)this).transform.rotation * ((Vector3)(ref headUpVector)).normalized; lookDir = referenceLookDir; upDir = referenceUpDir; } private void LateUpdate() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) if (Time.deltaTime != 0f) { Quaternion rotation = neck.parent.rotation; Quaternion val = Quaternion.Inverse(rotation); Vector3 val2 = ((Component)this).transform.rotation * headLookVector * 0.01f; val2 += Util.ProjectOntoPlane(tr.velocity, ((Component)this).transform.up); Vector3 angularVelocitySmoothed = tr.angularVelocitySmoothed; val2 = Quaternion.AngleAxis(Mathf.Clamp(((Vector3)(ref angularVelocitySmoothed)).magnitude / 2f, -120f, 120f), tr.angularVelocitySmoothed) * val2; val2 = ((Vector3)(ref val2)).normalized; Vector3 val3 = val * val2; val3 = ((Vector3)(ref val3)).normalized; float num = Vector3.Dot(val3, referenceLookDir); if (num < 0f) { val3 = ((!(Vector3.Dot(val3, referenceUpDir) < 0f)) ? (val3 + Vector3.Project(val3, referenceUpDir) * num) : (val3 - Vector3.Project(val3, referenceUpDir))); } float num2 = Vector3.Angle(referenceLookDir, val3); Vector3 val4 = Vector3.Cross(referenceLookDir, val3); if (num2 > 180f) { num2 -= 360f; } num2 *= rotationMultiplier; val3 = Quaternion.AngleAxis(num2, val4) * referenceLookDir; num2 = Vector3.Angle(referenceLookDir, val3); val4 = Vector3.Cross(referenceLookDir, val3); if (num2 > 180f) { num2 -= 360f; } num2 = Mathf.Clamp(num2, -80f, 80f); val3 = Quaternion.AngleAxis(num2, val4) * referenceLookDir; Vector3 val5 = referenceUpDir; Vector3.OrthoNormalize(ref val3, ref val5); lookDir = Vector3.Slerp(lookDir, val3, Time.deltaTime * 5f); upDir = Vector3.Slerp(upDir, val5, Time.deltaTime * 5f); Vector3.OrthoNormalize(ref lookDir, ref upDir); Quaternion val6 = rotation * Quaternion.LookRotation(lookDir, upDir) * Quaternion.Inverse(rotation * Quaternion.LookRotation(referenceLookDir, referenceUpDir)); Quaternion val7 = Quaternion.Slerp(Quaternion.identity, val6, 0.5f); neck.rotation = val7 * neck.rotation; head.rotation = val7 * head.rotation; } } } public class IK1JointAnalytic : IKSolver { public override void Solve(Transform[] bones, Vector3 target) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) Transform val = bones[0]; Transform val2 = bones[1]; Transform val3 = bones[2]; Vector3 val4 = Vector3.Cross(val3.position - val.position, Vector3.Cross(val3.position - val.position, val3.position - val2.position)); Vector3 val5 = val2.position - val.position; float magnitude = ((Vector3)(ref val5)).magnitude; Vector3 val6 = val3.position - val2.position; float magnitude2 = ((Vector3)(ref val6)).magnitude; Vector3 position = val.position; Vector3 val7 = findKnee(position, target, magnitude, magnitude2, val4); Quaternion val8 = Quaternion.FromToRotation(val2.position - val.position, val7 - position) * val.rotation; if (float.IsNaN(val8.x)) { Debug.LogWarning((object)string.Concat("hipRot=", val8, " pHip=", position, " pAnkle=", target, " fThighLength=", magnitude, " fShinLength=", magnitude2, " vKneeDir=", val4)); } else { val.rotation = val8; val2.rotation = Quaternion.FromToRotation(val3.position - val2.position, target - val7) * val2.rotation; } } public Vector3 findKnee(Vector3 pHip, Vector3 pAnkle, float fThigh, float fShin, Vector3 vKneeDir) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pAnkle - pHip; float num = ((Vector3)(ref val)).magnitude; float num2 = (fThigh + fShin) * 0.999f; if (num > num2) { pAnkle = pHip + ((Vector3)(ref val)).normalized * num2; val = pAnkle - pHip; num = num2; } float num3 = Mathf.Abs(fThigh - fShin) * 1.001f; if (num < num3) { pAnkle = pHip + ((Vector3)(ref val)).normalized * num3; val = pAnkle - pHip; num = num3; } float num4 = (num * num + fThigh * fThigh - fShin * fShin) / 2f / num; float num5 = Mathf.Sqrt(fThigh * fThigh - num4 * num4); Vector3 val2 = Vector3.Cross(val, Vector3.Cross(vKneeDir, val)); return pHip + num4 * ((Vector3)(ref val)).normalized + num5 * ((Vector3)(ref val2)).normalized; } } public class IKSimple : IKSolver { public int maxIterations = 100; public override void Solve(Transform[] bones, Vector3 target) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) Transform val = bones[^1]; Vector3[] array = (Vector3[])(object)new Vector3[bones.Length - 2]; float[] array2 = new float[bones.Length - 2]; Quaternion[] array3 = (Quaternion[])(object)new Quaternion[bones.Length - 2]; for (int i = 0; i < bones.Length - 2; i++) { ref Vector3 reference = ref array[i]; reference = Vector3.Cross(bones[i + 1].position - bones[i].position, bones[i + 2].position - bones[i + 1].position); ref Vector3 reference2 = ref array[i]; reference2 = Quaternion.Inverse(bones[i].rotation) * array[i]; ref Vector3 reference3 = ref array[i]; reference3 = ((Vector3)(ref array[i])).normalized; array2[i] = Vector3.Angle(bones[i + 1].position - bones[i].position, bones[i + 1].position - bones[i + 2].position); ref Quaternion reference4 = ref array3[i]; reference4 = bones[i + 1].localRotation; } float[] array4 = new float[bones.Length - 1]; float num = 0f; for (int j = 0; j < bones.Length - 1; j++) { int num2 = j; Vector3 val2 = bones[j + 1].position - bones[j].position; array4[num2] = ((Vector3)(ref val2)).magnitude; num += array4[j]; } positionAccuracy = num * 0.001f; Vector3 val3 = val.position - bones[0].position; float magnitude = ((Vector3)(ref val3)).magnitude; Vector3 val4 = target - bones[0].position; float magnitude2 = ((Vector3)(ref val4)).magnitude; bool flag = false; bool flag2 = false; float num3; float num4; if (magnitude2 > magnitude) { flag = true; num3 = 1f; num4 = 0f; } else { flag2 = true; num3 = 1f; num4 = 0f; } int num5 = 0; while (Mathf.Abs(magnitude - magnitude2) > positionAccuracy && num5 < maxIterations) { num5++; float num6 = (flag ? ((num4 + num3) / 2f) : num3); for (int k = 0; k < bones.Length - 2; k++) { float num7 = (flag2 ? (array2[k] * (1f - num6) + (array2[k] - 30f) * num6) : Mathf.Lerp(180f, array2[k], num6)); float num8 = array2[k] - num7; Quaternion val5 = Quaternion.AngleAxis(num8, array[k]); Quaternion localRotation = val5 * array3[k]; bones[k + 1].localRotation = localRotation; } Vector3 val6 = val.position - bones[0].position; magnitude = ((Vector3)(ref val6)).magnitude; if (magnitude2 > magnitude) { flag = true; } if (flag) { if (magnitude2 > magnitude) { num3 = num6; } else { num4 = num6; } if (num3 < 0.01f) { break; } } else { num4 = num3; num3 += 1f; } } bones[0].rotation = Quaternion.AngleAxis(Vector3.Angle(val.position - bones[0].position, target - bones[0].position), Vector3.Cross(val.position - bones[0].position, target - bones[0].position)) * bones[0].rotation; } } public abstract class IKSolver { public float positionAccuracy = 0.001f; public abstract void Solve(Transform[] bones, Vector3 target); } [Serializable] public abstract class IMotionAnalyzer { [HideInInspector] public string name; public AnimationClip animation; public MotionType motionType = MotionType.WalkCycle; public string motionGroup = "locomotion"; public abstract int samples { get; } public abstract LegCycleData[] cycles { get; } public abstract Vector3 cycleDirection { get; } public abstract float cycleDistance { get; } public abstract Vector3 cycleVector { get; } public abstract float cycleDuration { get; } public abstract float cycleSpeed { get; } public abstract Vector3 cycleVelocity { get; } public abstract float cycleOffset { get; set; } public abstract Vector3 GetFlightFootPosition(int leg, float flightTime, int phase); public abstract void Analyze(GameObject o); } [Serializable] public class Interpolator { public float[][] samples; public Interpolator(float[][] samplePoints) { samples = samplePoints; } public static float SqrMagnitude(float[] a) { float num = 0f; for (int i = 0; i < a.Length; i++) { num += Mathf.Pow(a[i], 2f); } return num; } public static float Magnitude(float[] a) { return Mathf.Sqrt(SqrMagnitude(a)); } public static float SqrDistance(float[] a, float[] b) { float num = 0f; for (int i = 0; i < a.Length; i++) { num += Mathf.Pow(a[i] - b[i], 2f); } return num; } public static float Distance(float[] a, float[] b) { return Mathf.Sqrt(SqrDistance(a, b)); } public static float[] Normalized(float[] a) { return Multiply(a, 1f / Magnitude(a)); } public static bool Equals(float[] a, float[] b) { return SqrDistance(a, b) == 0f; } public static float[] Multiply(float[] a, float m) { float[] array = new float[a.Length]; for (int i = 0; i < a.Length; i++) { array[i] = a[i] * m; } return array; } public static float Dot(float[] a, float[] b) { float num = 0f; for (int i = 0; i < a.Length; i++) { num += a[i] * b[i]; } return num; } public static float Angle(float[] a, float[] b) { float num = Magnitude(a) * Magnitude(b); if (num == 0f) { return 0f; } return Mathf.Acos(Mathf.Clamp(Dot(a, b) / num, -1f, 1f)); } public static float ClockwiseAngle(float[] a, float[] b) { float num = Angle(a, b); if (a[1] * b[0] - a[0] * b[1] > 0f) { num = (float)Math.PI * 2f - num; } return num; } public static float[] Add(float[] a, float[] b) { float[] array = new float[a.Length]; for (int i = 0; i < a.Length; i++) { array[i] = a[i] + b[i]; } return array; } public float[] Subtract(float[] a, float[] b) { return Add(a, Multiply(b, -1f)); } public virtual float[] Interpolate(float[] output) { return Interpolate(output, normalize: true); } public virtual float[] Interpolate(float[] output, bool normalize) { throw new NotImplementedException(); } public float[] BasicChecks(float[] output) { if (samples.Length == 1) { return new float[1] { 1f }; } for (int i = 0; i < samples.Length; i++) { if (Equals(output, samples[i])) { float[] array = new float[samples.Length]; array[i] = 1f; return array; } } return null; } } public enum LegCyclePhase { Stance, Lift, Flight, Land } public class LegState { public Vector3 stepFromPosition; public Vector3 stepToPosition; public Vector3 stepToPositionGoal; public Matrix4x4 stepFromMatrix; public Matrix4x4 stepToMatrix; public float stepFromTime; public float stepToTime; public int stepNr = 0; public float cycleTime = 1f; public float designatedCycleTimePrev = 0.9f; public Vector3 hipReference; public Vector3 ankleReference; public Vector3 footBase; public Quaternion footBaseRotation; public Vector3 ankle; public float stanceTime = 0f; public float liftTime = 0.1f; public float liftoffTime = 0.2f; public float postliftTime = 0.3f; public float prelandTime = 0.7f; public float strikeTime = 0.8f; public float landTime = 0.9f; public LegCyclePhase phase = LegCyclePhase.Stance; public bool parked; public Vector3 stancePosition; public Vector3 heelToetipVector; public List debugHistory = new List(); public float GetFootGrounding(float time) { if (time <= liftTime || time >= landTime) { return 0f; } if (time >= postliftTime && time <= prelandTime) { return 1f; } if (time < postliftTime) { return (time - liftTime) / (postliftTime - liftTime); } return 1f - (time - prelandTime) / (landTime - prelandTime); } } public class MotionGroupState { public AnimationState controller; public float weight; public AnimationState[] motionStates; public float[] relativeWeights; public float[] relativeWeightsBlended; public int primaryMotionIndex; } [RequireComponent(typeof(LegController))] [RequireComponent(typeof(AlignmentTracker))] public class LegAnimator : MonoBehaviour { public bool startAutomatically = true; public bool useIK = true; [Space] public float maxFootRotationAngle = 45f; public float maxIKAdjustmentDistance = 0.5f; public float minStepDistance = 0.2f; public float maxStepDuration = 1.5f; public float maxStepRotation = 160f; public float maxStepAcceleration = 5f; public float maxStepHeight = 1f; public float maxSlopeAngle = 60f; public bool enableLegParking = true; public float blendSmoothing = 0.2f; public LayerMask groundLayers = LayerMask.op_Implicit(1); public float groundHugX = 0f; public float groundHugZ = 0f; public float climbTiltAmount = 0.5f; public float climbTiltSensitivity = 0f; public float accelerateTiltAmount = 0.02f; public float accelerateTiltSensitivity = 0f; [Header("Debug")] public bool renderFootMarkers = false; public bool renderBlendingGraph = false; public bool renderCycleGraph = false; public bool renderAnimationStates = false; public Material vertexColorMaterial; private bool isActive; private float currentTime; private LegController legC; private AlignmentTracker tr; private LegInfo[] legs; private LegState[] legStates; private Vector3 position; private float speed; private float hSpeedSmoothed; private Vector3 objectVelocity; private Vector3 usedObjectVelocity; private Quaternion rotation; private Vector3 up; private Vector3 forward; private float scale; private Vector3 baseUpGround; private Vector3 bodyUp; private Vector3 legsUp; private float accelerationTiltX; private float accelerationTiltZ; private AnimationState controlMotionState; private MotionGroupState[] motionGroupStates; private AnimationState[] nonGroupMotionStates; private float[] nonGroupMotionWeights; private AnimationState[] motionStates; private AnimationState[] cycleMotionStates; private float[] motionWeights; private float[] cycleMotionWeights; private float summedMotionWeight; private float summedCycleMotionWeight; private float locomotionWeight; private float cycleDuration; private float cycleDistance; private float normalizedTime; private bool updateStates = true; [NonSerialized] public GameObject ghost; private Dictionary trajectories = new Dictionary(); [Conditional("VISUALIZE")] private void AddTrajectoryPoint(string name, Vector3 point) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) trajectories[name].AddPoint(Time.time, point); } [Conditional("DEBUG")] private void Assert(bool condition, string text) { if (!condition) { Debug.LogError((object)text); } } [Conditional("DEBUG")] private void AssertSane(float f, string text) { if (!Util.IsSaneNumber(f)) { Debug.LogError((object)(text + "=" + f)); } } [Conditional("DEBUG")] private void AssertSane(Vector3 vect, string text) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!Util.IsSaneNumber(vect.x) || !Util.IsSaneNumber(vect.y) || !Util.IsSaneNumber(vect.z)) { Debug.LogError((object)(text + "=" + vect)); } } [Conditional("DEBUG")] private void AssertSane(Quaternion q, string text) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (!Util.IsSaneNumber(q.x) || !Util.IsSaneNumber(q.y) || !Util.IsSaneNumber(q.z) || !Util.IsSaneNumber(q.w)) { Debug.LogError((object)(text + "=" + q)); } } private void Start() { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) tr = ((Component)this).GetComponent(typeof(AlignmentTracker)) as AlignmentTracker; legC = ((Component)this).GetComponent(typeof(LegController)) as LegController; legs = legC.legs; if (!legC.initialized) { Debug.LogError((object)(((Object)this).name + ": Locomotion System has not been initialized."), (Object)(object)this); ((Behaviour)this).enabled = false; } legStates = new LegState[legs.Length]; updateStates = true; ResetMotionStates(); ResetSteps(); isActive = false; for (int i = 0; i < legs.Length; i++) { trajectories.Add("leg" + i + "heel", new TrajectoryVisualizer(legs[i].debugColor, 3f)); trajectories.Add("leg" + i + "toetip", new TrajectoryVisualizer(legs[i].debugColor, 3f)); trajectories.Add("leg" + i + "footbase", new TrajectoryVisualizer(legs[i].debugColor, 3f)); } } private void OnEnable() { updateStates = true; if (!((Object)(object)legC == (Object)null)) { ResetMotionStates(); ResetSteps(); if (!legC.initialized) { Debug.LogError((object)(((Object)this).name + ": Locomotion System has not been initialized."), (Object)(object)this); ((Behaviour)this).enabled = false; } } } private void ResetMotionStates() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Expected O, but got Unknown motionStates = (AnimationState[])(object)new AnimationState[legC.motions.Length]; cycleMotionStates = (AnimationState[])(object)new AnimationState[legC.cycleMotions.Length]; motionWeights = new float[legC.motions.Length]; cycleMotionWeights = new float[legC.cycleMotions.Length]; nonGroupMotionWeights = new float[legC.nonGroupMotions.Length]; controlMotionState = ((Component)this).GetComponent()["LocomotionSystem"]; if ((TrackedReference)(object)controlMotionState == (TrackedReference)null) { AnimationClip val = new AnimationClip(); val.legacy = true; ((Component)this).GetComponent().AddClip(val, "LocomotionSystem"); controlMotionState = ((Component)this).GetComponent()["LocomotionSystem"]; } controlMotionState.enabled = true; controlMotionState.wrapMode = (WrapMode)2; controlMotionState.weight = 1f; controlMotionState.layer = 10000; motionGroupStates = new MotionGroupState[legC.motionGroups.Length]; int num = 0; for (int i = 0; i < legC.motions.Length; i++) { motionStates[i] = ((Component)this).GetComponent()[legC.motions[i].name]; if ((TrackedReference)(object)motionStates[i] == (TrackedReference)null) { ((Component)this).GetComponent().AddClip(legC.motions[i].animation, legC.motions[i].name); motionStates[i] = ((Component)this).GetComponent()[legC.motions[i].name]; } motionStates[i].wrapMode = (WrapMode)2; if (legC.motions[i].motionType == MotionType.WalkCycle) { cycleMotionStates[num] = motionStates[i]; cycleMotionStates[num].speed = 0f; num++; } } for (int j = 0; j < motionGroupStates.Length; j++) { AnimationState val2 = ((Component)this).GetComponent()[legC.motionGroups[j].name]; if ((TrackedReference)(object)val2 == (TrackedReference)null) { AnimationClip val3 = new AnimationClip(); val3.legacy = true; ((Component)this).GetComponent().AddClip(val3, legC.motionGroups[j].name); val2 = ((Component)this).GetComponent()[legC.motionGroups[j].name]; } val2.enabled = true; val2.wrapMode = (WrapMode)2; if (startAutomatically && j == 0) { val2.weight = 1f; } motionGroupStates[j] = new MotionGroupState(); motionGroupStates[j].controller = val2; motionGroupStates[j].motionStates = (AnimationState[])(object)new AnimationState[legC.motionGroups[j].motions.Length]; motionGroupStates[j].relativeWeights = new float[legC.motionGroups[j].motions.Length]; for (int k = 0; k < motionGroupStates[j].motionStates.Length; k++) { motionGroupStates[j].motionStates[k] = ((Component)this).GetComponent()[legC.motionGroups[j].motions[k].name]; } motionGroupStates[j].primaryMotionIndex = 0; } nonGroupMotionStates = (AnimationState[])(object)new AnimationState[legC.nonGroupMotions.Length]; for (int l = 0; l < legC.nonGroupMotions.Length; l++) { nonGroupMotionStates[l] = ((Component)this).GetComponent()[legC.nonGroupMotions[l].name]; if ((TrackedReference)(object)nonGroupMotionStates[l] == (TrackedReference)null) { ((Component)this).GetComponent().AddClip(legC.nonGroupMotions[l].animation, legC.nonGroupMotions[l].name); nonGroupMotionStates[l] = ((Component)this).GetComponent()[legC.nonGroupMotions[l].name]; nonGroupMotionWeights[l] = nonGroupMotionStates[l].weight; } } for (int m = 0; m < legs.Length; m++) { legStates[m] = new LegState(); } } private void ResetSteps() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) up = ((Component)this).transform.up; forward = ((Component)this).transform.forward; baseUpGround = up; legsUp = up; accelerationTiltX = 0f; accelerationTiltZ = 0f; bodyUp = up; tr.Reset(); for (int i = 0; i < legs.Length; i++) { legStates[i].stepFromTime = Time.time - 0.01f; legStates[i].stepToTime = Time.time; legStates[i].stepFromMatrix = FindGroundedBase(((Component)this).transform.TransformPoint(legStates[i].stancePosition / scale), ((Component)this).transform.rotation, legStates[i].heelToetipVector, avoidLedges: false); legStates[i].stepFromPosition = Vector4.op_Implicit(((Matrix4x4)(ref legStates[i].stepFromMatrix)).GetColumn(3)); legStates[i].stepToPosition = legStates[i].stepFromPosition; legStates[i].stepToMatrix = legStates[i].stepFromMatrix; } normalizedTime = 0f; cycleDuration = maxStepDuration; cycleDistance = 0f; } private void Update() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07ec: Unknown result type (might be due to invalid IL or missing references) //IL_07f1: Unknown result type (might be due to invalid IL or missing references) //IL_0d2f: Unknown result type (might be due to invalid IL or missing references) //IL_0d3a: Unknown result type (might be due to invalid IL or missing references) //IL_0d3f: Unknown result type (might be due to invalid IL or missing references) //IL_0d45: Unknown result type (might be due to invalid IL or missing references) //IL_0d4a: Unknown result type (might be due to invalid IL or missing references) //IL_0d4f: Unknown result type (might be due to invalid IL or missing references) //IL_0d80: Unknown result type (might be due to invalid IL or missing references) //IL_0d86: Unknown result type (might be due to invalid IL or missing references) //IL_0d8b: Unknown result type (might be due to invalid IL or missing references) //IL_0d90: Unknown result type (might be due to invalid IL or missing references) //IL_0850: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Unknown result type (might be due to invalid IL or missing references) //IL_086a: Unknown result type (might be due to invalid IL or missing references) //IL_0871: Unknown result type (might be due to invalid IL or missing references) //IL_0876: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Unknown result type (might be due to invalid IL or missing references) //IL_0899: Unknown result type (might be due to invalid IL or missing references) //IL_08a4: Unknown result type (might be due to invalid IL or missing references) //IL_08ab: Unknown result type (might be due to invalid IL or missing references) //IL_08b0: Unknown result type (might be due to invalid IL or missing references) //IL_08b5: Unknown result type (might be due to invalid IL or missing references) //IL_0aff: Unknown result type (might be due to invalid IL or missing references) //IL_0b04: Unknown result type (might be due to invalid IL or missing references) //IL_0b37: Unknown result type (might be due to invalid IL or missing references) //IL_0b79: Unknown result type (might be due to invalid IL or missing references) //IL_0b80: Unknown result type (might be due to invalid IL or missing references) //IL_0b85: Unknown result type (might be due to invalid IL or missing references) //IL_0b8a: Unknown result type (might be due to invalid IL or missing references) if (Time.deltaTime == 0f || Time.timeScale == 0f) { return; } scale = ((Component)this).transform.lossyScale.z; AssertSane(tr.velocity, "tr.velocity"); AssertSane(up, "up"); Vector3 val = Util.ProjectOntoPlane(tr.velocity, up); speed = ((Vector3)(ref val)).magnitude; val += up * Mathf.Clamp(Vector3.Dot(tr.velocity, up), 0f - speed, speed); speed = ((Vector3)(ref val)).magnitude; Vector3 val2 = Util.ProjectOntoPlane(tr.velocitySmoothed, up); hSpeedSmoothed = ((Vector3)(ref val2)).magnitude; objectVelocity = ((Component)this).transform.InverseTransformPoint(tr.velocitySmoothed) - ((Component)this).transform.InverseTransformPoint(Vector3.zero); bool flag = false; Vector3 val3 = objectVelocity - usedObjectVelocity; if (((Vector3)(ref val3)).magnitude > 0.002f * Mathf.Min(((Vector3)(ref objectVelocity)).magnitude, ((Vector3)(ref usedObjectVelocity)).magnitude) || updateStates) { flag = true; usedObjectVelocity = objectVelocity; } bool flag2 = false; float num = 0.001f; for (int i = 0; i < legC.motionGroups.Length; i++) { MotionGroupState motionGroupState = motionGroupStates[i]; bool flag3 = false; bool flag4 = false; float num2 = motionGroupState.controller.weight; AssertSane(num2, "newGroupWeight"); if (!motionGroupState.controller.enabled || num2 < num) { num2 = 0f; } else if (num2 > 1f - num) { num2 = 1f; } if (Mathf.Abs(num2 - motionGroupState.weight) > num) { flag3 = true; flag2 = true; if (motionGroupState.weight == 0f && num2 > 0f) { flag4 = true; } motionGroupState.weight = num2; } else if (Mathf.Abs(motionGroupState.motionStates[motionGroupState.primaryMotionIndex].weight - motionGroupState.relativeWeights[motionGroupState.primaryMotionIndex] * motionGroupState.weight) > num || motionGroupState.motionStates[motionGroupState.primaryMotionIndex].layer != motionGroupState.controller.layer) { flag3 = true; } if ((flag || flag3) && (flag || flag4) && motionGroupState.weight > 0f) { flag2 = true; MotionGroupInfo motionGroupInfo = legC.motionGroups[i]; motionGroupState.relativeWeights = motionGroupInfo.GetMotionWeights(new Vector3(objectVelocity.x, 0f, objectVelocity.z)); } if (motionGroupState.weight > 0f) { if (motionGroupState.relativeWeightsBlended == null) { motionGroupState.relativeWeightsBlended = new float[motionGroupState.relativeWeights.Length]; for (int j = 0; j < motionGroupState.motionStates.Length; j++) { motionGroupState.relativeWeightsBlended[j] = motionGroupState.relativeWeights[j]; } } float num3 = 0f; int layer = motionGroupState.controller.layer; for (int k = 0; k < motionGroupState.motionStates.Length; k++) { if (blendSmoothing > 0f) { motionGroupState.relativeWeightsBlended[k] = Mathf.Lerp(motionGroupState.relativeWeightsBlended[k], motionGroupState.relativeWeights[k], Time.deltaTime / blendSmoothing); } else { motionGroupState.relativeWeightsBlended[k] = motionGroupState.relativeWeights[k]; } AssertSane(motionGroupState.relativeWeights[k], "group.relativeWeights[m]"); AssertSane(motionGroupState.relativeWeightsBlended[k], "group.relativeWeightsBlended[m]"); AssertSane(Time.deltaTime / blendSmoothing, "Time.deltaTime / blendSmoothing ( " + Time.deltaTime + " / " + blendSmoothing + " )"); float num4 = motionGroupState.relativeWeightsBlended[k] * motionGroupState.weight; motionGroupState.motionStates[k].weight = num4; if (num4 > 0f) { motionGroupState.motionStates[k].enabled = true; } else { motionGroupState.motionStates[k].enabled = false; } motionGroupState.motionStates[k].layer = layer; if (num4 > num3) { motionGroupState.primaryMotionIndex = k; num3 = num4; } } } else { for (int l = 0; l < motionGroupState.motionStates.Length; l++) { motionGroupState.motionStates[l].weight = 0f; motionGroupState.motionStates[l].enabled = false; } motionGroupState.relativeWeightsBlended = null; } } for (int m = 0; m < nonGroupMotionStates.Length; m++) { float num5 = nonGroupMotionStates[m].weight; if (!nonGroupMotionStates[m].enabled) { num5 = 0f; } if (Mathf.Abs(num5 - nonGroupMotionWeights[m]) > num || (num5 == 0f && nonGroupMotionWeights[m] != 0f)) { flag2 = true; nonGroupMotionWeights[m] = num5; } } bool flag5 = updateStates; if (flag2 || updateStates) { summedMotionWeight = 0f; summedCycleMotionWeight = 0f; int num6 = 0; for (int n = 0; n < legC.motions.Length; n++) { motionWeights[n] = motionStates[n].weight; summedMotionWeight += motionWeights[n]; if (legC.motions[n].motionType == MotionType.WalkCycle) { cycleMotionWeights[num6] = motionWeights[n]; summedCycleMotionWeight += motionWeights[n]; num6++; } } if (summedMotionWeight == 0f) { isActive = false; if ((Object)(object)ghost != (Object)null) { GhostOriginal ghostOriginal = ghost.GetComponent(typeof(GhostOriginal)) as GhostOriginal; ghostOriginal.Synch(); } return; } if (!isActive) { flag5 = true; } isActive = true; for (int num7 = 0; num7 < legC.motions.Length; num7++) { motionWeights[num7] /= summedMotionWeight; } if (summedCycleMotionWeight > 0f) { for (int num8 = 0; num8 < legC.cycleMotions.Length; num8++) { cycleMotionWeights[num8] /= summedCycleMotionWeight; } } for (int num9 = 0; num9 < legs.Length; num9++) { legStates[num9].stancePosition = Vector3.zero; legStates[num9].heelToetipVector = Vector3.zero; } for (int num10 = 0; num10 < legC.motions.Length; num10++) { IMotionAnalyzer motionAnalyzer = legC.motions[num10]; float num11 = motionWeights[num10]; if (num11 > 0f) { for (int num12 = 0; num12 < legs.Length; num12++) { LegState obj = legStates[num12]; obj.stancePosition += motionAnalyzer.cycles[num12].stancePosition * scale * num11; LegState obj2 = legStates[num12]; obj2.heelToetipVector += motionAnalyzer.cycles[num12].heelToetipVector * scale * num11; } } } if (summedCycleMotionWeight > 0f) { for (int num13 = 0; num13 < legs.Length; num13++) { legStates[num13].liftTime = 0f; legStates[num13].liftoffTime = 0f; legStates[num13].postliftTime = 0f; legStates[num13].prelandTime = 0f; legStates[num13].strikeTime = 0f; legStates[num13].landTime = 0f; } for (int num14 = 0; num14 < legC.cycleMotions.Length; num14++) { IMotionAnalyzer motionAnalyzer2 = legC.cycleMotions[num14]; float num15 = cycleMotionWeights[num14]; if (num15 > 0f) { for (int num16 = 0; num16 < legs.Length; num16++) { legStates[num16].liftTime += motionAnalyzer2.cycles[num16].liftTime * num15; legStates[num16].liftoffTime += motionAnalyzer2.cycles[num16].liftoffTime * num15; legStates[num16].postliftTime += motionAnalyzer2.cycles[num16].postliftTime * num15; legStates[num16].prelandTime += motionAnalyzer2.cycles[num16].prelandTime * num15; legStates[num16].strikeTime += motionAnalyzer2.cycles[num16].strikeTime * num15; legStates[num16].landTime += motionAnalyzer2.cycles[num16].landTime * num15; } } } } if (summedCycleMotionWeight > 0f) { for (int num17 = 0; num17 < legs.Length; num17++) { Vector2 val4 = Vector2.zero; for (int num18 = 0; num18 < legC.cycleMotions.Length; num18++) { IMotionAnalyzer motionAnalyzer3 = legC.cycleMotions[num18]; float num19 = cycleMotionWeights[num18]; if (num19 > 0f) { val4 += new Vector2(Mathf.Cos(motionAnalyzer3.cycles[num17].stanceTime * 2f * (float)Math.PI), Mathf.Sin(motionAnalyzer3.cycles[num17].stanceTime * 2f * (float)Math.PI)) * num19; } } legStates[num17].stanceTime = Util.Mod(Mathf.Atan2(val4.y, val4.x) / 2f / (float)Math.PI); } } } float num20 = controlMotionState.weight; if (!controlMotionState.enabled) { num20 = 0f; } locomotionWeight = Mathf.Clamp01(summedMotionWeight * num20); if (updateStates || flag5) { ResetSteps(); } float num21 = 0f; float num22 = 0f; for (int num23 = 0; num23 < legC.motions.Length; num23++) { IMotionAnalyzer motionAnalyzer4 = legC.motions[num23]; float num24 = motionWeights[num23]; if (num24 > 0f) { if (motionAnalyzer4.motionType == MotionType.WalkCycle) { num21 += 1f / motionAnalyzer4.cycleDuration * num24; } num22 += motionAnalyzer4.cycleSpeed * num24; } } float num25 = maxStepDuration; if (num21 > 0f) { num25 = 1f / num21; } float num26 = 1f; if (speed != 0f) { num26 = num22 * scale / speed; } if (num26 > 0f) { num25 *= num26; } Vector3 val5 = Vector3.Project(tr.rotation * tr.angularVelocitySmoothed, up); float magnitude = ((Vector3)(ref val5)).magnitude; if (magnitude > 0f) { num25 = Mathf.Min(maxStepRotation / magnitude, num25); } Vector3 val6 = Util.ProjectOntoPlane(tr.accelerationSmoothed, up); float magnitude2 = ((Vector3)(ref val6)).magnitude; if (magnitude2 > 0f) { num25 = Mathf.Clamp(maxStepAcceleration / magnitude2, num25 / 2f, num25); } num25 = Mathf.Min(num25, maxStepDuration); cycleDuration = num25; AssertSane(cycleDuration, "cycleDuration"); AssertSane(speed, "speed"); cycleDistance = cycleDuration * speed; bool flag6 = false; if (enableLegParking) { flag6 = true; for (int num27 = 0; num27 < legs.Length; num27++) { if (!legStates[num27].parked) { flag6 = false; } } } if (!flag6) { normalizedTime = Util.Mod(normalizedTime + 1f / cycleDuration * Time.deltaTime); for (int num28 = 0; num28 < legC.cycleMotions.Length; num28++) { if ((object)legC.cycleMotions[num28].GetType() == typeof(MotionAnalyzerBackwards)) { cycleMotionStates[num28].normalizedTime = 1f - (normalizedTime - legC.cycleMotions[num28].cycleOffset); } else { cycleMotionStates[num28].normalizedTime = normalizedTime - legC.cycleMotions[num28].cycleOffset; } } } updateStates = false; currentTime = Time.time; if ((Object)(object)ghost != (Object)null) { GhostOriginal ghostOriginal2 = ghost.GetComponent(typeof(GhostOriginal)) as GhostOriginal; ghostOriginal2.Synch(); } } private void FixedUpdate() { if (Time.deltaTime != 0f && Time.timeScale != 0f) { tr.ControlledFixedUpdate(); } } private void LateUpdate() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0874: Unknown result type (might be due to invalid IL or missing references) //IL_0879: Unknown result type (might be due to invalid IL or missing references) //IL_0884: Unknown result type (might be due to invalid IL or missing references) //IL_0889: Unknown result type (might be due to invalid IL or missing references) //IL_088e: Unknown result type (might be due to invalid IL or missing references) //IL_08d6: Unknown result type (might be due to invalid IL or missing references) //IL_08db: Unknown result type (might be due to invalid IL or missing references) //IL_08dd: Unknown result type (might be due to invalid IL or missing references) //IL_08e2: Unknown result type (might be due to invalid IL or missing references) //IL_08e4: Unknown result type (might be due to invalid IL or missing references) //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_08af: Unknown result type (might be due to invalid IL or missing references) //IL_08b4: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_0991: Unknown result type (might be due to invalid IL or missing references) //IL_0996: Unknown result type (might be due to invalid IL or missing references) //IL_099b: Unknown result type (might be due to invalid IL or missing references) //IL_09a6: Unknown result type (might be due to invalid IL or missing references) //IL_09ab: Unknown result type (might be due to invalid IL or missing references) //IL_09d4: Unknown result type (might be due to invalid IL or missing references) //IL_09fb: Unknown result type (might be due to invalid IL or missing references) //IL_0a14: Unknown result type (might be due to invalid IL or missing references) //IL_0a32: Unknown result type (might be due to invalid IL or missing references) //IL_0a34: Unknown result type (might be due to invalid IL or missing references) //IL_0a52: Unknown result type (might be due to invalid IL or missing references) //IL_0a54: Unknown result type (might be due to invalid IL or missing references) //IL_0a75: Unknown result type (might be due to invalid IL or missing references) //IL_0a88: Unknown result type (might be due to invalid IL or missing references) //IL_0a8a: Unknown result type (might be due to invalid IL or missing references) //IL_0a95: Unknown result type (might be due to invalid IL or missing references) //IL_0aa8: Unknown result type (might be due to invalid IL or missing references) //IL_0aad: Unknown result type (might be due to invalid IL or missing references) //IL_0aba: Unknown result type (might be due to invalid IL or missing references) //IL_0ac8: Unknown result type (might be due to invalid IL or missing references) //IL_0adb: Unknown result type (might be due to invalid IL or missing references) //IL_0add: Unknown result type (might be due to invalid IL or missing references) //IL_0ae8: Unknown result type (might be due to invalid IL or missing references) //IL_0b01: Unknown result type (might be due to invalid IL or missing references) //IL_0b06: Unknown result type (might be due to invalid IL or missing references) //IL_0b0d: Unknown result type (might be due to invalid IL or missing references) //IL_0b12: Unknown result type (might be due to invalid IL or missing references) //IL_0b17: Unknown result type (might be due to invalid IL or missing references) //IL_0b26: Unknown result type (might be due to invalid IL or missing references) //IL_0d21: Unknown result type (might be due to invalid IL or missing references) //IL_0d2c: Unknown result type (might be due to invalid IL or missing references) //IL_0d31: Unknown result type (might be due to invalid IL or missing references) //IL_0d33: Unknown result type (might be due to invalid IL or missing references) //IL_0d37: Unknown result type (might be due to invalid IL or missing references) //IL_0d3c: Unknown result type (might be due to invalid IL or missing references) //IL_0bbf: Unknown result type (might be due to invalid IL or missing references) //IL_0bf1: Unknown result type (might be due to invalid IL or missing references) //IL_0c11: Unknown result type (might be due to invalid IL or missing references) //IL_0c36: Unknown result type (might be due to invalid IL or missing references) //IL_0c38: Unknown result type (might be due to invalid IL or missing references) //IL_0c5d: Unknown result type (might be due to invalid IL or missing references) //IL_0c5f: Unknown result type (might be due to invalid IL or missing references) //IL_0d72: Unknown result type (might be due to invalid IL or missing references) //IL_0d77: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0c75: Unknown result type (might be due to invalid IL or missing references) //IL_0c80: Unknown result type (might be due to invalid IL or missing references) //IL_0c85: Unknown result type (might be due to invalid IL or missing references) //IL_0c87: Unknown result type (might be due to invalid IL or missing references) //IL_0c94: Unknown result type (might be due to invalid IL or missing references) //IL_0c99: Unknown result type (might be due to invalid IL or missing references) //IL_0c9e: Unknown result type (might be due to invalid IL or missing references) //IL_0ca0: Unknown result type (might be due to invalid IL or missing references) //IL_0cab: Unknown result type (might be due to invalid IL or missing references) //IL_0cb0: Unknown result type (might be due to invalid IL or missing references) //IL_0cb5: Unknown result type (might be due to invalid IL or missing references) //IL_0cb7: Unknown result type (might be due to invalid IL or missing references) //IL_0cc2: Unknown result type (might be due to invalid IL or missing references) //IL_0cd0: Unknown result type (might be due to invalid IL or missing references) //IL_0cd5: Unknown result type (might be due to invalid IL or missing references) //IL_0ce8: Unknown result type (might be due to invalid IL or missing references) //IL_0ced: Unknown result type (might be due to invalid IL or missing references) //IL_0cf2: Unknown result type (might be due to invalid IL or missing references) //IL_0d7a: Unknown result type (might be due to invalid IL or missing references) //IL_0d86: Unknown result type (might be due to invalid IL or missing references) //IL_0d89: Unknown result type (might be due to invalid IL or missing references) //IL_0d99: Unknown result type (might be due to invalid IL or missing references) //IL_0d9e: Unknown result type (might be due to invalid IL or missing references) //IL_0da3: Unknown result type (might be due to invalid IL or missing references) //IL_0da6: Unknown result type (might be due to invalid IL or missing references) //IL_0dab: Unknown result type (might be due to invalid IL or missing references) //IL_0762: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_077a: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Unknown result type (might be due to invalid IL or missing references) //IL_0784: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0dcf: Unknown result type (might be due to invalid IL or missing references) //IL_0dd9: Unknown result type (might be due to invalid IL or missing references) //IL_0dde: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07c2: Unknown result type (might be due to invalid IL or missing references) //IL_07c7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_0f0b: Unknown result type (might be due to invalid IL or missing references) //IL_0f10: Unknown result type (might be due to invalid IL or missing references) //IL_0f12: Unknown result type (might be due to invalid IL or missing references) //IL_0f14: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e2: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0df2: Unknown result type (might be due to invalid IL or missing references) //IL_0df7: Unknown result type (might be due to invalid IL or missing references) //IL_0df9: Unknown result type (might be due to invalid IL or missing references) //IL_0dfe: Unknown result type (might be due to invalid IL or missing references) //IL_0e00: Unknown result type (might be due to invalid IL or missing references) //IL_0e02: Unknown result type (might be due to invalid IL or missing references) //IL_0e05: Unknown result type (might be due to invalid IL or missing references) //IL_0e0a: Unknown result type (might be due to invalid IL or missing references) //IL_0e0f: Unknown result type (might be due to invalid IL or missing references) //IL_0e11: Unknown result type (might be due to invalid IL or missing references) //IL_0e16: Unknown result type (might be due to invalid IL or missing references) //IL_0e1b: Unknown result type (might be due to invalid IL or missing references) //IL_0e26: Unknown result type (might be due to invalid IL or missing references) //IL_0e2b: Unknown result type (might be due to invalid IL or missing references) //IL_0e48: Unknown result type (might be due to invalid IL or missing references) //IL_0e4b: Unknown result type (might be due to invalid IL or missing references) //IL_0f39: Unknown result type (might be due to invalid IL or missing references) //IL_0f3b: Unknown result type (might be due to invalid IL or missing references) //IL_0f3e: Unknown result type (might be due to invalid IL or missing references) //IL_0f48: Unknown result type (might be due to invalid IL or missing references) //IL_0f4d: Unknown result type (might be due to invalid IL or missing references) //IL_0f4f: Unknown result type (might be due to invalid IL or missing references) //IL_0f54: Unknown result type (might be due to invalid IL or missing references) //IL_0f23: Unknown result type (might be due to invalid IL or missing references) //IL_0f26: Unknown result type (might be due to invalid IL or missing references) //IL_0f2b: Unknown result type (might be due to invalid IL or missing references) //IL_0f2d: Unknown result type (might be due to invalid IL or missing references) //IL_0f32: Unknown result type (might be due to invalid IL or missing references) //IL_0f37: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_0e64: Unknown result type (might be due to invalid IL or missing references) //IL_0e68: Unknown result type (might be due to invalid IL or missing references) //IL_0e6d: Unknown result type (might be due to invalid IL or missing references) //IL_0e70: Unknown result type (might be due to invalid IL or missing references) //IL_0e7d: Unknown result type (might be due to invalid IL or missing references) //IL_0e7f: Unknown result type (might be due to invalid IL or missing references) //IL_1064: Unknown result type (might be due to invalid IL or missing references) //IL_1069: Unknown result type (might be due to invalid IL or missing references) //IL_0f74: Unknown result type (might be due to invalid IL or missing references) //IL_0f7f: Unknown result type (might be due to invalid IL or missing references) //IL_0f8a: Unknown result type (might be due to invalid IL or missing references) //IL_0f8f: Unknown result type (might be due to invalid IL or missing references) //IL_0faa: Unknown result type (might be due to invalid IL or missing references) //IL_0fb5: Unknown result type (might be due to invalid IL or missing references) //IL_0fc0: Unknown result type (might be due to invalid IL or missing references) //IL_0fc6: Unknown result type (might be due to invalid IL or missing references) //IL_1021: Unknown result type (might be due to invalid IL or missing references) //IL_1022: Unknown result type (might be due to invalid IL or missing references) //IL_102e: Unknown result type (might be due to invalid IL or missing references) //IL_1033: Unknown result type (might be due to invalid IL or missing references) //IL_1038: Unknown result type (might be due to invalid IL or missing references) //IL_105c: Unknown result type (might be due to invalid IL or missing references) //IL_1061: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0ebb: Unknown result type (might be due to invalid IL or missing references) //IL_0ec7: Unknown result type (might be due to invalid IL or missing references) //IL_0ecc: Unknown result type (might be due to invalid IL or missing references) //IL_0ecd: Unknown result type (might be due to invalid IL or missing references) //IL_0ed2: Unknown result type (might be due to invalid IL or missing references) //IL_0ed7: Unknown result type (might be due to invalid IL or missing references) //IL_0ee3: Unknown result type (might be due to invalid IL or missing references) //IL_0ee9: Unknown result type (might be due to invalid IL or missing references) //IL_0eee: Unknown result type (might be due to invalid IL or missing references) //IL_0ef3: Unknown result type (might be due to invalid IL or missing references) //IL_0ef8: Unknown result type (might be due to invalid IL or missing references) //IL_0efd: Unknown result type (might be due to invalid IL or missing references) //IL_0f01: Unknown result type (might be due to invalid IL or missing references) //IL_0f06: Unknown result type (might be due to invalid IL or missing references) //IL_10f3: Unknown result type (might be due to invalid IL or missing references) //IL_10f5: Unknown result type (might be due to invalid IL or missing references) //IL_10f7: Unknown result type (might be due to invalid IL or missing references) //IL_10fc: Unknown result type (might be due to invalid IL or missing references) //IL_10fe: Unknown result type (might be due to invalid IL or missing references) //IL_1103: Unknown result type (might be due to invalid IL or missing references) //IL_1107: Unknown result type (might be due to invalid IL or missing references) //IL_110c: Unknown result type (might be due to invalid IL or missing references) //IL_1112: Unknown result type (might be due to invalid IL or missing references) //IL_1118: Unknown result type (might be due to invalid IL or missing references) //IL_1123: Unknown result type (might be due to invalid IL or missing references) //IL_1129: Unknown result type (might be due to invalid IL or missing references) //IL_112e: Unknown result type (might be due to invalid IL or missing references) //IL_1133: Unknown result type (might be due to invalid IL or missing references) //IL_1138: Unknown result type (might be due to invalid IL or missing references) //IL_113c: Unknown result type (might be due to invalid IL or missing references) //IL_1141: Unknown result type (might be due to invalid IL or missing references) //IL_1143: Unknown result type (might be due to invalid IL or missing references) //IL_1148: Unknown result type (might be due to invalid IL or missing references) //IL_114c: Unknown result type (might be due to invalid IL or missing references) //IL_1151: Unknown result type (might be due to invalid IL or missing references) //IL_1157: Unknown result type (might be due to invalid IL or missing references) //IL_115d: Unknown result type (might be due to invalid IL or missing references) //IL_1168: Unknown result type (might be due to invalid IL or missing references) //IL_116e: Unknown result type (might be due to invalid IL or missing references) //IL_1173: Unknown result type (might be due to invalid IL or missing references) //IL_1178: Unknown result type (might be due to invalid IL or missing references) //IL_117d: Unknown result type (might be due to invalid IL or missing references) //IL_1083: Unknown result type (might be due to invalid IL or missing references) //IL_1085: Unknown result type (might be due to invalid IL or missing references) //IL_1086: Unknown result type (might be due to invalid IL or missing references) //IL_1097: Unknown result type (might be due to invalid IL or missing references) //IL_109c: Unknown result type (might be due to invalid IL or missing references) //IL_109f: Unknown result type (might be due to invalid IL or missing references) //IL_10a4: Unknown result type (might be due to invalid IL or missing references) //IL_10b5: Unknown result type (might be due to invalid IL or missing references) //IL_10ba: Unknown result type (might be due to invalid IL or missing references) //IL_10c6: Unknown result type (might be due to invalid IL or missing references) //IL_10ea: Unknown result type (might be due to invalid IL or missing references) //IL_10ef: Unknown result type (might be due to invalid IL or missing references) //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Unknown result type (might be due to invalid IL or missing references) //IL_0726: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_0eac: Unknown result type (might be due to invalid IL or missing references) //IL_0eb1: Unknown result type (might be due to invalid IL or missing references) //IL_06d8: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06f2: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Unknown result type (might be due to invalid IL or missing references) //IL_06fe: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_070f: Unknown result type (might be due to invalid IL or missing references) //IL_12a0: Unknown result type (might be due to invalid IL or missing references) //IL_12a5: Unknown result type (might be due to invalid IL or missing references) //IL_187d: Unknown result type (might be due to invalid IL or missing references) //IL_1899: Unknown result type (might be due to invalid IL or missing references) //IL_18a7: Unknown result type (might be due to invalid IL or missing references) //IL_18b5: Unknown result type (might be due to invalid IL or missing references) //IL_18ba: Unknown result type (might be due to invalid IL or missing references) //IL_18bf: Unknown result type (might be due to invalid IL or missing references) //IL_18db: Unknown result type (might be due to invalid IL or missing references) //IL_18e0: Unknown result type (might be due to invalid IL or missing references) //IL_18e5: Unknown result type (might be due to invalid IL or missing references) //IL_18ea: Unknown result type (might be due to invalid IL or missing references) //IL_18ed: Unknown result type (might be due to invalid IL or missing references) //IL_19b6: Unknown result type (might be due to invalid IL or missing references) //IL_19c1: Unknown result type (might be due to invalid IL or missing references) //IL_19c6: Unknown result type (might be due to invalid IL or missing references) //IL_19cb: Unknown result type (might be due to invalid IL or missing references) //IL_19d0: Unknown result type (might be due to invalid IL or missing references) //IL_19d2: Unknown result type (might be due to invalid IL or missing references) //IL_19e7: Unknown result type (might be due to invalid IL or missing references) //IL_19ec: Unknown result type (might be due to invalid IL or missing references) //IL_196a: Unknown result type (might be due to invalid IL or missing references) //IL_1975: Unknown result type (might be due to invalid IL or missing references) //IL_1980: Unknown result type (might be due to invalid IL or missing references) //IL_1985: Unknown result type (might be due to invalid IL or missing references) //IL_1913: Unknown result type (might be due to invalid IL or missing references) //IL_191e: Unknown result type (might be due to invalid IL or missing references) //IL_1929: Unknown result type (might be due to invalid IL or missing references) //IL_192e: Unknown result type (might be due to invalid IL or missing references) //IL_193d: Unknown result type (might be due to invalid IL or missing references) //IL_194b: Unknown result type (might be due to invalid IL or missing references) //IL_1956: Unknown result type (might be due to invalid IL or missing references) //IL_195b: Unknown result type (might be due to invalid IL or missing references) //IL_1312: Unknown result type (might be due to invalid IL or missing references) //IL_1327: Unknown result type (might be due to invalid IL or missing references) //IL_132c: Unknown result type (might be due to invalid IL or missing references) //IL_1337: Unknown result type (might be due to invalid IL or missing references) //IL_133c: Unknown result type (might be due to invalid IL or missing references) //IL_134c: Unknown result type (might be due to invalid IL or missing references) //IL_1351: Unknown result type (might be due to invalid IL or missing references) //IL_1356: Unknown result type (might be due to invalid IL or missing references) //IL_1366: Unknown result type (might be due to invalid IL or missing references) //IL_136b: Unknown result type (might be due to invalid IL or missing references) //IL_1370: Unknown result type (might be due to invalid IL or missing references) //IL_1373: Unknown result type (might be due to invalid IL or missing references) //IL_1376: Unknown result type (might be due to invalid IL or missing references) //IL_1392: Unknown result type (might be due to invalid IL or missing references) //IL_1395: Unknown result type (might be due to invalid IL or missing references) //IL_13b1: Unknown result type (might be due to invalid IL or missing references) //IL_13be: Unknown result type (might be due to invalid IL or missing references) //IL_13f6: Unknown result type (might be due to invalid IL or missing references) //IL_1405: Unknown result type (might be due to invalid IL or missing references) //IL_140a: Unknown result type (might be due to invalid IL or missing references) //IL_1413: Unknown result type (might be due to invalid IL or missing references) //IL_1418: Unknown result type (might be due to invalid IL or missing references) //IL_141d: Unknown result type (might be due to invalid IL or missing references) //IL_1428: Unknown result type (might be due to invalid IL or missing references) //IL_1433: Unknown result type (might be due to invalid IL or missing references) //IL_1441: Unknown result type (might be due to invalid IL or missing references) //IL_1446: Unknown result type (might be due to invalid IL or missing references) //IL_144b: Unknown result type (might be due to invalid IL or missing references) //IL_1450: Unknown result type (might be due to invalid IL or missing references) //IL_1452: Unknown result type (might be due to invalid IL or missing references) //IL_1462: Unknown result type (might be due to invalid IL or missing references) //IL_1467: Unknown result type (might be due to invalid IL or missing references) //IL_146c: Unknown result type (might be due to invalid IL or missing references) //IL_1478: Unknown result type (might be due to invalid IL or missing references) //IL_147d: Unknown result type (might be due to invalid IL or missing references) //IL_1481: Unknown result type (might be due to invalid IL or missing references) //IL_1487: Unknown result type (might be due to invalid IL or missing references) //IL_148c: Unknown result type (might be due to invalid IL or missing references) //IL_1491: Unknown result type (might be due to invalid IL or missing references) //IL_1496: Unknown result type (might be due to invalid IL or missing references) //IL_14a5: Unknown result type (might be due to invalid IL or missing references) //IL_14b4: Unknown result type (might be due to invalid IL or missing references) //IL_14b6: Unknown result type (might be due to invalid IL or missing references) //IL_14b8: Unknown result type (might be due to invalid IL or missing references) //IL_14c2: Unknown result type (might be due to invalid IL or missing references) //IL_14c7: Unknown result type (might be due to invalid IL or missing references) //IL_14c9: Unknown result type (might be due to invalid IL or missing references) //IL_14cb: Unknown result type (might be due to invalid IL or missing references) //IL_14cd: Unknown result type (might be due to invalid IL or missing references) //IL_14cf: Unknown result type (might be due to invalid IL or missing references) //IL_14d9: Unknown result type (might be due to invalid IL or missing references) //IL_14dc: Unknown result type (might be due to invalid IL or missing references) //IL_14e9: Unknown result type (might be due to invalid IL or missing references) //IL_14eb: Unknown result type (might be due to invalid IL or missing references) //IL_14ed: Unknown result type (might be due to invalid IL or missing references) //IL_14ef: Unknown result type (might be due to invalid IL or missing references) //IL_14f9: Unknown result type (might be due to invalid IL or missing references) //IL_14fc: Unknown result type (might be due to invalid IL or missing references) //IL_1537: Unknown result type (might be due to invalid IL or missing references) //IL_155b: Unknown result type (might be due to invalid IL or missing references) //IL_1560: Unknown result type (might be due to invalid IL or missing references) //IL_1565: Unknown result type (might be due to invalid IL or missing references) //IL_156a: Unknown result type (might be due to invalid IL or missing references) //IL_1579: Unknown result type (might be due to invalid IL or missing references) //IL_1591: Unknown result type (might be due to invalid IL or missing references) //IL_1596: Unknown result type (might be due to invalid IL or missing references) //IL_15a4: Unknown result type (might be due to invalid IL or missing references) //IL_15a9: Unknown result type (might be due to invalid IL or missing references) //IL_15b0: Unknown result type (might be due to invalid IL or missing references) //IL_15b5: Unknown result type (might be due to invalid IL or missing references) //IL_1a0d: Unknown result type (might be due to invalid IL or missing references) //IL_1a0f: Unknown result type (might be due to invalid IL or missing references) //IL_1a11: Unknown result type (might be due to invalid IL or missing references) //IL_1a16: Unknown result type (might be due to invalid IL or missing references) //IL_1a29: Unknown result type (might be due to invalid IL or missing references) //IL_1a2e: Unknown result type (might be due to invalid IL or missing references) //IL_1a5e: Unknown result type (might be due to invalid IL or missing references) //IL_1a63: Unknown result type (might be due to invalid IL or missing references) //IL_1a71: Unknown result type (might be due to invalid IL or missing references) //IL_1a76: Unknown result type (might be due to invalid IL or missing references) //IL_1a7b: Unknown result type (might be due to invalid IL or missing references) //IL_1a89: Unknown result type (might be due to invalid IL or missing references) //IL_1a8e: Unknown result type (might be due to invalid IL or missing references) //IL_1a93: Unknown result type (might be due to invalid IL or missing references) //IL_1a95: Unknown result type (might be due to invalid IL or missing references) //IL_1a97: Unknown result type (might be due to invalid IL or missing references) //IL_1a99: Unknown result type (might be due to invalid IL or missing references) //IL_1a9b: Unknown result type (might be due to invalid IL or missing references) //IL_1a9d: Unknown result type (might be due to invalid IL or missing references) //IL_1a9f: Unknown result type (might be due to invalid IL or missing references) //IL_1aa1: Unknown result type (might be due to invalid IL or missing references) //IL_1aa6: Unknown result type (might be due to invalid IL or missing references) //IL_1aab: Unknown result type (might be due to invalid IL or missing references) //IL_1aad: Unknown result type (might be due to invalid IL or missing references) //IL_1aaf: Unknown result type (might be due to invalid IL or missing references) //IL_1ab4: Unknown result type (might be due to invalid IL or missing references) //IL_1ab9: Unknown result type (might be due to invalid IL or missing references) //IL_1abe: Unknown result type (might be due to invalid IL or missing references) //IL_1ac0: Unknown result type (might be due to invalid IL or missing references) //IL_1ac2: Unknown result type (might be due to invalid IL or missing references) //IL_1ac4: Unknown result type (might be due to invalid IL or missing references) //IL_1ac6: Unknown result type (might be due to invalid IL or missing references) //IL_1ac8: Unknown result type (might be due to invalid IL or missing references) //IL_1acd: Unknown result type (might be due to invalid IL or missing references) //IL_1ad2: Unknown result type (might be due to invalid IL or missing references) //IL_1ad4: Unknown result type (might be due to invalid IL or missing references) //IL_1ad6: Unknown result type (might be due to invalid IL or missing references) //IL_1adb: Unknown result type (might be due to invalid IL or missing references) //IL_1ae0: Unknown result type (might be due to invalid IL or missing references) //IL_1ae5: Unknown result type (might be due to invalid IL or missing references) //IL_1af7: Unknown result type (might be due to invalid IL or missing references) //IL_1afa: Unknown result type (might be due to invalid IL or missing references) //IL_1aff: Unknown result type (might be due to invalid IL or missing references) //IL_1b0a: Unknown result type (might be due to invalid IL or missing references) //IL_1b0f: Unknown result type (might be due to invalid IL or missing references) //IL_12d8: Unknown result type (might be due to invalid IL or missing references) //IL_12e2: Unknown result type (might be due to invalid IL or missing references) //IL_12e9: Unknown result type (might be due to invalid IL or missing references) //IL_12ee: Unknown result type (might be due to invalid IL or missing references) //IL_12f3: Unknown result type (might be due to invalid IL or missing references) //IL_160e: Unknown result type (might be due to invalid IL or missing references) //IL_161c: Unknown result type (might be due to invalid IL or missing references) //IL_1621: Unknown result type (might be due to invalid IL or missing references) //IL_1634: Unknown result type (might be due to invalid IL or missing references) //IL_1639: Unknown result type (might be due to invalid IL or missing references) //IL_15db: Unknown result type (might be due to invalid IL or missing references) //IL_15e0: Unknown result type (might be due to invalid IL or missing references) //IL_15e6: Unknown result type (might be due to invalid IL or missing references) //IL_15f3: Unknown result type (might be due to invalid IL or missing references) //IL_15f8: Unknown result type (might be due to invalid IL or missing references) //IL_1640: Unknown result type (might be due to invalid IL or missing references) //IL_164e: Unknown result type (might be due to invalid IL or missing references) //IL_1b39: Unknown result type (might be due to invalid IL or missing references) //IL_1b3e: Unknown result type (might be due to invalid IL or missing references) //IL_1b5a: Unknown result type (might be due to invalid IL or missing references) //IL_1b5f: Unknown result type (might be due to invalid IL or missing references) //IL_16ab: Unknown result type (might be due to invalid IL or missing references) //IL_16b0: Unknown result type (might be due to invalid IL or missing references) //IL_16b5: Unknown result type (might be due to invalid IL or missing references) //IL_16ba: Unknown result type (might be due to invalid IL or missing references) //IL_16bc: Unknown result type (might be due to invalid IL or missing references) //IL_16c1: Unknown result type (might be due to invalid IL or missing references) //IL_16c6: Unknown result type (might be due to invalid IL or missing references) //IL_16d4: Unknown result type (might be due to invalid IL or missing references) //IL_16d9: Unknown result type (might be due to invalid IL or missing references) //IL_16de: Unknown result type (might be due to invalid IL or missing references) //IL_16ed: Unknown result type (might be due to invalid IL or missing references) //IL_16fa: Unknown result type (might be due to invalid IL or missing references) //IL_16ff: Unknown result type (might be due to invalid IL or missing references) //IL_170a: Unknown result type (might be due to invalid IL or missing references) //IL_170f: Unknown result type (might be due to invalid IL or missing references) //IL_1714: Unknown result type (might be due to invalid IL or missing references) //IL_1723: Unknown result type (might be due to invalid IL or missing references) //IL_1733: Unknown result type (might be due to invalid IL or missing references) //IL_1738: Unknown result type (might be due to invalid IL or missing references) //IL_173a: Unknown result type (might be due to invalid IL or missing references) //IL_173c: Unknown result type (might be due to invalid IL or missing references) //IL_1741: Unknown result type (might be due to invalid IL or missing references) //IL_1746: Unknown result type (might be due to invalid IL or missing references) //IL_174a: Unknown result type (might be due to invalid IL or missing references) //IL_174f: Unknown result type (might be due to invalid IL or missing references) //IL_175b: Unknown result type (might be due to invalid IL or missing references) //IL_1767: Unknown result type (might be due to invalid IL or missing references) //IL_1769: Unknown result type (might be due to invalid IL or missing references) //IL_1774: Unknown result type (might be due to invalid IL or missing references) //IL_1779: Unknown result type (might be due to invalid IL or missing references) //IL_177e: Unknown result type (might be due to invalid IL or missing references) //IL_178c: Unknown result type (might be due to invalid IL or missing references) //IL_179a: Unknown result type (might be due to invalid IL or missing references) //IL_179f: Unknown result type (might be due to invalid IL or missing references) //IL_17a2: Unknown result type (might be due to invalid IL or missing references) //IL_17a7: Unknown result type (might be due to invalid IL or missing references) //IL_17ae: Unknown result type (might be due to invalid IL or missing references) //IL_17b3: Unknown result type (might be due to invalid IL or missing references) //IL_17b5: Unknown result type (might be due to invalid IL or missing references) //IL_17b8: Unknown result type (might be due to invalid IL or missing references) //IL_17cb: Unknown result type (might be due to invalid IL or missing references) //IL_17d1: Unknown result type (might be due to invalid IL or missing references) //IL_1672: Unknown result type (might be due to invalid IL or missing references) //IL_1680: Unknown result type (might be due to invalid IL or missing references) //IL_168e: Unknown result type (might be due to invalid IL or missing references) //IL_1693: Unknown result type (might be due to invalid IL or missing references) //IL_17fb: Unknown result type (might be due to invalid IL or missing references) //IL_1809: Unknown result type (might be due to invalid IL or missing references) //IL_1817: Unknown result type (might be due to invalid IL or missing references) //IL_1825: Unknown result type (might be due to invalid IL or missing references) //IL_182a: Unknown result type (might be due to invalid IL or missing references) //IL_182f: Unknown result type (might be due to invalid IL or missing references) //IL_183d: Unknown result type (might be due to invalid IL or missing references) //IL_17ea: Unknown result type (might be due to invalid IL or missing references) //IL_17ec: Unknown result type (might be due to invalid IL or missing references) //IL_1bac: Unknown result type (might be due to invalid IL or missing references) //IL_1bc8: Unknown result type (might be due to invalid IL or missing references) //IL_1bd6: Unknown result type (might be due to invalid IL or missing references) //IL_1be4: Unknown result type (might be due to invalid IL or missing references) //IL_1bf2: Unknown result type (might be due to invalid IL or missing references) //IL_1bf7: Unknown result type (might be due to invalid IL or missing references) //IL_1bfc: Unknown result type (might be due to invalid IL or missing references) //IL_1cf0: Unknown result type (might be due to invalid IL or missing references) //IL_1cf5: Unknown result type (might be due to invalid IL or missing references) //IL_1cf7: Unknown result type (might be due to invalid IL or missing references) //IL_1cfa: Unknown result type (might be due to invalid IL or missing references) //IL_1d04: Unknown result type (might be due to invalid IL or missing references) //IL_1d09: Unknown result type (might be due to invalid IL or missing references) //IL_1d13: Unknown result type (might be due to invalid IL or missing references) //IL_1d16: Unknown result type (might be due to invalid IL or missing references) //IL_1d20: Unknown result type (might be due to invalid IL or missing references) //IL_1d25: Unknown result type (might be due to invalid IL or missing references) //IL_1d2b: Unknown result type (might be due to invalid IL or missing references) //IL_1d35: Unknown result type (might be due to invalid IL or missing references) //IL_1d3a: Unknown result type (might be due to invalid IL or missing references) //IL_1d44: Unknown result type (might be due to invalid IL or missing references) //IL_1d46: Unknown result type (might be due to invalid IL or missing references) //IL_1d48: Unknown result type (might be due to invalid IL or missing references) //IL_1d52: Unknown result type (might be due to invalid IL or missing references) //IL_1d54: Unknown result type (might be due to invalid IL or missing references) //IL_1d5b: Unknown result type (might be due to invalid IL or missing references) //IL_1d60: Unknown result type (might be due to invalid IL or missing references) //IL_1d6a: Unknown result type (might be due to invalid IL or missing references) //IL_1d6d: Unknown result type (might be due to invalid IL or missing references) //IL_1d77: Unknown result type (might be due to invalid IL or missing references) //IL_1d7c: Unknown result type (might be due to invalid IL or missing references) //IL_1c32: Unknown result type (might be due to invalid IL or missing references) //IL_1c89: Unknown result type (might be due to invalid IL or missing references) //IL_1ca1: Unknown result type (might be due to invalid IL or missing references) //IL_1caf: Unknown result type (might be due to invalid IL or missing references) if (Time.deltaTime == 0f || Time.timeScale == 0f) { return; } MonitorFootsteps(); tr.ControlledLateUpdate(); position = tr.position; rotation = tr.rotation; AssertSane(tr.accelerationSmoothed, "acceleration"); up = rotation * Vector3.up; forward = rotation * Vector3.forward; Vector3 val = rotation * Vector3.right; if (!isActive || currentTime != Time.time || !useIK) { return; } int layer = ((Component)this).gameObject.layer; ((Component)this).gameObject.layer = 2; for (int i = 0; i < legs.Length; i++) { float num = Util.CyclicDiff(normalizedTime, legStates[i].stanceTime); bool flag = false; if (num < legStates[i].designatedCycleTimePrev - 0.5f) { flag = true; legStates[i].stepNr++; if (!legStates[i].parked) { legStates[i].stepFromTime = legStates[i].stepToTime; legStates[i].stepFromPosition = legStates[i].stepToPosition; legStates[i].stepFromMatrix = legStates[i].stepToMatrix; legStates[i].debugHistory.Clear(); legStates[i].cycleTime = num; } legStates[i].parked = false; } legStates[i].designatedCycleTimePrev = num; legStates[i].stepToTime = Time.time + (1f - num) * cycleDuration; float num2 = (legStates[i].strikeTime - num) * cycleDuration; if (num >= legStates[i].strikeTime) { legStates[i].cycleTime = num; } else { legStates[i].cycleTime += (legStates[i].strikeTime - legStates[i].cycleTime) * Time.deltaTime / num2; } if (legStates[i].cycleTime >= num) { legStates[i].cycleTime = num; } if (legStates[i].cycleTime < legStates[i].strikeTime) { float num3 = Mathf.InverseLerp(legStates[i].liftoffTime, legStates[i].strikeTime, legStates[i].cycleTime); Vector3 angularVelocitySmoothed = tr.angularVelocitySmoothed; Quaternion val2 = Quaternion.AngleAxis(((Vector3)(ref angularVelocitySmoothed)).magnitude * (legStates[i].stepToTime - Time.time), tr.angularVelocitySmoothed) * tr.rotation; Quaternion val3; if (legStates[i].cycleTime <= legStates[i].liftoffTime) { val3 = val2; } else { Quaternion val4 = Util.QuaternionFromMatrix(legStates[i].stepToMatrix); val4 = Quaternion.FromToRotation(val4 * Vector3.up, up) * val4; Vector3 angularVelocitySmoothed2 = tr.angularVelocitySmoothed; float num4 = Mathf.Max(((Vector3)(ref angularVelocitySmoothed2)).magnitude * 3f, maxStepRotation / maxStepDuration); float angle = num4 / num3 * Time.deltaTime; val3 = Util.ConstantSlerp(val4, val2, angle); } float num5 = Vector3.Dot(tr.angularVelocitySmoothed, up); Vector3 originalVector; if (num5 * cycleDuration < 5f) { originalVector = tr.position + val3 * legStates[i].stancePosition + tr.velocity * (legStates[i].stepToTime - Time.time); } else { Vector3 val5 = Vector3.Cross(up, tr.velocity) / (num5 * (float)Math.PI / 180f); Vector3 val6 = val5 + Quaternion.AngleAxis(num5 * (legStates[i].stepToTime - Time.time), up) * -val5; originalVector = tr.position + val3 * legStates[i].stancePosition + val6; } originalVector = Util.SetHeight(originalVector, position + legC.groundPlaneHeight * up * scale, up); Matrix4x4 stepToMatrix = FindGroundedBase(originalVector, val3, legStates[i].heelToetipVector, avoidLedges: true); originalVector = Vector4.op_Implicit(((Matrix4x4)(ref stepToMatrix)).GetColumn(3)); if (flag) { legStates[i].stepToPosition = originalVector; legStates[i].stepToPositionGoal = originalVector; } else { float num6 = speed * 3f; Vector3 accelerationSmoothed = tr.accelerationSmoothed; float num7 = Mathf.Max(num6 + ((Vector3)(ref accelerationSmoothed)).magnitude / 10f, legs[i].footLength * scale * 3f); float num8 = legStates[i].cycleTime / legStates[i].strikeTime; Vector3 val7 = originalVector - legStates[i].stepToPosition; if (((Vector3)(ref val7)).sqrMagnitude < Mathf.Pow(num7 * (1f / num8 - 1f), 2f)) { legStates[i].stepToPositionGoal = originalVector; } Vector3 val8 = legStates[i].stepToPositionGoal - legStates[i].stepToPosition; if (val8 != Vector3.zero && num2 > 0f) { float magnitude = ((Vector3)(ref val8)).magnitude; float num9 = Mathf.Min(magnitude, Mathf.Max(num7 / Mathf.Max(0.1f, num3) * Time.deltaTime, (1f + 2f * Mathf.Pow(num8 - 1f, 2f)) * (Time.deltaTime / num2) * magnitude)); LegState obj = legStates[i]; obj.stepToPosition += (legStates[i].stepToPositionGoal - legStates[i].stepToPosition) / magnitude * num9; } } ((Matrix4x4)(ref stepToMatrix)).SetColumn(3, Vector4.op_Implicit(legStates[i].stepToPosition)); ((Matrix4x4)(ref stepToMatrix))[3, 3] = 1f; legStates[i].stepToMatrix = stepToMatrix; } if (enableLegParking) { Vector3 val9 = Util.ProjectOntoPlane(legStates[i].stepToPosition - legStates[i].stepFromPosition, up); float magnitude2 = ((Vector3)(ref val9)).magnitude; bool flag2 = magnitude2 > minStepDistance || Vector3.Angle(Vector4.op_Implicit(((Matrix4x4)(ref legStates[i].stepToMatrix)).GetColumn(2)), Vector4.op_Implicit(((Matrix4x4)(ref legStates[i].stepFromMatrix)).GetColumn(2))) > maxStepRotation / 2f; if (flag && !flag2) { legStates[i].parked = true; } if (legStates[i].parked && num < 0.67f && flag2) { legStates[i].parked = false; } if (legStates[i].parked) { legStates[i].cycleTime = 0f; } } } Vector3 val10 = Quaternion.Inverse(tr.rotation) * tr.velocity; val10.y = 0f; if (((Vector3)(ref val10)).sqrMagnitude > 0f) { val10 = ((Vector3)(ref val10)).normalized; } AssertSane(cycleDistance, "cycleDistance"); Vector3[] array = (Vector3[])(object)new Vector3[legs.Length]; Vector3 val11 = Vector3.zero; Vector3 val12 = Vector3.zero; Vector3 val13 = Vector3.zero; float num10 = 0f; for (int j = 0; j < legs.Length; j++) { float num11 = Mathf.Cos(legStates[j].cycleTime * 2f * (float)Math.PI) / 2f + 0.5f; num10 += num11 + 0.001f; float num12 = Mathf.InverseLerp(legStates[j].liftTime, legStates[j].landTime, legStates[j].cycleTime); float num13 = (0f - Mathf.Cos(num12 * (float)Math.PI)) / 2f + 0.5f; Vector3 val14 = ((Component)this).transform.TransformDirection(-legStates[j].stancePosition) * scale; AssertSane(legStates[j].cycleTime, "legStates[leg].cycleTime"); AssertSane(num13, "strideSCurve"); AssertSane(val10, "tangentDir"); AssertSane(cycleDistance, "cycleDistance"); AssertSane(legStates[j].stepFromPosition, "legStates[leg].stepFromPosition"); AssertSane(legStates[j].stepToPosition, "legStates[leg].stepToPosition"); AssertSane(((Matrix4x4)(ref legStates[j].stepToMatrix)).MultiplyVector(val10), "stepToMatrix"); AssertSane(((Matrix4x4)(ref legStates[j].stepFromMatrix)).MultiplyVector(val10), "stepToMatrix"); ref Vector3 reference = ref array[j]; reference = (legStates[j].stepFromPosition + ((Matrix4x4)(ref legStates[j].stepFromMatrix)).MultiplyVector(val10) * cycleDistance * legStates[j].cycleTime) * (1f - num13) + (legStates[j].stepToPosition + ((Matrix4x4)(ref legStates[j].stepToMatrix)).MultiplyVector(val10) * cycleDistance * (legStates[j].cycleTime - 1f)) * num13; AssertSane(array[j], "basePointFoot[leg]"); if (float.IsNaN(array[j].x) || float.IsNaN(array[j].y) || float.IsNaN(array[j].z)) { Debug.LogError((object)string.Concat("legStates[leg].cycleTime=", legStates[j].cycleTime, ", strideSCurve=", num13, ", tangentDir=", val10, ", cycleDistance=", cycleDistance, ", legStates[leg].stepFromPosition=", legStates[j].stepFromPosition, ", legStates[leg].stepToPosition=", legStates[j].stepToPosition, ", legStates[leg].stepToMatrix.MultiplyVector(tangentDir)=", ((Matrix4x4)(ref legStates[j].stepToMatrix)).MultiplyVector(val10), ", legStates[leg].stepFromMatrix.MultiplyVector(tangentDir)=", ((Matrix4x4)(ref legStates[j].stepFromMatrix)).MultiplyVector(val10))); } val11 += (array[j] + val14) * (num11 + 0.001f); val13 += array[j]; val12 += (legStates[j].stepToPosition - legStates[j].stepFromPosition) * (1f - num11 + 0.001f); } Assert(num10 != 0f, "baseSummedWeight is zero"); val13 /= (float)legs.Length; val11 /= num10; if (float.IsNaN(val11.x) || float.IsNaN(val11.y) || float.IsNaN(val11.z)) { val11 = position; } AssertSane(val11, "basePoint"); Vector3 val15 = val11 + up * legC.groundPlaneHeight; Vector3 normalized = up; if (groundHugX >= 0f || groundHugZ >= 0f) { Vector3 val16 = up * 0.1f; for (int k = 0; k < legs.Length; k++) { Vector3 val17 = array[k] - val13; val16 += Vector3.Cross(Vector3.Cross(val17, baseUpGround), val17); Debug.DrawLine(array[k], val13); } float num14 = Vector3.Dot(val16, up); if (num14 > 0f) { val16 /= num14; AssertSane(val16, "baseUpGroundNew"); baseUpGround = val16; } if (groundHugX >= 1f && groundHugZ >= 1f) { normalized = ((Vector3)(ref baseUpGround)).normalized; } else { Vector3 val18 = up + groundHugX * Vector3.Project(baseUpGround, val) + groundHugZ * Vector3.Project(baseUpGround, forward); normalized = ((Vector3)(ref val18)).normalized; } } Vector3 val19 = up; if (val12 != Vector3.zero) { val19 = Vector3.Cross(val12, Vector3.Cross(up, val12)); } val19 /= Vector3.Dot(val19, up); Vector3 val20 = Vector3.zero; if (accelerateTiltAmount * accelerateTiltSensitivity != 0f) { float num15 = Vector3.Dot(tr.accelerationSmoothed * accelerateTiltSensitivity * accelerateTiltAmount, val) * (1f - groundHugX); float num16 = Vector3.Dot(tr.accelerationSmoothed * accelerateTiltSensitivity * accelerateTiltAmount, forward) * (1f - groundHugZ); accelerationTiltX = Mathf.Lerp(accelerationTiltX, num15, Time.deltaTime * 10f); accelerationTiltZ = Mathf.Lerp(accelerationTiltZ, num16, Time.deltaTime * 10f); val20 = (accelerationTiltX * val + accelerationTiltZ * forward) * (1f - 1f / (hSpeedSmoothed * accelerateTiltSensitivity + 1f)); } Vector3 val21 = Vector3.zero; if (climbTiltAmount * climbTiltAmount != 0f) { val21 = (Vector3.Project(val19, val) * (1f - groundHugX) + Vector3.Project(val19, forward) * (1f - groundHugZ)) * (0f - climbTiltAmount) * (1f - 1f / (hSpeedSmoothed * climbTiltSensitivity + 1f)); } Vector3 val22 = normalized + val20 + val21; bodyUp = ((Vector3)(ref val22)).normalized; Quaternion val23 = Quaternion.AngleAxis(Vector3.Angle(up, bodyUp), Vector3.Cross(up, bodyUp)); Vector3 val24 = up + val20; legsUp = ((Vector3)(ref val24)).normalized; Quaternion val25 = Quaternion.AngleAxis(Vector3.Angle(up, legsUp), Vector3.Cross(up, legsUp)); for (int l = 0; l < legs.Length; l++) { float num17 = Mathf.InverseLerp(legStates[l].liftoffTime, legStates[l].strikeTime, legStates[l].cycleTime); float num18 = Mathf.InverseLerp(legStates[l].liftTime, legStates[l].landTime, legStates[l].cycleTime); float num19 = 0f; int phase; if (legStates[l].cycleTime < legStates[l].liftoffTime) { phase = 0; num19 = Mathf.InverseLerp(0f, legStates[l].liftoffTime, legStates[l].cycleTime); } else if (legStates[l].cycleTime > legStates[l].strikeTime) { phase = 2; num19 = Mathf.InverseLerp(legStates[l].strikeTime, 1f, legStates[l].cycleTime); } else { phase = 1; num19 = num17; } Vector3 val26 = Vector3.zero; for (int m = 0; m < legC.motions.Length; m++) { IMotionAnalyzer motionAnalyzer = legC.motions[m]; float num20 = motionWeights[m]; if (num20 > 0f) { val26 += motionAnalyzer.GetFlightFootPosition(l, num19, phase) * num20; } } AssertSane(val26, "flightPos"); Vector3 stepFromPosition = legStates[l].stepFromPosition; Vector3 stepToPosition = legStates[l].stepToPosition; Vector3 val27 = ((Matrix4x4)(ref legStates[l].stepFromMatrix)).MultiplyVector(Vector3.up); Vector3 val28 = ((Matrix4x4)(ref legStates[l].stepToMatrix)).MultiplyVector(Vector3.up); Assert(Vector3.Dot(val27, legsUp) > 0f, "normalFrom and legsUp are perpendicular"); Assert(Vector3.Dot(val27, legsUp) > 0f, "normalTo and legsUp are perpendicular"); AssertSane(val15, "groundBasePoint"); AssertSane(normalized, "baseUp"); float num21 = Mathf.Sin(val26.z * (float)Math.PI); float num22 = Mathf.Sin(num17 * (float)Math.PI); legStates[l].footBase = stepFromPosition * (1f - val26.z) + stepToPosition * val26.z; Vector3 val29 = tr.position + tr.rotation * legStates[l].stancePosition - Vector3.Lerp(stepFromPosition, stepToPosition, legStates[l].cycleTime); LegState obj2 = legStates[l]; obj2.footBase += Util.ProjectOntoPlane(val29 * num21, legsUp); AssertSane(legStates[l].footBase, "legStates[leg].footBase"); Vector3 val30 = (stepFromPosition + stepToPosition) / 2f; float num23 = Vector3.Dot(val27, stepFromPosition - val30) / Vector3.Dot(val27, legsUp); float num24 = Vector3.Dot(val28, stepToPosition - val30) / Vector3.Dot(val28, legsUp); float num25 = Mathf.Max(num23, num24) * 2f / (float)Math.PI; AssertSane(num25, "heightMidOffset"); LegState obj3 = legStates[l]; obj3.footBase += Mathf.Max(0f, num25 * num21 - val26.y * scale) * legsUp; AssertSane(legStates[l].footBase, "legStates[leg].footBase"); Quaternion val31 = Quaternion.Slerp(Util.QuaternionFromMatrix(legStates[l].stepFromMatrix), Util.QuaternionFromMatrix(legStates[l].stepToMatrix), num17); if ((double)num18 < 0.5) { legStates[l].footBaseRotation = Quaternion.Slerp(Util.QuaternionFromMatrix(legStates[l].stepFromMatrix), rotation, num18 * 2f); } else { legStates[l].footBaseRotation = Quaternion.Slerp(rotation, Util.QuaternionFromMatrix(legStates[l].stepToMatrix), num18 * 2f - 1f); } float num26 = Quaternion.Angle(rotation, legStates[l].footBaseRotation); if (num26 > maxFootRotationAngle) { legStates[l].footBaseRotation = Quaternion.Slerp(rotation, legStates[l].footBaseRotation, maxFootRotationAngle / num26); } legStates[l].footBaseRotation = Quaternion.FromToRotation(legStates[l].footBaseRotation * Vector3.up, val31 * Vector3.up) * legStates[l].footBaseRotation; LegState obj4 = legStates[l]; obj4.footBase += val26.y * legsUp * scale; AssertSane(legStates[l].footBase, "legStates[leg].footBase"); Vector3 val32 = Vector3.Cross(legsUp, stepToPosition - stepFromPosition); Vector3 normalized2 = ((Vector3)(ref val32)).normalized; LegState obj5 = legStates[l]; obj5.footBase += val26.x * normalized2 * scale; Vector3 val33 = Vector3.Lerp(legStates[l].footBase, Util.SetHeight(legStates[l].footBase, val15, legsUp), num22); if (Vector3.Dot(val33, legsUp) > Vector3.Dot(legStates[l].footBase, legsUp)) { legStates[l].footBase = val33; } Debug.DrawLine(legStates[l].footBase, legStates[l].footBase + legStates[l].footBaseRotation * legStates[l].heelToetipVector, legs[l].debugColor); } for (int n = 0; n < legs.Length; n++) { Vector3 val34 = -MotionAnalyzer.GetHeelOffset(legs[n].ankle, legs[n].ankleHeelVector, legs[n].toe, legs[n].toeToetipVector, legStates[n].heelToetipVector, legStates[n].footBaseRotation) + legs[n].ankle.TransformPoint(legs[n].ankleHeelVector); AssertSane(val34, "footBaseReference"); if (locomotionWeight < 1f) { legStates[n].footBase = Vector3.Lerp(val34, legStates[n].footBase, locomotionWeight); legStates[n].footBaseRotation = Quaternion.Slerp(rotation, legStates[n].footBaseRotation, locomotionWeight); } legStates[n].footBase = Vector3.MoveTowards(val34, legStates[n].footBase, maxIKAdjustmentDistance); } ((Component)legC.root).transform.rotation = tr.rotation * Quaternion.Inverse(((Component)this).transform.rotation) * val23 * ((Component)legC.root).transform.rotation; for (int num27 = 0; num27 < legs.Length; num27++) { legs[num27].hip.rotation = val25 * Quaternion.Inverse(val23) * legs[num27].hip.rotation; } Vector3 val35 = ((Component)legC.root).transform.position; Vector3 val36 = ((Component)this).transform.TransformPoint(legC.hipAverage); Vector3 val37 = ((Component)this).transform.TransformPoint(legC.hipAverageGround); Vector3 val38 = val35; val38 += val23 * (val35 - val36) - (val35 - val36); val38 += val25 * (val36 - val37) - (val36 - val37); ((Component)legC.root).transform.position = val38 + position - ((Component)this).transform.position; for (int num28 = 0; num28 < legs.Length; num28++) { legStates[num28].hipReference = legs[num28].hip.position; legStates[num28].ankleReference = legs[num28].ankle.position; } for (int num29 = 1; num29 <= 2; num29++) { for (int num30 = 0; num30 < legs.Length; num30++) { legStates[num30].ankle = MotionAnalyzer.GetAnklePosition(legs[num30].ankle, legs[num30].ankleHeelVector, legs[num30].toe, legs[num30].toeToetipVector, legStates[num30].heelToetipVector, legStates[num30].footBase, legStates[num30].footBaseRotation); } FindHipOffset(); for (int num31 = 0; num31 < legs.Length; num31++) { AdjustLeg(num31, legStates[num31].ankle, num29 == 2); } } for (int num32 = 0; num32 < legs.Length; num32++) { for (int num33 = 0; num33 < legs[num32].legChain.Length - 1; num33++) { Debug.DrawLine(legs[num32].legChain[num33].position, legs[num32].legChain[num33 + 1].position, legs[num32].debugColor); } } Vector3 val39 = position; Debug.DrawRay(val39, up / 10f, Color.white); Debug.DrawRay(val39 - forward / 20f, forward / 10f, Color.white); Debug.DrawLine(val36, val37, Color.white); Debug.DrawRay(val39, normalized * 2f, Color.blue); Debug.DrawRay(val36, bodyUp * 2f, Color.yellow); ((Component)this).gameObject.layer = layer; } public Matrix4x4 FindGroundedBase(Vector3 pos, Quaternion rot, Vector3 heelToToetipVector, bool avoidLedges) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); Vector3 val2 = default(Vector3); Vector3 val3 = default(Vector3); Vector3 val4 = default(Vector3); bool flag = false; bool flag2 = false; bool flag3 = false; RaycastHit val5 = default(RaycastHit); if (Physics.Raycast(pos + up * maxStepHeight, -up, ref val5, maxStepHeight * 2f, LayerMask.op_Implicit(groundLayers))) { flag3 = true; val = ((RaycastHit)(ref val5)).point; if (Vector3.Angle(((RaycastHit)(ref val5)).normal, up) < maxSlopeAngle) { val3 = ((RaycastHit)(ref val5)).normal; flag = true; } } Vector3 val6 = rot * heelToToetipVector; float magnitude = ((Vector3)(ref val6)).magnitude; if (Physics.Raycast(pos + up * maxStepHeight + val6, -up, ref val5, maxStepHeight * 2f, LayerMask.op_Implicit(groundLayers))) { flag3 = true; val2 = ((RaycastHit)(ref val5)).point; if (Vector3.Angle(((RaycastHit)(ref val5)).normal, up) < maxSlopeAngle) { val4 = ((RaycastHit)(ref val5)).normal; flag2 = true; } } if (!flag3) { Matrix4x4 identity = Matrix4x4.identity; ((Matrix4x4)(ref identity)).SetTRS(pos, rot, Vector3.one); return identity; } bool flag4 = false; if (avoidLedges) { if (!flag && !flag2) { flag = true; } else if (flag && flag2) { Vector3 val7 = val3 + val4; Vector3 normalized = ((Vector3)(ref val7)).normalized; float num = Vector3.Dot(val, normalized); float num2 = Vector3.Dot(val2, normalized); if (num >= num2) { flag2 = false; } else { flag = false; } if (Mathf.Abs(num - num2) > magnitude / 4f) { flag4 = true; } } else { flag4 = true; } } Vector3 val8 = rot * Vector3.up; Vector3 val9; if (flag) { if (val3 != Vector3.zero) { rot = Quaternion.FromToRotation(val8, val3) * rot; } val9 = val; if (flag4) { val6 = rot * heelToToetipVector; val9 -= val6 * 0.5f; } } else { if (val4 != Vector3.zero) { rot = Quaternion.FromToRotation(val8, val4) * rot; } val6 = rot * heelToToetipVector; val9 = val2 - val6; if (flag4) { val9 += val6 * 0.5f; } } return Util.MatrixFromQuaternionPosition(rot, val9); } public void FindHipOffset() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) float num = float.PositiveInfinity; float num2 = float.PositiveInfinity; float num3 = 0f; AssertSane(legsUp, "legsUp"); for (int i = 0; i < legs.Length; i++) { Vector3 v = legStates[i].ankleReference - legStates[i].hipReference; float magnitude = ((Vector3)(ref v)).magnitude; Vector3 val = Util.ProjectOntoPlane(v, legsUp); float magnitude2 = ((Vector3)(ref val)).magnitude; Vector3 val2 = Util.ProjectOntoPlane(legStates[i].ankle - legs[i].hip.position, legsUp); float num4 = ((Vector3)(ref val2)).magnitude - magnitude2; if (num4 > 0f) { float num5 = legs[i].legLength * scale * 0.999f - magnitude2; legStates[i].ankle = legStates[i].ankle - val2 + ((Vector3)(ref val2)).normalized * (magnitude2 + (1f - 1f / (num4 / num5 + 1f)) * num5); } float[] lineSphereIntersections = Util.GetLineSphereIntersections(Vector3.zero, legsUp, legStates[i].ankle - legs[i].hip.position, magnitude); float num6; if (lineSphereIntersections != null) { num6 = lineSphereIntersections[1]; AssertSane(num6, "hipDesiredHeight (intersection)"); } else { num6 = Vector3.Dot(legStates[i].footBase - legs[i].hip.position, legsUp); } lineSphereIntersections = Util.GetLineSphereIntersections(Vector3.zero, legsUp, legStates[i].ankle - legs[i].hip.position, legs[i].legLength * scale * 0.999f); float num7; if (lineSphereIntersections != null) { num7 = lineSphereIntersections[1]; } else { num7 = Vector3.Dot(legStates[i].ankle - legs[i].hip.position, legsUp); Debug.Log((object)(((Object)((Component)this).gameObject).name + ": Line-sphere intersection failed for leg " + i + ", hipMaxHeight.")); } if (num6 < num) { num = num6; } if (num7 < num2) { num2 = num7; } num3 += num6 / (float)legs.Length; } Assert(num != float.PositiveInfinity, "lowestDesiredHeight is infinite"); Assert(num2 != float.PositiveInfinity, "lowestMaxHeight is infinite"); AssertSane(num3, "averageDesiredHeight"); AssertSane(num, "lowestDesiredHeight"); AssertSane(num2, "lowestMaxHeight"); if (num > num2) { num = num2; } float num8 = num3 - num; float num9 = num2 - num; float num10 = num; if (num8 + num9 > 0f) { num10 += num8 * num9 / (num8 + num9); } AssertSane(num10, "hipHeight"); Transform root = legC.root; root.position += num10 * legsUp; } public void AdjustLeg(int leg, Vector3 desiredAnklePosition, bool secondPass) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) LegInfo legInfo = legs[leg]; LegState legState = legStates[leg]; Quaternion val2; if (!secondPass) { Quaternion val = legStates[leg].footBaseRotation * Quaternion.Inverse(rotation); val2 = val * legInfo.ankle.rotation; } else { val2 = legInfo.ankle.rotation; } IKSolver iKSolver = ((legInfo.legChain.Length != 3) ? ((IKSolver)new IKSimple()) : ((IKSolver)new IK1JointAnalytic())); iKSolver.Solve(legInfo.legChain, desiredAnklePosition); Vector3 val3 = legInfo.hip.position; Vector3 val4 = legInfo.ankle.position; if (!secondPass) { Quaternion val5 = Quaternion.FromToRotation(forward, Util.ProjectOntoPlane(legStates[leg].footBaseRotation * Vector3.forward, up)) * legInfo.ankle.rotation; legInfo.ankle.rotation = Quaternion.Slerp(val5, val2, 1f - legState.GetFootGrounding(legState.cycleTime)); return; } Vector3 normal = val4 - val3; Quaternion val6 = Quaternion.Slerp(Quaternion.identity, Quaternion.FromToRotation(Util.ProjectOntoPlane(forward, normal), Util.ProjectOntoPlane(legStates[leg].footBaseRotation * Vector3.forward, normal)), 0.5f); legInfo.hip.rotation = val6 * legInfo.hip.rotation; legInfo.ankle.rotation = val2; } private void OnRenderObject() { vertexColorMaterial.SetPass(0); if (isActive) { if (renderFootMarkers) { RenderFootMarkers(); } if (renderBlendingGraph) { RenderBlendingGraph(); } if (renderCycleGraph) { RenderCycleGraph(); } } } private void DrawLine(Vector3 a, Vector3 b, Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) GL.Color(color); GL.Vertex(a); GL.Vertex(b); } public void RenderBlendingGraph() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 matrix = Util.CreateMatrix(((Component)this).transform.right, ((Component)this).transform.forward, ((Component)this).transform.up, ((Component)this).transform.TransformPoint(legC.hipAverage)); Vector3 val = ((Component)Camera.main).transform.position - ((Component)this).transform.TransformPoint(legC.hipAverage); float num = ((Vector3)(ref val)).magnitude / 2f; DrawArea drawArea = new DrawArea3D(new Vector3(0f - num, 0f - num, 0f), new Vector3(num, num, 0f), matrix); GL.Begin(7); drawArea.DrawRect(new Vector3(0f, 0f, 0f), new Vector3(1f, 1f, 0f), new Color(0f, 0f, 0f, 0.2f)); GL.End(); Color c = default(Color); ((Color)(ref c))..ctor(0.7f, 0.7f, 0.7f, 1f); float num2 = 0f; for (int i = 0; i < legC.motions.Length; i++) { IMotionAnalyzer motionAnalyzer = legC.motions[i]; num2 = Mathf.Max(num2, Mathf.Abs(motionAnalyzer.cycleVelocity.x)); num2 = Mathf.Max(num2, Mathf.Abs(motionAnalyzer.cycleVelocity.z)); } num2 = ((num2 != 0f) ? (num2 * 1.2f) : 1f); GL.Begin(1); drawArea.DrawLine(new Vector3(0.5f, 0f, 0f), new Vector3(0.5f, 1f, 0f), c); drawArea.DrawLine(new Vector3(0f, 0.5f, 0f), new Vector3(1f, 0.5f, 0f), c); drawArea.DrawLine(new Vector3(0f, 0f, 0f), new Vector3(1f, 0f, 0f), c); drawArea.DrawLine(new Vector3(1f, 0f, 0f), new Vector3(1f, 1f, 0f), c); drawArea.DrawLine(new Vector3(1f, 1f, 0f), new Vector3(0f, 1f, 0f), c); drawArea.DrawLine(new Vector3(0f, 1f, 0f), new Vector3(0f, 0f, 0f), c); GL.End(); Color val3 = default(Color); float num3; float num4; for (int j = 0; j < motionGroupStates.Length; j++) { Vector3 val2 = Quaternion.AngleAxis(((float)j + 0.5f) * 360f / (float)motionGroupStates.Length, Vector3.one) * Vector3.right; ((Color)(ref val3))..ctor(val2.x, val2.y, val2.z); IMotionAnalyzer[] motions = legC.motionGroups[j].motions; GL.Begin(7); Color c2 = val3 * 0.4f; c2.a = 0.8f; foreach (IMotionAnalyzer motionAnalyzer2 in motions) { num3 = motionAnalyzer2.cycleVelocity.x / num2 / 2f + 0.5f; num4 = motionAnalyzer2.cycleVelocity.z / num2 / 2f + 0.5f; float num5 = 0.02f; drawArea.DrawDiamond(new Vector3(num3 - num5, num4 - num5, 0f), new Vector3(num3 + num5, num4 + num5, 0f), c2); } GL.End(); if (motionGroupStates[j].weight != 0f) { float[] relativeWeights = motionGroupStates[j].relativeWeights; GL.Begin(7); val3.a = motionGroupStates[j].weight; for (int l = 0; l < motions.Length; l++) { IMotionAnalyzer motionAnalyzer3 = motions[l]; num3 = motionAnalyzer3.cycleVelocity.x / num2 / 2f + 0.5f; num4 = motionAnalyzer3.cycleVelocity.z / num2 / 2f + 0.5f; float num6 = Mathf.Pow(relativeWeights[l], 0.5f) * 0.05f; drawArea.DrawRect(new Vector3(num3 - num6, num4 - num6, 0f), new Vector3(num3 + num6, num4 + num6, 0f), val3); } GL.End(); } } GL.Begin(7); num3 = objectVelocity.x / num2 / 2f + 0.5f; num4 = objectVelocity.z / num2 / 2f + 0.5f; float num7 = 0.02f; drawArea.DrawRect(new Vector3(num3 - num7, num4 - num7, 0f), new Vector3(num3 + num7, num4 + num7, 0f), new Color(0f, 0f, 0f, 1f)); num7 /= 2f; drawArea.DrawRect(new Vector3(num3 - num7, num4 - num7, 0f), new Vector3(num3 + num7, num4 + num7, 0f), new Color(1f, 1f, 1f, 1f)); GL.End(); } public void RenderCycleGraph() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) float num = Camera.main.pixelWidth; float num2 = Camera.main.pixelHeight; Color c = default(Color); ((Color)(ref c))..ctor(0.7f, 0.7f, 0.7f, 1f); DrawArea drawArea = new DrawArea(new Vector3(num - 0.49f * num2, 0.01f * num2, 0f), new Vector3(num - 0.01f * num2, 0.49f * num2, 0f)); drawArea.canvasMin = new Vector3(-1.1f, -1.1f, 0f); drawArea.canvasMax = new Vector3(1.1f, 1.1f, 0f); GL.Begin(7); drawArea.DrawRect(new Vector3(-1f, -1f, 0f), new Vector3(1f, 1f, 0f), new Color(0f, 0f, 0f, 0.2f)); GL.End(); GL.Begin(1); drawArea.DrawLine(-0.9f * Vector3.up, -1.1f * Vector3.up, c); for (int i = 0; i < 90; i++) { drawArea.DrawLine(Quaternion.AngleAxis((float)i / 90f * 360f, Vector3.forward) * Vector3.up, Quaternion.AngleAxis((float)(i + 1) / 90f * 360f, Vector3.forward) * Vector3.up, c); } for (int j = 0; j < legs.Length; j++) { Color debugColor = legs[j].debugColor; Vector3 val = Quaternion.AngleAxis(360f * legStates[j].liftoffTime, -Vector3.forward) * -Vector3.up; drawArea.DrawLine(val * 0.9f, val * 1.1f, debugColor); val = Quaternion.AngleAxis(360f * legStates[j].strikeTime, -Vector3.forward) * -Vector3.up; drawArea.DrawLine(val * 0.9f, val * 1.1f, debugColor); } GL.End(); GL.Begin(7); for (int k = 0; k < legs.Length; k++) { Color debugColor2 = legs[k].debugColor; Vector3 val2 = Quaternion.AngleAxis(360f * legStates[k].cycleTime, -Vector3.forward) * -Vector3.up; drawArea.DrawRect(val2 - Vector3.one * 0.1f, val2 + Vector3.one * 0.1f, debugColor2); float num3 = Util.CyclicDiff(normalizedTime, legStates[k].stanceTime); val2 = Quaternion.AngleAxis(360f * num3, -Vector3.forward) * -Vector3.up * 0.8f; drawArea.DrawRect(val2 - Vector3.one * 0.05f, val2 + Vector3.one * 0.05f, debugColor2); } GL.End(); } public void RenderMotionCycles() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) float num = Camera.main.pixelHeight; Color c = default(Color); ((Color)(ref c))..ctor(0.7f, 0.7f, 0.7f, 1f); for (int i = 0; i < legC.cycleMotions.Length; i++) { DrawArea drawArea = new DrawArea(new Vector3(0.01f * num + 0.2f * num * (float)i, 0.31f * num, 0f), new Vector3(0.19f * num + 0.2f * num * (float)i, 0.49f * num, 0f)); drawArea.canvasMin = new Vector3(-1.1f, -1.1f, 0f); drawArea.canvasMax = new Vector3(1.1f, 1.1f, 0f); GL.Begin(1); drawArea.DrawLine(-0.9f * Vector3.up, -1.1f * Vector3.up, c); for (int j = 0; j < 90; j++) { drawArea.DrawLine(Quaternion.AngleAxis((float)j / 90f * 360f, Vector3.forward) * Vector3.up, Quaternion.AngleAxis((float)(j + 1) / 90f * 360f, Vector3.forward) * Vector3.up, c); } GL.End(); GL.Begin(7); for (int k = 0; k < legs.Length; k++) { Color debugColor = legs[k].debugColor; float num2 = legC.cycleMotions[i].cycles[k].stanceTime - legC.cycleMotions[i].cycleOffset * (0.5f + 0.5f * Mathf.Sin(Time.time * 2f)); Vector3 val = Quaternion.AngleAxis(360f * num2, -Vector3.forward) * -Vector3.up; drawArea.DrawRect(val - Vector3.one * 0.1f, val + Vector3.one * 0.1f, debugColor); } GL.End(); } } public void RenderFootMarkers() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) GL.Begin(1); GL.End(); GL.Begin(7); for (int i = 0; i < legs.Length; i++) { for (int j = 0; j < 3; j++) { if (legStates[i] != null) { Matrix4x4 val; switch (j) { case 0: val = legStates[i].stepFromMatrix; GL.Color(legs[i].debugColor * 0.8f); break; case 1: val = legStates[i].stepToMatrix; GL.Color(legs[i].debugColor); break; default: val = legStates[i].stepToMatrix; GL.Color(legs[i].debugColor * 0.4f); break; } Vector3 val2 = ((Matrix4x4)(ref val)).MultiplyPoint3x4(Vector3.zero); Vector3 val3 = ((Matrix4x4)(ref val)).MultiplyVector(legStates[i].heelToetipVector); Vector3 val4 = ((Matrix4x4)(ref val)).MultiplyVector(Vector3.up); Vector3 val5 = Quaternion.AngleAxis(90f, val4) * val3; Vector3 val6 = ((Vector3)(ref val5)).normalized * legs[i].footWidth * scale; val2 += ((Vector3)(ref val4)).normalized * ((Vector3)(ref val6)).magnitude / 20f; if (j == 2) { val2 += legStates[i].stepToPositionGoal - legStates[i].stepToPosition; } GL.Vertex(val2 + val6 / 2f); GL.Vertex(val2 - val6 / 2f); GL.Vertex(val2 - val6 / 4f + val3); GL.Vertex(val2 + val6 / 4f + val3); } } } GL.End(); } private void OnGUI() { if (renderAnimationStates) { RenderAnimationStates(); } } public void RenderAnimationStates() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) int num = 0; foreach (AnimationState item in ((Component)this).GetComponent()) { AnimationState val = item; string name = val.name; float num2 = 0.5f + 0.5f * val.weight; GUI.color = new Color(0f, 0f, num2, 1f); if (val.enabled) { GUI.color = new Color(num2, num2, num2, 1f); } name = name + " " + val.weight.ToString("0.000"); GUI.Label(new Rect((float)(Screen.width - 200), (float)(10 + 20 * num), 200f, 30f), name); num++; } } private void MonitorFootsteps() { for (int i = 0; i < legStates.Length; i++) { LegState legState = legStates[i]; switch (legState.phase) { case LegCyclePhase.Stance: if (legState.cycleTime >= legState.liftTime && legState.cycleTime < legState.landTime) { legState.phase = LegCyclePhase.Lift; ((Component)this).SendMessage("OnFootLift", (SendMessageOptions)1); } break; case LegCyclePhase.Lift: if (legState.cycleTime >= legState.liftoffTime || legState.cycleTime < legState.liftTime) { legState.phase = LegCyclePhase.Flight; ((Component)this).SendMessage("OnFootLiftoff", (SendMessageOptions)1); } break; case LegCyclePhase.Flight: if (legState.cycleTime >= legState.strikeTime || legState.cycleTime < legState.liftoffTime) { legState.phase = LegCyclePhase.Land; ((Component)this).SendMessage("OnFootStrike", (SendMessageOptions)1); } break; case LegCyclePhase.Land: if (legState.cycleTime >= legState.landTime || legState.cycleTime < legState.strikeTime) { legState.phase = LegCyclePhase.Stance; ((Component)this).SendMessage("OnFootLand", (SendMessageOptions)1); } break; } } } } [Serializable] public class LegInfo { public Transform hip; public Transform ankle; public Transform toe; public float footWidth; public float footLength; public Vector2 footOffset; [HideInInspector] public Transform[] legChain; [HideInInspector] public Transform[] footChain; [HideInInspector] public float legLength; [HideInInspector] public Vector3 ankleHeelVector; [HideInInspector] public Vector3 toeToetipVector; [HideInInspector] public Color debugColor; } [Serializable] public class MotionGroupInfo { public string name; public IMotionAnalyzer[] motions; public Interpolator interpolator; public float[] GetMotionWeights(Vector3 velocity) { return interpolator.Interpolate(new float[3] { velocity.x, velocity.y, velocity.z }); } } [Serializable] public class LegController : MonoBehaviour { public float groundPlaneHeight; public AnimationClip groundedPose; public Transform rootBone; public LegInfo[] legs; public MotionAnalyzer[] sourceAnimations; [HideInInspector] public bool initialized = false; [HideInInspector] public MotionAnalyzerBackwards[] sourceAnimationsBackwards; [HideInInspector] public Vector3 m_HipAverage; [HideInInspector] public Vector3 m_HipAverageGround; [HideInInspector] public IMotionAnalyzer[] m_Motions; [HideInInspector] public IMotionAnalyzer[] m_CycleMotions; [HideInInspector] public MotionGroupInfo[] m_MotionGroups; [HideInInspector] public IMotionAnalyzer[] m_NonGroupMotions; public Transform root => rootBone; public Vector3 hipAverage => m_HipAverage; public Vector3 hipAverageGround => m_HipAverageGround; public IMotionAnalyzer[] motions => m_Motions; public IMotionAnalyzer[] cycleMotions => m_CycleMotions; public MotionGroupInfo[] motionGroups => m_MotionGroups; public IMotionAnalyzer[] nonGroupMotions => m_NonGroupMotions; public void InitFootData(int leg) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) groundedPose.SampleAnimation(((Component)this).gameObject, 0f); Vector3 val = Quaternion.AngleAxis((float)leg * 360f / (float)legs.Length, Vector3.one) * Vector3.right; legs[leg].debugColor = new Color(val.x, val.y, val.z); Matrix4x4 val2 = Util.RelativeMatrix(legs[leg].ankle, ((Component)this).gameObject.transform); Vector3 val3 = ((Matrix4x4)(ref val2)).MultiplyPoint(Vector3.zero); Vector3 val4 = val3; val4.y = groundPlaneHeight; Matrix4x4 val5 = Util.RelativeMatrix(legs[leg].toe, ((Component)this).gameObject.transform); Vector3 val6 = ((Matrix4x4)(ref val5)).MultiplyPoint(Vector3.zero); Vector3 val7 = val6; val7.y = groundPlaneHeight; Vector3 val8 = (val4 + val7) / 2f; Vector3 val9; if (val6 == val3) { val9 = ((Matrix4x4)(ref val2)).MultiplyVector(legs[leg].ankle.localPosition); val9.y = 0f; val9 = ((Vector3)(ref val9)).normalized; } else { Vector3 val10 = val7 - val4; val9 = ((Vector3)(ref val10)).normalized; } Vector3 val11 = Vector3.Cross(Vector3.up, val9); legs[leg].ankleHeelVector = val8 + ((0f - legs[leg].footLength) / 2f + legs[leg].footOffset.y) * val9 + legs[leg].footOffset.x * val11; LegInfo obj = legs[leg]; Matrix4x4 inverse = ((Matrix4x4)(ref val2)).inverse; obj.ankleHeelVector = ((Matrix4x4)(ref inverse)).MultiplyVector(legs[leg].ankleHeelVector - val3); legs[leg].toeToetipVector = val8 + (legs[leg].footLength / 2f + legs[leg].footOffset.y) * val9 + legs[leg].footOffset.x * val11; LegInfo obj2 = legs[leg]; Matrix4x4 inverse2 = ((Matrix4x4)(ref val5)).inverse; obj2.toeToetipVector = ((Matrix4x4)(ref inverse2)).MultiplyVector(legs[leg].toeToetipVector - val6); } public void Init() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) initialized = false; Debug.Log((object)("Initializing " + ((Object)this).name + " Locomotion System...")); if ((Object)(object)rootBone == (Object)null) { if ((Object)(object)legs[0].hip == (Object)null) { Debug.LogError((object)(((Object)this).name + ": Leg Transforms are null."), (Object)(object)this); return; } rootBone = legs[0].hip; while ((Object)(object)root.parent != (Object)(object)((Component)this).transform) { rootBone = root.parent; } } m_HipAverage = Vector3.zero; for (int i = 0; i < legs.Length; i++) { if ((Object)(object)legs[i].toe == (Object)null) { legs[i].toe = legs[i].ankle; } legs[i].legChain = GetTransformChain(legs[i].hip, legs[i].ankle); legs[i].footChain = GetTransformChain(legs[i].ankle, legs[i].toe); legs[i].legLength = 0f; for (int j = 0; j < legs[i].legChain.Length - 1; j++) { LegInfo obj = legs[i]; float legLength = obj.legLength; Vector3 val = ((Component)this).transform.InverseTransformPoint(legs[i].legChain[j + 1].position) - ((Component)this).transform.InverseTransformPoint(legs[i].legChain[j].position); obj.legLength = legLength + ((Vector3)(ref val)).magnitude; } m_HipAverage += ((Component)this).transform.InverseTransformPoint(legs[i].legChain[0].position); InitFootData(i); } m_HipAverage /= (float)legs.Length; m_HipAverageGround = m_HipAverage; m_HipAverageGround.y = groundPlaneHeight; } public void Init2() { List list = new List(); for (int i = 0; i < sourceAnimations.Length; i++) { Debug.Log((object)("Analysing sourceAnimations[" + i + "]: " + sourceAnimations[i].name)); sourceAnimations[i].Analyze(((Component)this).gameObject); if (sourceAnimations[i].alsoUseBackwards) { MotionAnalyzerBackwards motionAnalyzerBackwards = new MotionAnalyzerBackwards(); motionAnalyzerBackwards.orig = sourceAnimations[i]; motionAnalyzerBackwards.Analyze(((Component)this).gameObject); list.Add(motionAnalyzerBackwards); } } sourceAnimationsBackwards = list.ToArray(); groundedPose.SampleAnimation(((Component)this).gameObject, 0f); initialized = true; Debug.Log((object)("Initializing " + ((Object)this).name + " Locomotion System... Done!")); } private void Awake() { //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) if (!initialized) { Debug.LogError((object)(((Object)this).name + ": Locomotion System has not been initialized."), (Object)(object)this); return; } m_Motions = new IMotionAnalyzer[sourceAnimations.Length + sourceAnimationsBackwards.Length]; for (int i = 0; i < sourceAnimations.Length; i++) { motions[i] = sourceAnimations[i]; } for (int j = 0; j < sourceAnimationsBackwards.Length; j++) { motions[sourceAnimations.Length + j] = sourceAnimationsBackwards[j]; } int num = 0; for (int k = 0; k < motions.Length; k++) { if (motions[k].motionType == MotionType.WalkCycle) { num++; } } m_CycleMotions = new IMotionAnalyzer[num]; int num2 = 0; for (int l = 0; l < motions.Length; l++) { if (motions[l].motionType == MotionType.WalkCycle) { cycleMotions[num2] = motions[l]; num2++; } } List list = new List(); List list2 = new List(); List> list3 = new List>(); List list4 = new List(); for (int m = 0; m < motions.Length; m++) { if (motions[m].motionGroup == "") { list4.Add(motions[m]); continue; } string motionGroup = motions[m].motionGroup; if (!list.Contains(motionGroup)) { MotionGroupInfo motionGroupInfo = new MotionGroupInfo(); motionGroupInfo.name = motionGroup; list2.Add(motionGroupInfo); list.Add(motionGroup); list3.Add(new List()); } list3[list.IndexOf(motionGroup)].Add(motions[m]); } m_NonGroupMotions = list4.ToArray(); m_MotionGroups = list2.ToArray(); for (int n = 0; n < motionGroups.Length; n++) { motionGroups[n].motions = list3[n].ToArray(); } for (int num3 = 0; num3 < motionGroups.Length; num3++) { MotionGroupInfo motionGroupInfo2 = motionGroups[num3]; Vector3[] array = (Vector3[])(object)new Vector3[motionGroupInfo2.motions.Length]; float[][] array2 = new float[motionGroupInfo2.motions.Length][]; for (int num4 = 0; num4 < motionGroupInfo2.motions.Length; num4++) { ref Vector3 reference = ref array[num4]; reference = motionGroupInfo2.motions[num4].cycleVelocity; array2[num4] = new float[3] { array[num4].x, array[num4].y, array[num4].z }; } motionGroupInfo2.interpolator = new PolarGradientBandInterpolator(array2); } CalculateTimeOffsets(); } public Transform[] GetTransformChain(Transform upper, Transform lower) { Transform val = lower; int num = 1; while ((Object)(object)val != (Object)(object)upper) { val = val.parent; num++; } Transform[] array = (Transform[])(object)new Transform[num]; val = lower; for (int i = 0; i < num; i++) { array[num - 1 - i] = val; val = val.parent; } return array; } public void CalculateTimeOffsets() { //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) float[] array = new float[cycleMotions.Length]; float[] array2 = new float[cycleMotions.Length]; for (int i = 0; i < cycleMotions.Length; i++) { array[i] = 0f; } int num = (cycleMotions.Length * cycleMotions.Length - cycleMotions.Length) / 2; int num2 = 0; bool flag = false; Vector2 val = default(Vector2); Vector2 val2 = default(Vector2); while (num2 < 100 && !flag) { for (int j = 0; j < cycleMotions.Length; j++) { array2[j] = 0f; } for (int k = 1; k < cycleMotions.Length; k++) { for (int l = 0; l < k; l++) { for (int m = 0; m < legs.Length; m++) { float num3 = cycleMotions[k].cycles[m].stanceTime + array[k]; float num4 = cycleMotions[l].cycles[m].stanceTime + array[l]; ((Vector2)(ref val))..ctor(Mathf.Cos(num3 * 2f * (float)Math.PI), Mathf.Sin(num3 * 2f * (float)Math.PI)); ((Vector2)(ref val2))..ctor(Mathf.Cos(num4 * 2f * (float)Math.PI), Mathf.Sin(num4 * 2f * (float)Math.PI)); Vector2 val3 = val2 - val; Vector2 val4 = val + val3 * 0.1f; Vector2 val5 = val2 - val3 * 0.1f; float num5 = Util.Mod(Mathf.Atan2(val4.y, val4.x) / 2f / (float)Math.PI); float num6 = Util.Mod(Mathf.Atan2(val5.y, val5.x) / 2f / (float)Math.PI); float num7 = Util.Mod(num5 - num3); float num8 = Util.Mod(num6 - num4); if (num7 > 0.5f) { num7 -= 1f; } if (num8 > 0.5f) { num8 -= 1f; } array2[k] += num7 * 5f / (float)num; array2[l] += num8 * 5f / (float)num; } } } float num9 = 0f; for (int n = 0; n < cycleMotions.Length; n++) { array[n] += array2[n]; num9 = Mathf.Max(num9, Mathf.Abs(array2[n])); } num2++; if ((double)num9 < 0.0001) { flag = true; } } for (int num10 = 0; num10 < cycleMotions.Length; num10++) { cycleMotions[num10].cycleOffset = array[num10]; for (int num11 = 0; num11 < legs.Length; num11++) { cycleMotions[num10].cycles[num11].stanceTime = Util.Mod(cycleMotions[num10].cycles[num11].stanceTime + array[num10]); } } } } [Serializable] public class LegCycleSample { public Matrix4x4 ankleMatrix; public Vector3 heel; public Matrix4x4 toeMatrix; public Vector3 toetip; public Vector3 middle; public float balance; public Vector3 footBase; public Vector3 footBaseNormalized; } [Serializable] public class TimeStampInfo { public string label; public float time; } [Serializable] public class CycleDebugInfo { public float toeLiftTime; public float toeLandTime; public float ankleLiftTime; public float ankleLandTime; public float footLiftTime; public float footLandTime; } [Serializable] public class LegCycleData { public Vector3 cycleCenter; public float cycleScaling; public Vector3 cycleDirection; public float stanceTime; public float liftTime; public float liftoffTime; public float postliftTime; public float prelandTime; public float strikeTime; public float landTime; public float cycleDistance; public Vector3 stancePosition; public Vector3 heelToetipVector; public LegCycleSample[] samples; public int stanceIndex; public CycleDebugInfo debugInfo; } [Serializable] public enum MotionType { WalkCycle, Grounded } [Serializable] public class MotionAnalyzer : IMotionAnalyzer { private delegate Vector3 GetVector3Member(LegCycleSample s); private delegate float GetFloatMember(LegCycleSample s); public bool alsoUseBackwards = false; public bool fixFootSkating = false; [HideInInspector] public LegCycleData[] m_cycles; [HideInInspector] public int m_samples; [HideInInspector] public Vector3 m_cycleDirection; [HideInInspector] public float m_cycleDistance; [HideInInspector] public float m_cycleDuration; [HideInInspector] public float m_cycleSpeed; public float nativeSpeed; [HideInInspector] public float m_cycleOffset; [HideInInspector] public Vector3 graphMin; [HideInInspector] public Vector3 graphMax; [HideInInspector] public GameObject gameObject; [HideInInspector] public int legs; [HideInInspector] public LegController legC; public override LegCycleData[] cycles => m_cycles; public override int samples => m_samples; public override Vector3 cycleDirection => m_cycleDirection; public override float cycleDistance => m_cycleDistance; public override Vector3 cycleVector => m_cycleDirection * m_cycleDistance; public override float cycleDuration => m_cycleDuration; public override float cycleSpeed => m_cycleSpeed; public override Vector3 cycleVelocity => m_cycleDirection * m_cycleSpeed; public override float cycleOffset { get { return m_cycleOffset; } set { m_cycleOffset = value; } } private float FindContactTime(LegCycleData data, bool useToe, int searchDirection, float yRange, float threshold) { int num = 5; float num2 = 0f; int num3 = data.stanceIndex; for (int i = 0; i < samples && i > -samples; i += searchDirection) { int[] array = new int[3]; float[] array2 = new float[3]; for (int j = 0; j < 3; j++) { array[j] = Util.Mod(i + data.stanceIndex - num + num * j, samples); if (useToe) { array2[j] = data.samples[array[j]].toetip.y; } else { array2[j] = data.samples[array[j]].heel.y; } } float num4 = Mathf.Atan((array2[2] - array2[1]) * 10f / yRange) - Mathf.Atan((array2[1] - array2[0]) * 10f / yRange); if (array2[1] > legC.groundPlaneHeight && num4 > num2 && Mathf.Sign(array2[2] - array2[0]) == Mathf.Sign((float)searchDirection)) { num2 = num4; num3 = array[1]; } if (array2[1] > legC.groundPlaneHeight + yRange * threshold) { break; } } return GetTimeFromIndex(Util.Mod(num3 - data.stanceIndex, samples)); } private float FindSwingChangeTime(LegCycleData data, int searchDirection, float threshold) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) int num = samples / 5; float num2 = 0f; for (int i = 0; i < samples && i > -samples; i += searchDirection) { int[] array = new int[3]; float[] array2 = new float[3]; for (int j = 0; j < 3; j++) { array[j] = Util.Mod(i + data.stanceIndex - num + num * j, samples); array2[j] = Vector3.Dot(data.samples[array[j]].footBase, data.cycleDirection); } float num3 = array2[2] - array2[0]; if (i == 0) { num2 = num3; } if (Mathf.Abs((num3 - num2) / num2) > threshold) { return GetTimeFromIndex(Util.Mod(array[1] - data.stanceIndex, samples)); } } return Util.Mod((float)searchDirection * -0.01f); } private float GetFootGrounding(int leg, float time) { if (time <= cycles[leg].liftTime || time >= cycles[leg].landTime) { return 0f; } if (time >= cycles[leg].postliftTime && time <= cycles[leg].prelandTime) { return 1f; } return (!(time < cycles[leg].postliftTime)) ? (1f - (time - cycles[leg].prelandTime) / (cycles[leg].landTime - cycles[leg].prelandTime)) : ((time - cycles[leg].liftTime) / (cycles[leg].postliftTime - cycles[leg].liftTime)); } private float GetFootGroundingOrig(int leg, float time) { if (time <= cycles[leg].liftTime || time >= cycles[leg].landTime) { return 0f; } if (time >= cycles[leg].liftoffTime && time <= cycles[leg].strikeTime) { return 1f; } return (!(time < cycles[leg].liftoffTime)) ? (1f - (time - cycles[leg].strikeTime) / (cycles[leg].landTime - cycles[leg].strikeTime)) : ((time - cycles[leg].liftTime) / (cycles[leg].liftoffTime - cycles[leg].liftTime)); } private int GetIndexFromTime(float time) { return Util.Mod((int)((double)(time * (float)samples) + 0.5), samples); } private float GetTimeFromIndex(int index) { return (float)index * 1f / (float)samples; } private Vector3 FootPositionNormalized(LegCycleSample s) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return s.footBaseNormalized; } private Vector3 FootPosition(LegCycleSample s) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return s.footBase; } private float Balance(LegCycleSample s) { return s.balance; } private Vector3 GetVector3AtTime(int leg, float flightTime, GetVector3Member get) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) flightTime = Mathf.Clamp01(flightTime); int num = (int)(flightTime * (float)samples); float num2 = flightTime * (float)samples - (float)num; if (num >= samples - 1) { num = samples - 1; num2 = 0f; } num = Util.Mod(num + cycles[leg].stanceIndex, samples); return get(cycles[leg].samples[num]) * (1f - num2) + get(cycles[leg].samples[Util.Mod(num + 1, samples)]) * num2; } private float GetFloatAtTime(int leg, float flightTime, GetFloatMember get) { flightTime = Mathf.Clamp01(flightTime); int num = (int)(flightTime * (float)samples); float num2 = flightTime * (float)samples - (float)num; if (num >= samples - 1) { num = samples - 1; num2 = 0f; } num = Util.Mod(num + cycles[leg].stanceIndex, samples); return get(cycles[leg].samples[num]) * (1f - num2) + get(cycles[leg].samples[Util.Mod(num + 1, samples)]) * num2; } public override Vector3 GetFlightFootPosition(int leg, float flightTime, int phase) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (motionType != MotionType.WalkCycle) { switch (phase) { case 0: return Vector3.zero; case 1: return ((0f - Mathf.Cos(flightTime * (float)Math.PI)) / 2f + 0.5f) * Vector3.forward; case 2: return Vector3.forward; } } float num = 0f; num = phase switch { 0 => Mathf.Lerp(0f, cycles[leg].liftoffTime, flightTime), 1 => Mathf.Lerp(cycles[leg].liftoffTime, cycles[leg].strikeTime, flightTime), _ => Mathf.Lerp(cycles[leg].strikeTime, 1f, flightTime), }; int num2 = (int)(num * (float)samples); float num3 = num * (float)samples - (float)num2; if (num2 >= samples - 1) { num2 = samples - 1; num3 = 0f; } num2 = Util.Mod(num2 + cycles[leg].stanceIndex, samples); return cycles[leg].samples[num2].footBaseNormalized * (1f - num3) + cycles[leg].samples[Util.Mod(num2 + 1, samples)].footBaseNormalized * num3; } public static Vector3 GetHeelOffset(Transform ankleT, Vector3 ankleHeelVector, Transform toeT, Vector3 toeToetipVector, Vector3 stanceFootVector, Quaternion footBaseRotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 localToWorldMatrix = ankleT.localToWorldMatrix; Vector3 val = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint(ankleHeelVector); Matrix4x4 localToWorldMatrix2 = toeT.localToWorldMatrix; Vector3 val2 = ((Matrix4x4)(ref localToWorldMatrix2)).MultiplyPoint(toeToetipVector); float footBalance = GetFootBalance((Quaternion.Inverse(footBaseRotation) * val).y, (Quaternion.Inverse(footBaseRotation) * val2).y, ((Vector3)(ref stanceFootVector)).magnitude); return footBalance * (footBaseRotation * stanceFootVector + (val - val2)); } public static Vector3 GetAnklePosition(Transform ankleT, Vector3 ankleHeelVector, Transform toeT, Vector3 toeToetipVector, Vector3 stanceFootVector, Vector3 footBasePosition, Quaternion footBaseRotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) Vector3 heelOffset = GetHeelOffset(ankleT, ankleHeelVector, toeT, toeToetipVector, stanceFootVector, footBaseRotation); Vector3 val = footBasePosition + heelOffset; Matrix4x4 localToWorldMatrix = ankleT.localToWorldMatrix; return val + ((Matrix4x4)(ref localToWorldMatrix)).MultiplyVector(ankleHeelVector * -1f); } public static float GetFootBalance(float heelElevation, float toeElevation, float footLength) { return Mathf.Atan((heelElevation - toeElevation) / footLength * 20f) / (float)Math.PI + 0.5f; } private void FindCycleAxis(int leg) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) cycles[leg].cycleCenter = Vector3.zero; for (int i = 0; i < samples; i++) { LegCycleSample legCycleSample = cycles[leg].samples[i]; LegCycleData obj = cycles[leg]; obj.cycleCenter += Util.ProjectOntoPlane(legCycleSample.middle, Vector3.up); } LegCycleData obj2 = cycles[leg]; obj2.cycleCenter /= (float)samples; Vector3 val = cycles[leg].cycleCenter; float num = 0f; for (int j = 0; j < samples; j++) { LegCycleSample legCycleSample2 = cycles[leg].samples[j]; Vector3 val2 = Util.ProjectOntoPlane(legCycleSample2.middle, Vector3.up); Vector3 val3 = val2 - cycles[leg].cycleCenter; float magnitude = ((Vector3)(ref val3)).magnitude; if (magnitude > num) { val = val2; num = magnitude; } } Vector3 val4 = val; num = 0f; for (int k = 0; k < samples; k++) { LegCycleSample legCycleSample3 = cycles[leg].samples[k]; Vector3 val5 = Util.ProjectOntoPlane(legCycleSample3.middle, Vector3.up); Vector3 val6 = val5 - val; float magnitude2 = ((Vector3)(ref val6)).magnitude; if (magnitude2 > num) { val4 = val5; num = magnitude2; } } LegCycleData obj3 = cycles[leg]; Vector3 val7 = val4 - val; obj3.cycleDirection = ((Vector3)(ref val7)).normalized; LegCycleData obj4 = cycles[leg]; Vector3 val8 = val4 - val; obj4.cycleScaling = ((Vector3)(ref val8)).magnitude; } public override void Analyze(GameObject o) { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0a15: Unknown result type (might be due to invalid IL or missing references) //IL_0a1a: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0a45: Unknown result type (might be due to invalid IL or missing references) //IL_0a53: Unknown result type (might be due to invalid IL or missing references) //IL_0a58: Unknown result type (might be due to invalid IL or missing references) //IL_0a5d: Unknown result type (might be due to invalid IL or missing references) //IL_0a8d: Unknown result type (might be due to invalid IL or missing references) //IL_0aea: Unknown result type (might be due to invalid IL or missing references) //IL_0af6: Unknown result type (might be due to invalid IL or missing references) //IL_0afb: Unknown result type (might be due to invalid IL or missing references) //IL_0b35: Unknown result type (might be due to invalid IL or missing references) //IL_0b88: Unknown result type (might be due to invalid IL or missing references) //IL_0b8d: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_0f5d: Unknown result type (might be due to invalid IL or missing references) //IL_0f63: Unknown result type (might be due to invalid IL or missing references) //IL_09b7: Unknown result type (might be due to invalid IL or missing references) //IL_09bc: Unknown result type (might be due to invalid IL or missing references) //IL_0f05: Unknown result type (might be due to invalid IL or missing references) //IL_0f13: Unknown result type (might be due to invalid IL or missing references) //IL_0f18: Unknown result type (might be due to invalid IL or missing references) //IL_0f1d: Unknown result type (might be due to invalid IL or missing references) //IL_0bf9: Unknown result type (might be due to invalid IL or missing references) //IL_0bfe: Unknown result type (might be due to invalid IL or missing references) //IL_0d88: Unknown result type (might be due to invalid IL or missing references) //IL_0d8d: Unknown result type (might be due to invalid IL or missing references) //IL_0da9: Unknown result type (might be due to invalid IL or missing references) //IL_0de6: Unknown result type (might be due to invalid IL or missing references) //IL_0deb: Unknown result type (might be due to invalid IL or missing references) //IL_0df0: Unknown result type (might be due to invalid IL or missing references) //IL_0df6: Unknown result type (might be due to invalid IL or missing references) //IL_0dfb: Unknown result type (might be due to invalid IL or missing references) //IL_0dfd: Unknown result type (might be due to invalid IL or missing references) //IL_0e02: Unknown result type (might be due to invalid IL or missing references) //IL_0e10: Unknown result type (might be due to invalid IL or missing references) //IL_0e15: Unknown result type (might be due to invalid IL or missing references) //IL_0c27: Unknown result type (might be due to invalid IL or missing references) //IL_0c2c: Unknown result type (might be due to invalid IL or missing references) //IL_0c42: Unknown result type (might be due to invalid IL or missing references) //IL_0c79: Unknown result type (might be due to invalid IL or missing references) //IL_0c7e: Unknown result type (might be due to invalid IL or missing references) //IL_0c83: Unknown result type (might be due to invalid IL or missing references) //IL_0c89: Unknown result type (might be due to invalid IL or missing references) //IL_0c8e: Unknown result type (might be due to invalid IL or missing references) //IL_0c90: Unknown result type (might be due to invalid IL or missing references) //IL_0c95: Unknown result type (might be due to invalid IL or missing references) //IL_0ca3: Unknown result type (might be due to invalid IL or missing references) //IL_0ca8: Unknown result type (might be due to invalid IL or missing references) //IL_0f8d: Unknown result type (might be due to invalid IL or missing references) //IL_0f93: Unknown result type (might be due to invalid IL or missing references) //IL_0e28: Unknown result type (might be due to invalid IL or missing references) //IL_0e2d: Unknown result type (might be due to invalid IL or missing references) //IL_0e32: Unknown result type (might be due to invalid IL or missing references) //IL_0e39: Unknown result type (might be due to invalid IL or missing references) //IL_0e3e: Unknown result type (might be due to invalid IL or missing references) //IL_0e43: Unknown result type (might be due to invalid IL or missing references) //IL_0cc3: Unknown result type (might be due to invalid IL or missing references) //IL_0cc8: Unknown result type (might be due to invalid IL or missing references) //IL_0ccd: Unknown result type (might be due to invalid IL or missing references) //IL_0cd4: Unknown result type (might be due to invalid IL or missing references) //IL_0cd9: Unknown result type (might be due to invalid IL or missing references) //IL_0cde: Unknown result type (might be due to invalid IL or missing references) //IL_0908: Unknown result type (might be due to invalid IL or missing references) //IL_0941: Unknown result type (might be due to invalid IL or missing references) //IL_0946: Unknown result type (might be due to invalid IL or missing references) //IL_094b: Unknown result type (might be due to invalid IL or missing references) //IL_0999: Unknown result type (might be due to invalid IL or missing references) //IL_099e: Unknown result type (might be due to invalid IL or missing references) //IL_09a3: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"Starting analysis"); gameObject = o; name = ((Object)animation).name; m_samples = 50; legC = gameObject.GetComponent(typeof(LegController)) as LegController; legs = legC.legs.Length; m_cycles = new LegCycleData[legs]; for (int i = 0; i < legs; i++) { cycles[i] = new LegCycleData(); cycles[i].samples = new LegCycleSample[samples + 1]; for (int j = 0; j < samples + 1; j++) { cycles[i].samples[j] = new LegCycleSample(); } cycles[i].debugInfo = new CycleDebugInfo(); } graphMin = new Vector3(0f, 1000f, 1000f); graphMax = new Vector3(0f, -1000f, -1000f); for (int k = 0; k < legs; k++) { Transform ankle = legC.legs[k].ankle; Transform toe = legC.legs[k].toe; float num = 0f; float num2 = 1000f; float num3 = -1000f; float num4 = 1000f; float num5 = -1000f; for (int l = 0; l < samples + 1; l++) { LegCycleSample legCycleSample = cycles[k].samples[l]; animation.SampleAnimation(gameObject, (float)l * 1f / (float)samples * animation.length); legCycleSample.ankleMatrix = Util.RelativeMatrix(ankle, gameObject.transform); legCycleSample.toeMatrix = Util.RelativeMatrix(toe, gameObject.transform); legCycleSample.heel = ((Matrix4x4)(ref legCycleSample.ankleMatrix)).MultiplyPoint(legC.legs[k].ankleHeelVector); legCycleSample.toetip = ((Matrix4x4)(ref legCycleSample.toeMatrix)).MultiplyPoint(legC.legs[k].toeToetipVector); legCycleSample.middle = (legCycleSample.heel + legCycleSample.toetip) / 2f; legCycleSample.balance = GetFootBalance(legCycleSample.heel.y, legCycleSample.toetip.y, legC.legs[k].footLength); num2 = Mathf.Min(num2, legCycleSample.heel.y); num4 = Mathf.Min(num4, legCycleSample.toetip.y); num3 = Mathf.Max(num3, legCycleSample.heel.y); num5 = Mathf.Max(num5, legCycleSample.toetip.y); } num = Mathf.Max(num3 - num2, num5 - num4); if (motionType == MotionType.WalkCycle) { FindCycleAxis(k); float num6 = float.PositiveInfinity; for (int m = 0; m < samples + 1; m++) { LegCycleSample legCycleSample2 = cycles[k].samples[m]; float num7 = Mathf.Max(legCycleSample2.heel.y, legCycleSample2.toetip.y) / num; Vector3 val = Util.ProjectOntoPlane(legCycleSample2.middle - cycles[k].cycleCenter, Vector3.up); float num8 = num7 + Mathf.Abs(((Vector3)(ref val)).magnitude) / cycles[k].cycleScaling; if (num8 < num6) { cycles[k].stanceIndex = m; num6 = num8; } } } else { cycles[k].cycleDirection = Vector3.forward; cycles[k].cycleScaling = 0f; cycles[k].stanceIndex = 0; } cycles[k].stanceTime = GetTimeFromIndex(cycles[k].stanceIndex); LegCycleSample legCycleSample3 = cycles[k].samples[cycles[k].stanceIndex]; animation.SampleAnimation(gameObject, cycles[k].stanceTime * animation.length); cycles[k].heelToetipVector = ((Matrix4x4)(ref legCycleSample3.toeMatrix)).MultiplyPoint(legC.legs[k].toeToetipVector) - ((Matrix4x4)(ref legCycleSample3.ankleMatrix)).MultiplyPoint(legC.legs[k].ankleHeelVector); cycles[k].heelToetipVector = Util.ProjectOntoPlane(cycles[k].heelToetipVector, Vector3.up); cycles[k].heelToetipVector = ((Vector3)(ref cycles[k].heelToetipVector)).normalized * legC.legs[k].footLength; for (int n = 0; n < samples + 1; n++) { LegCycleSample legCycleSample4 = cycles[k].samples[n]; legCycleSample4.footBase = legCycleSample4.heel * (1f - legCycleSample4.balance) + (legCycleSample4.toetip - cycles[k].heelToetipVector) * legCycleSample4.balance; } cycles[k].stancePosition = legCycleSample3.footBase; cycles[k].stancePosition.y = legC.groundPlaneHeight; if (motionType == MotionType.WalkCycle) { float num9 = FindContactTime(cycles[k], useToe: false, 1, num, 0.1f); cycles[k].debugInfo.ankleLiftTime = num9; float num10 = FindContactTime(cycles[k], useToe: true, 1, num, 0.1f); cycles[k].debugInfo.toeLiftTime = num10; if (num9 < num10) { cycles[k].liftTime = num9; cycles[k].liftoffTime = num10; } else { cycles[k].liftTime = num10; cycles[k].liftoffTime = num9; } num9 = FindSwingChangeTime(cycles[k], 1, 0.5f); cycles[k].debugInfo.footLiftTime = num9; if (cycles[k].liftoffTime > num9) { cycles[k].liftoffTime = num9; if (cycles[k].liftTime > cycles[k].liftoffTime) { cycles[k].liftTime = cycles[k].liftoffTime; } } num9 = FindContactTime(cycles[k], useToe: false, -1, num, 0.1f); num10 = FindContactTime(cycles[k], useToe: true, -1, num, 0.1f); if (num9 < num10) { cycles[k].strikeTime = num9; cycles[k].landTime = num10; } else { cycles[k].strikeTime = num10; cycles[k].landTime = num9; } num9 = FindSwingChangeTime(cycles[k], -1, 0.5f); cycles[k].debugInfo.footLandTime = num9; if (cycles[k].strikeTime < num9) { cycles[k].strikeTime = num9; if (cycles[k].landTime < cycles[k].strikeTime) { cycles[k].landTime = cycles[k].strikeTime; } } float num11 = 0.2f; cycles[k].postliftTime = cycles[k].liftoffTime; if (cycles[k].postliftTime < cycles[k].liftTime + num11) { cycles[k].postliftTime = cycles[k].liftTime + num11; } cycles[k].prelandTime = cycles[k].strikeTime; if (cycles[k].prelandTime > cycles[k].landTime - num11) { cycles[k].prelandTime = cycles[k].landTime - num11; } Vector3 val2 = cycles[k].samples[GetIndexFromTime(Util.Mod(cycles[k].liftoffTime + cycles[k].stanceTime))].footBase - cycles[k].samples[GetIndexFromTime(Util.Mod(cycles[k].strikeTime + cycles[k].stanceTime))].footBase; val2.y = 0f; cycles[k].cycleDistance = ((Vector3)(ref val2)).magnitude / (cycles[k].liftoffTime - cycles[k].strikeTime + 1f); cycles[k].cycleDirection = -((Vector3)(ref val2)).normalized; } else { cycles[k].cycleDirection = Vector3.zero; cycles[k].cycleDistance = 0f; } graphMax.y = Mathf.Max(graphMax.y, Mathf.Max(num3, num5)); } m_cycleDistance = 0f; m_cycleDirection = Vector3.zero; for (int num12 = 0; num12 < legs; num12++) { m_cycleDistance += cycles[num12].cycleDistance; m_cycleDirection += cycles[num12].cycleDirection; Debug.Log((object)string.Concat("Cycle direction of leg ", num12, " is ", cycles[num12].cycleDirection, " with step distance ", cycles[num12].cycleDistance)); } m_cycleDistance /= legs; m_cycleDirection /= (float)legs; m_cycleDuration = animation.length; m_cycleSpeed = cycleDistance / cycleDuration; Debug.Log((object)string.Concat("Overall cycle direction is ", m_cycleDirection, " with step distance ", m_cycleDistance, " and speed ", m_cycleSpeed)); nativeSpeed = m_cycleSpeed * gameObject.transform.localScale.x; for (int num13 = 0; num13 < legs; num13++) { if (motionType == MotionType.WalkCycle) { for (int num14 = 0; num14 < samples; num14++) { int num15 = Util.Mod(num14 + cycles[num13].stanceIndex, samples); LegCycleSample legCycleSample5 = cycles[num13].samples[num15]; float timeFromIndex = GetTimeFromIndex(num14); legCycleSample5.footBaseNormalized = legCycleSample5.footBase; if (fixFootSkating) { Vector3 val3 = (0f - cycles[num13].cycleDistance) * cycles[num13].cycleDirection * (timeFromIndex - cycles[num13].liftoffTime) + cycles[num13].samples[GetIndexFromTime(cycles[num13].liftoffTime + cycles[num13].stanceTime)].footBase; legCycleSample5.footBaseNormalized -= val3; if (cycles[num13].cycleDirection != Vector3.zero) { legCycleSample5.footBaseNormalized = Quaternion.Inverse(Quaternion.LookRotation(cycles[num13].cycleDirection)) * legCycleSample5.footBaseNormalized; } ref Vector3 footBaseNormalized = ref legCycleSample5.footBaseNormalized; footBaseNormalized.z /= cycles[num13].cycleDistance; if (timeFromIndex <= cycles[num13].liftoffTime) { legCycleSample5.footBaseNormalized.z = 0f; } if (timeFromIndex >= cycles[num13].strikeTime) { legCycleSample5.footBaseNormalized.z = 1f; } legCycleSample5.footBaseNormalized.y = legCycleSample5.footBase.y - legC.groundPlaneHeight; } else { Vector3 val4 = (0f - m_cycleDistance) * m_cycleDirection * (timeFromIndex - cycles[num13].liftoffTime * 0f) + cycles[num13].samples[GetIndexFromTime(cycles[num13].liftoffTime * 0f + cycles[num13].stanceTime)].footBase; legCycleSample5.footBaseNormalized -= val4; if (cycles[num13].cycleDirection != Vector3.zero) { legCycleSample5.footBaseNormalized = Quaternion.Inverse(Quaternion.LookRotation(m_cycleDirection)) * legCycleSample5.footBaseNormalized; } ref Vector3 footBaseNormalized2 = ref legCycleSample5.footBaseNormalized; footBaseNormalized2.z /= m_cycleDistance; legCycleSample5.footBaseNormalized.y = legCycleSample5.footBase.y - legC.groundPlaneHeight; } } cycles[num13].samples[samples] = cycles[num13].samples[0]; } else { for (int num16 = 0; num16 < samples; num16++) { int num17 = Util.Mod(num16 + cycles[num13].stanceIndex, samples); LegCycleSample legCycleSample6 = cycles[num13].samples[num17]; legCycleSample6.footBaseNormalized = legCycleSample6.footBase - cycles[num13].stancePosition; } } } for (int num18 = 0; num18 < legs; num18++) { float num19 = Vector3.Dot(cycles[num18].heelToetipVector, cycleDirection); for (int num20 = 0; num20 < samples; num20++) { LegCycleSample legCycleSample7 = cycles[num18].samples[num20]; float num21 = Vector3.Dot(legCycleSample7.footBase, cycleDirection); if (num21 < graphMin.z) { graphMin.z = num21; } if (num21 > graphMax.z) { graphMax.z = num21; } if (num21 + num19 < graphMin.z) { graphMin.z = num21 + num19; } if (num21 + num19 > graphMax.z) { graphMax.z = num21 + num19; } } } graphMin.y = legC.groundPlaneHeight; } private void DrawLine(Vector3 a, Vector3 b, Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) GL.Color(color); GL.Vertex(a); GL.Vertex(b); } private void DrawRay(Vector3 a, Vector3 b, Color color) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) DrawLine(a, a + b, color); } private void DrawDiamond(Vector3 a, float size, Color color) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) Vector3 up = ((Component)Camera.main).transform.up; Vector3 right = ((Component)Camera.main).transform.right; GL.Color(color); GL.Vertex(a + up * size); GL.Vertex(a + right * size); GL.Vertex(a - up * size); GL.Vertex(a - right * size); } public void RenderGraph(MotionAnalyzerDrawOptions opt, Material vertexColorMaterial) { vertexColorMaterial.SetPass(0); if (opt.drawAllFeet) { for (int i = 0; i < legs; i++) { RenderGraphAll(opt, i); } } else { RenderGraphAll(opt, opt.currentLeg); } } public void RenderGraphAll(MotionAnalyzerDrawOptions opt, int currentLeg) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_0992: Unknown result type (might be due to invalid IL or missing references) //IL_0997: Unknown result type (might be due to invalid IL or missing references) //IL_099e: Unknown result type (might be due to invalid IL or missing references) //IL_09a3: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09e8: Unknown result type (might be due to invalid IL or missing references) //IL_09ed: Unknown result type (might be due to invalid IL or missing references) //IL_09f3: Unknown result type (might be due to invalid IL or missing references) //IL_09f8: Unknown result type (might be due to invalid IL or missing references) //IL_09fd: Unknown result type (might be due to invalid IL or missing references) //IL_09ff: Unknown result type (might be due to invalid IL or missing references) //IL_0a0c: Unknown result type (might be due to invalid IL or missing references) //IL_0a11: Unknown result type (might be due to invalid IL or missing references) //IL_0a16: Unknown result type (might be due to invalid IL or missing references) //IL_0a18: Unknown result type (might be due to invalid IL or missing references) //IL_0a1b: Unknown result type (might be due to invalid IL or missing references) //IL_0a20: Unknown result type (might be due to invalid IL or missing references) //IL_0a25: Unknown result type (might be due to invalid IL or missing references) //IL_0a32: Unknown result type (might be due to invalid IL or missing references) //IL_0a37: Unknown result type (might be due to invalid IL or missing references) //IL_0a39: Unknown result type (might be due to invalid IL or missing references) //IL_0a3e: Unknown result type (might be due to invalid IL or missing references) //IL_0a53: Unknown result type (might be due to invalid IL or missing references) //IL_0a65: Unknown result type (might be due to invalid IL or missing references) //IL_0a6a: Unknown result type (might be due to invalid IL or missing references) //IL_0a6c: Unknown result type (might be due to invalid IL or missing references) //IL_0a74: Unknown result type (might be due to invalid IL or missing references) //IL_0a79: Unknown result type (might be due to invalid IL or missing references) //IL_0a81: Unknown result type (might be due to invalid IL or missing references) //IL_0a86: Unknown result type (might be due to invalid IL or missing references) //IL_0a88: Unknown result type (might be due to invalid IL or missing references) //IL_0ab2: Unknown result type (might be due to invalid IL or missing references) //IL_0ad5: Unknown result type (might be due to invalid IL or missing references) //IL_0ada: Unknown result type (might be due to invalid IL or missing references) //IL_0adc: Unknown result type (might be due to invalid IL or missing references) //IL_0ade: Unknown result type (might be due to invalid IL or missing references) //IL_0ae0: Unknown result type (might be due to invalid IL or missing references) //IL_0ae5: Unknown result type (might be due to invalid IL or missing references) //IL_0ae7: Unknown result type (might be due to invalid IL or missing references) //IL_0ae9: Unknown result type (might be due to invalid IL or missing references) //IL_0aee: Unknown result type (might be due to invalid IL or missing references) //IL_0af0: Unknown result type (might be due to invalid IL or missing references) //IL_0afd: Unknown result type (might be due to invalid IL or missing references) //IL_0b04: Unknown result type (might be due to invalid IL or missing references) //IL_0b09: Unknown result type (might be due to invalid IL or missing references) //IL_0b0e: Unknown result type (might be due to invalid IL or missing references) //IL_0b17: Unknown result type (might be due to invalid IL or missing references) //IL_0b1e: Unknown result type (might be due to invalid IL or missing references) //IL_0b23: Unknown result type (might be due to invalid IL or missing references) //IL_0b28: Unknown result type (might be due to invalid IL or missing references) //IL_0b52: Unknown result type (might be due to invalid IL or missing references) //IL_0b75: Unknown result type (might be due to invalid IL or missing references) //IL_0b7a: Unknown result type (might be due to invalid IL or missing references) //IL_0b7c: Unknown result type (might be due to invalid IL or missing references) //IL_0b7e: Unknown result type (might be due to invalid IL or missing references) //IL_0b80: Unknown result type (might be due to invalid IL or missing references) //IL_0b85: Unknown result type (might be due to invalid IL or missing references) //IL_0b87: Unknown result type (might be due to invalid IL or missing references) //IL_0b89: Unknown result type (might be due to invalid IL or missing references) //IL_0b8e: Unknown result type (might be due to invalid IL or missing references) //IL_0b90: Unknown result type (might be due to invalid IL or missing references) //IL_0b9d: Unknown result type (might be due to invalid IL or missing references) //IL_0ba4: Unknown result type (might be due to invalid IL or missing references) //IL_0ba9: Unknown result type (might be due to invalid IL or missing references) //IL_0bae: Unknown result type (might be due to invalid IL or missing references) //IL_0bb7: Unknown result type (might be due to invalid IL or missing references) //IL_0bbe: Unknown result type (might be due to invalid IL or missing references) //IL_0bc3: Unknown result type (might be due to invalid IL or missing references) //IL_0bc8: Unknown result type (might be due to invalid IL or missing references) //IL_0bf2: Unknown result type (might be due to invalid IL or missing references) //IL_0bf7: Unknown result type (might be due to invalid IL or missing references) //IL_0c01: Unknown result type (might be due to invalid IL or missing references) //IL_0c06: Unknown result type (might be due to invalid IL or missing references) //IL_0c12: Unknown result type (might be due to invalid IL or missing references) //IL_0c17: Unknown result type (might be due to invalid IL or missing references) //IL_0c1c: Unknown result type (might be due to invalid IL or missing references) //IL_0c2b: Unknown result type (might be due to invalid IL or missing references) //IL_0c30: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05b7: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0627: Unknown result type (might be due to invalid IL or missing references) //IL_062c: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Unknown result type (might be due to invalid IL or missing references) //IL_063f: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_0649: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_0793: Unknown result type (might be due to invalid IL or missing references) //IL_07a8: Unknown result type (might be due to invalid IL or missing references) //IL_07ad: Unknown result type (might be due to invalid IL or missing references) //IL_07b2: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07e8: Unknown result type (might be due to invalid IL or missing references) //IL_07ef: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_0682: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_0c84: Unknown result type (might be due to invalid IL or missing references) //IL_0c89: Unknown result type (might be due to invalid IL or missing references) //IL_0c95: Unknown result type (might be due to invalid IL or missing references) //IL_0c9a: Unknown result type (might be due to invalid IL or missing references) //IL_0c9f: Unknown result type (might be due to invalid IL or missing references) //IL_0cae: Unknown result type (might be due to invalid IL or missing references) //IL_0cb3: Unknown result type (might be due to invalid IL or missing references) //IL_0cd8: Unknown result type (might be due to invalid IL or missing references) //IL_0ceb: Unknown result type (might be due to invalid IL or missing references) //IL_0cf0: Unknown result type (might be due to invalid IL or missing references) //IL_0cf5: Unknown result type (might be due to invalid IL or missing references) //IL_0d37: Unknown result type (might be due to invalid IL or missing references) //IL_0d3d: Unknown result type (might be due to invalid IL or missing references) //IL_0d47: Unknown result type (might be due to invalid IL or missing references) //IL_0d4c: Unknown result type (might be due to invalid IL or missing references) //IL_0d51: Unknown result type (might be due to invalid IL or missing references) //IL_0d5b: Unknown result type (might be due to invalid IL or missing references) //IL_0d6f: Unknown result type (might be due to invalid IL or missing references) //IL_0d74: Unknown result type (might be due to invalid IL or missing references) //IL_0d79: Unknown result type (might be due to invalid IL or missing references) //IL_0dbb: Unknown result type (might be due to invalid IL or missing references) //IL_0dc1: Unknown result type (might be due to invalid IL or missing references) //IL_0dcb: Unknown result type (might be due to invalid IL or missing references) //IL_0dd0: Unknown result type (might be due to invalid IL or missing references) //IL_0dd5: Unknown result type (might be due to invalid IL or missing references) //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_06b6: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_06ff: Unknown result type (might be due to invalid IL or missing references) //IL_0706: Unknown result type (might be due to invalid IL or missing references) //IL_070b: Unknown result type (might be due to invalid IL or missing references) //IL_0710: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_071f: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_073c: Unknown result type (might be due to invalid IL or missing references) //IL_0741: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_0839: Unknown result type (might be due to invalid IL or missing references) //IL_083e: Unknown result type (might be due to invalid IL or missing references) //IL_0843: Unknown result type (might be due to invalid IL or missing references) //IL_0853: Unknown result type (might be due to invalid IL or missing references) //IL_0858: Unknown result type (might be due to invalid IL or missing references) //IL_086a: Unknown result type (might be due to invalid IL or missing references) //IL_0874: Unknown result type (might be due to invalid IL or missing references) //IL_0879: Unknown result type (might be due to invalid IL or missing references) //IL_087e: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_08b1: Unknown result type (might be due to invalid IL or missing references) //IL_08c9: Unknown result type (might be due to invalid IL or missing references) //IL_08ce: Unknown result type (might be due to invalid IL or missing references) //IL_08d3: Unknown result type (might be due to invalid IL or missing references) //IL_08e0: Unknown result type (might be due to invalid IL or missing references) //IL_08f2: Unknown result type (might be due to invalid IL or missing references) //IL_08f7: Unknown result type (might be due to invalid IL or missing references) //IL_08fc: Unknown result type (might be due to invalid IL or missing references) //IL_090b: Unknown result type (might be due to invalid IL or missing references) //IL_0923: Unknown result type (might be due to invalid IL or missing references) //IL_0928: Unknown result type (might be due to invalid IL or missing references) //IL_092d: Unknown result type (might be due to invalid IL or missing references) //IL_093a: Unknown result type (might be due to invalid IL or missing references) //IL_094c: Unknown result type (might be due to invalid IL or missing references) //IL_0951: Unknown result type (might be due to invalid IL or missing references) //IL_0956: Unknown result type (might be due to invalid IL or missing references) //IL_095b: Unknown result type (might be due to invalid IL or missing references) //IL_0dea: Unknown result type (might be due to invalid IL or missing references) //IL_0e29: Unknown result type (might be due to invalid IL or missing references) //IL_0e2f: Unknown result type (might be due to invalid IL or missing references) //IL_0e39: Unknown result type (might be due to invalid IL or missing references) //IL_0e3e: Unknown result type (might be due to invalid IL or missing references) //IL_0e43: Unknown result type (might be due to invalid IL or missing references) //IL_0f55: Unknown result type (might be due to invalid IL or missing references) //IL_0f5b: Unknown result type (might be due to invalid IL or missing references) //IL_0f68: Unknown result type (might be due to invalid IL or missing references) //IL_0f89: Unknown result type (might be due to invalid IL or missing references) //IL_0f8f: Unknown result type (might be due to invalid IL or missing references) //IL_0f9c: Unknown result type (might be due to invalid IL or missing references) //IL_0fa1: Unknown result type (might be due to invalid IL or missing references) //IL_0fc6: Unknown result type (might be due to invalid IL or missing references) //IL_0fcc: Unknown result type (might be due to invalid IL or missing references) //IL_0fd9: Unknown result type (might be due to invalid IL or missing references) //IL_0ffa: Unknown result type (might be due to invalid IL or missing references) //IL_1000: Unknown result type (might be due to invalid IL or missing references) //IL_100d: Unknown result type (might be due to invalid IL or missing references) //IL_1012: Unknown result type (might be due to invalid IL or missing references) //IL_10d4: Unknown result type (might be due to invalid IL or missing references) //IL_10e7: Unknown result type (might be due to invalid IL or missing references) //IL_10ec: Unknown result type (might be due to invalid IL or missing references) //IL_10f0: Unknown result type (might be due to invalid IL or missing references) //IL_10f5: Unknown result type (might be due to invalid IL or missing references) //IL_10ff: Unknown result type (might be due to invalid IL or missing references) //IL_1104: Unknown result type (might be due to invalid IL or missing references) //IL_104d: Unknown result type (might be due to invalid IL or missing references) //IL_1053: Unknown result type (might be due to invalid IL or missing references) //IL_1060: Unknown result type (might be due to invalid IL or missing references) //IL_1081: Unknown result type (might be due to invalid IL or missing references) //IL_1087: Unknown result type (might be due to invalid IL or missing references) //IL_1094: Unknown result type (might be due to invalid IL or missing references) //IL_1099: Unknown result type (might be due to invalid IL or missing references) //IL_1148: Unknown result type (might be due to invalid IL or missing references) //IL_115d: Unknown result type (might be due to invalid IL or missing references) //IL_1162: Unknown result type (might be due to invalid IL or missing references) //IL_116c: Unknown result type (might be due to invalid IL or missing references) //IL_1171: Unknown result type (might be due to invalid IL or missing references) //IL_1175: Unknown result type (might be due to invalid IL or missing references) //IL_117a: Unknown result type (might be due to invalid IL or missing references) bool drawAllFeet = opt.drawAllFeet; bool flag = !drawAllFeet || currentLeg == 0; Transform ankle = legC.legs[currentLeg].ankle; Transform toe = legC.legs[currentLeg].toe; Vector3 val = graphMax - graphMin; Matrix4x4 localToWorldMatrix = gameObject.transform.localToWorldMatrix; float num = Util.Mod(gameObject.GetComponent()[((Object)animation).name].normalizedTime); int indexFromTime = GetIndexFromTime(num); float timeFromIndex = GetTimeFromIndex(indexFromTime); float z = gameObject.transform.localScale.z; float num2 = cycleDistance * z; float size = val.z * z * 0.03f; Color c = default(Color); ((Color)(ref c))..ctor(0.7f, 0.7f, 0.7f, 1f); Color debugColor = default(Color); ((Color)(ref debugColor))..ctor(0.8f, 0f, 0f, 1f); Color debugColor2 = default(Color); ((Color)(ref debugColor2))..ctor(0f, 0.7f, 0f, 1f); Color val2 = default(Color); ((Color)(ref val2))..ctor(0f, 0f, 0f, 1f); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.7f, 0.7f, 0.7f, 1f); if (drawAllFeet) { debugColor = legC.legs[currentLeg].debugColor; debugColor2 = legC.legs[currentLeg].debugColor; val2 = legC.legs[currentLeg].debugColor * 0.5f + Color.black * 0.5f; val3 = legC.legs[currentLeg].debugColor * 0.5f + Color.white * 0.5f; } Color color = val2; color.a = 0.5f; GL.Begin(7); Vector3 a = ankle.position + Util.TransformVector(ankle, legC.legs[currentLeg].ankleHeelVector); Vector3 a2 = toe.position + Util.TransformVector(toe, legC.legs[currentLeg].toeToetipVector); Vector3 a3 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(cycles[currentLeg].samples[indexFromTime].footBase); Vector3 val4 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(cycles[currentLeg].samples[indexFromTime].footBase + cycles[currentLeg].heelToetipVector); if (opt.drawHeelToe) { DrawDiamond(a, size, debugColor); DrawDiamond(a2, size, debugColor2); } if (opt.drawFootBase) { DrawDiamond(a3, size, color); DrawDiamond(val4, size, color); GL.End(); GL.Begin(1); DrawLine(a3, val4, val2); } GL.End(); if (opt.drawFootPrints) { float num3 = Util.Mod(num - cycles[currentLeg].stanceTime + cycleOffset); Color val5 = val3 * GetFootGrounding(currentLeg, num3) + val2 * (1f - GetFootGrounding(currentLeg, num3)); if (currentLeg == currentLeg) { GL.Begin(7); } else { GL.Begin(1); } GL.Color(val5); Vector3 val6 = cycles[currentLeg].stancePosition + cycleDirection * (0f - cycleDistance) * (Util.Mod(num3 + 0.5f, 1f) - 0.5f); Vector3 val7 = Vector3.up * -0.5f * ((Vector3)(ref cycles[currentLeg].heelToetipVector)).magnitude; GL.Vertex(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(val6 + val7)); GL.Vertex(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(val6)); GL.Vertex(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(val6 + cycles[currentLeg].heelToetipVector)); GL.Vertex(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(val6 + cycles[currentLeg].heelToetipVector + val7)); if (currentLeg != currentLeg) { GL.Vertex(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(val6)); GL.Vertex(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(val6 + cycles[currentLeg].heelToetipVector)); GL.Vertex(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(val6 + cycles[currentLeg].heelToetipVector + val7)); GL.Vertex(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(val6 + val7)); } GL.End(); } if (motionType != MotionType.WalkCycle) { return; } if (opt.drawTrajectories) { GL.Begin(1); for (int i = 0; i < samples * 2; i++) { int num4 = Util.Mod(indexFromTime - i, samples); LegCycleSample legCycleSample = cycles[currentLeg].samples[num4]; LegCycleSample legCycleSample2 = cycles[currentLeg].samples[Util.Mod(num4 - 1, samples)]; float timeFromIndex2 = GetTimeFromIndex(i); float timeFromIndex3 = GetTimeFromIndex(i + 1); float num5 = 0f; float num6 = 0f; if (opt.normalizeGraph) { num5 = (0f - timeFromIndex2) * cycleDistance; num6 = (0f - timeFromIndex3) * cycleDistance; } Vector3 a4 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(legCycleSample.heel + num5 * cycleDirection); Vector3 b = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(legCycleSample2.heel + num6 * cycleDirection); Vector3 a5 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(legCycleSample.toetip + num5 * cycleDirection); Vector3 b2 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(legCycleSample2.toetip + num6 * cycleDirection); Vector3 a6 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(legCycleSample.footBase + num5 * cycleDirection); Vector3 b3 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(legCycleSample2.footBase + num6 * cycleDirection); if (opt.drawHeelToe) { DrawLine(a4, b, debugColor); DrawLine(a5, b2, debugColor2); } if (opt.drawFootBase) { DrawLine(a6, b3, (num4 % 2 != 0) ? val3 : val2); } if (opt.drawTrajectoriesProjected) { DrawLine(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(Util.ProjectOntoPlane(legCycleSample.heel + legCycleSample.toetip, Vector3.up) / 2f + (legC.groundPlaneHeight - val.y) * Vector3.up), ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(Util.ProjectOntoPlane(legCycleSample2.heel + legCycleSample2.toetip, Vector3.up) / 2f + (legC.groundPlaneHeight - val.y) * Vector3.up), val2); } } GL.End(); if (opt.drawTrajectoriesProjected) { GL.Begin(7); DrawDiamond(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(Util.ProjectOntoPlane(cycles[currentLeg].samples[indexFromTime].heel + cycles[currentLeg].samples[indexFromTime].toetip, Vector3.up) / 2f + (legC.groundPlaneHeight - val.y) * Vector3.up), size, color); GL.End(); if (opt.drawThreePoints) { for (int j = -1; j <= 1; j++) { GL.Begin(7); DrawDiamond(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(cycles[currentLeg].cycleCenter + (legC.groundPlaneHeight - val.y) * Vector3.up + (float)j * cycles[currentLeg].cycleDirection * cycles[currentLeg].cycleScaling * 0.5f), size, color); GL.End(); } GL.Begin(1); DrawLine(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(cycles[currentLeg].cycleCenter + (legC.groundPlaneHeight - val.y) * Vector3.up - cycles[currentLeg].cycleDirection * cycles[currentLeg].cycleScaling), ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(cycles[currentLeg].cycleCenter + (legC.groundPlaneHeight - val.y) * Vector3.up + cycles[currentLeg].cycleDirection * cycles[currentLeg].cycleScaling), color); GL.End(); } } } if (!opt.drawGraph) { return; } GL.Begin(1); Vector3 val8 = legC.groundPlaneHeight * gameObject.transform.up * z; float num7 = 2f * cycleDistance; if (!opt.normalizeGraph) { num7 = 0f; } Quaternion rotation = gameObject.transform.rotation; Vector3 right = rotation * Quaternion.Euler(0f, 90f, 0f) * cycleDirection; Vector3 val9 = rotation * gameObject.transform.up; Vector3 val10 = rotation * cycleDirection; Vector3 val11 = gameObject.transform.position + val8; DrawArea drawArea = new DrawArea3D(new Vector3((0f - num2) * 0.5f, 0f, 0f), new Vector3((0f - num2) * 1.5f, z, z), Util.CreateMatrix(right, val9 * opt.graphScaleV, val10 * opt.graphScaleH, val11)); DrawArea drawArea2 = new DrawArea3D(new Vector3((0f - num2) * 0.5f, val.y * z * 0.7f, 0f), new Vector3((0f - num2) * 1.5f, val.y * z * 1f, 1f), Util.CreateMatrix(right, val9 + val10, val10 - val9, val11 + val10 * graphMax.z * z + val9 * val.y * z)); DrawArea drawArea3 = new DrawArea3D(new Vector3((0f - num2) * 0.5f, val.y * z * 0.2f, 0f), new Vector3((0f - num2) * 1.5f, val.y * z * 0.5f, 1f), Util.CreateMatrix(right, val9 + val10, val10 - val9, val11 + val10 * graphMax.z * z + val9 * val.y * z)); if (flag) { drawArea.DrawCube(new Vector3(0f, 0f, graphMax.z), Vector3.right * 2f, Vector3.up * val.y, -Vector3.forward * (val.z + num7), c); } for (int k = 0; k < 2; k++) { if (opt.drawStanceMarkers) { drawArea.DrawRect(new Vector3(Util.Mod(timeFromIndex - cycles[currentLeg].stanceTime + cycleOffset, 1f) + (float)k, 0f, graphMax.z), Vector3.up * val.y, -Vector3.forward * (val.z + num7), val2); } } if (opt.drawHeelToe) { DrawLine(ankle.position + Util.TransformVector(ankle, legC.legs[currentLeg].ankleHeelVector), drawArea.Point(new Vector3(0f, cycles[currentLeg].samples[indexFromTime].heel.y - legC.groundPlaneHeight, Vector3.Dot(cycles[currentLeg].samples[indexFromTime].heel, cycleDirection))), debugColor); DrawLine(toe.position + Util.TransformVector(toe, legC.legs[currentLeg].toeToetipVector), drawArea.Point(new Vector3(0f, cycles[currentLeg].samples[indexFromTime].toetip.y - legC.groundPlaneHeight, Vector3.Dot(cycles[currentLeg].samples[indexFromTime].toetip, cycleDirection))), debugColor2); } if (opt.drawFootBase) { DrawLine(a3, drawArea.Point(new Vector3(0f, cycles[currentLeg].samples[indexFromTime].footBase.y - legC.groundPlaneHeight, Vector3.Dot(cycles[currentLeg].samples[indexFromTime].footBase, cycleDirection))), Color.black); } for (int l = 0; l < samples * 2; l++) { int num8 = Util.Mod(indexFromTime - l, samples); LegCycleSample legCycleSample3 = cycles[currentLeg].samples[num8]; LegCycleSample legCycleSample4 = cycles[currentLeg].samples[Util.Mod(num8 - 1, samples)]; float timeFromIndex4 = GetTimeFromIndex(l); float timeFromIndex5 = GetTimeFromIndex(l + 1); float timeFromIndex6 = GetTimeFromIndex(Util.Mod(num8 - cycles[currentLeg].stanceIndex, samples)); float timeFromIndex7 = GetTimeFromIndex(Util.Mod(num8 - 1 - cycles[currentLeg].stanceIndex, samples)); float num9 = 0f; float num10 = 0f; if (opt.normalizeGraph) { num9 = (0f - timeFromIndex4) * cycleDistance; num10 = (0f - timeFromIndex5) * cycleDistance; } if (opt.drawHeelToe) { drawArea.DrawLine(new Vector3(timeFromIndex4, legCycleSample3.heel.y - legC.groundPlaneHeight, Vector3.Dot(legCycleSample3.heel, cycleDirection) + num9), new Vector3(timeFromIndex5, legCycleSample4.heel.y - legC.groundPlaneHeight, Vector3.Dot(legCycleSample4.heel, cycleDirection) + num10), debugColor); drawArea.DrawLine(new Vector3(timeFromIndex4, legCycleSample3.toetip.y - legC.groundPlaneHeight, Vector3.Dot(legCycleSample3.toetip, cycleDirection) + num9), new Vector3(timeFromIndex5, legCycleSample4.toetip.y - legC.groundPlaneHeight, Vector3.Dot(legCycleSample4.toetip, cycleDirection) + num10), debugColor2); } if (opt.drawFootBase && num8 % 2 == 0) { drawArea.DrawLine(new Vector3(timeFromIndex4, legCycleSample3.footBase.y - legC.groundPlaneHeight, Vector3.Dot(legCycleSample3.footBase, cycleDirection) + num9), new Vector3(timeFromIndex5, legCycleSample4.footBase.y - legC.groundPlaneHeight, Vector3.Dot(legCycleSample4.footBase, cycleDirection) + num10), val2); } if (opt.drawBalanceCurve) { float num11 = (legCycleSample3.balance + legCycleSample4.balance) / 2f; drawArea2.DrawLine(new Vector3(timeFromIndex4, legCycleSample3.balance, 0f), new Vector3(timeFromIndex5, legCycleSample4.balance, 0f), debugColor2 * num11 + debugColor * (1f - num11)); } if (opt.drawLiftedCurve) { float num12 = (GetFootGroundingOrig(currentLeg, timeFromIndex6) + GetFootGroundingOrig(currentLeg, timeFromIndex7)) / 2f; drawArea3.DrawLine(new Vector3(timeFromIndex4, GetFootGroundingOrig(currentLeg, timeFromIndex6), 0f), new Vector3(timeFromIndex5, GetFootGroundingOrig(currentLeg, timeFromIndex7), 0f), val2 * (1f - num12) + val3 * num12); } } GL.End(); } } public class MotionAnalyzerDrawOptions { [NonSerialized] public int currentLeg; [NonSerialized] public bool drawAllFeet = false; [NonSerialized] public bool drawHeelToe = true; [NonSerialized] public bool drawFootBase = false; [NonSerialized] public bool drawTrajectories = true; [NonSerialized] public bool drawTrajectoriesProjected; [NonSerialized] public bool drawThreePoints; [NonSerialized] public bool drawGraph = true; [NonSerialized] public bool normalizeGraph = true; [NonSerialized] public bool drawStanceMarkers; [NonSerialized] public bool drawBalanceCurve; [NonSerialized] public bool drawLiftedCurve; [NonSerialized] public bool isolateVertical = false; [NonSerialized] public bool isolateHorisontal = true; [NonSerialized] public float graphScaleH; [NonSerialized] public float graphScaleV; [NonSerialized] public bool drawFootPrints = true; } [Serializable] public class MotionAnalyzerBackwards : IMotionAnalyzer { public MotionAnalyzer orig; public LegCycleData[] m_cycles; public float m_cycleOffset; public override LegCycleData[] cycles => m_cycles; public override int samples => orig.samples; public override Vector3 cycleDirection => -orig.cycleDirection; public override float cycleDistance => orig.cycleDistance; public override Vector3 cycleVector => -orig.cycleVector; public override float cycleDuration => orig.cycleDuration; public override float cycleSpeed => orig.cycleSpeed; public override Vector3 cycleVelocity => -orig.cycleVelocity; public override float cycleOffset { get { return m_cycleOffset; } set { m_cycleOffset = value; } } public override Vector3 GetFlightFootPosition(int leg, float flightTime, int phase) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Vector3 flightFootPosition = orig.GetFlightFootPosition(leg, 1f - flightTime, 2 - phase); return new Vector3(0f - flightFootPosition.x, flightFootPosition.y, 1f - flightFootPosition.z); } public override void Analyze(GameObject o) { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) animation = orig.animation; name = ((Object)animation).name + "_bk"; motionType = orig.motionType; motionGroup = orig.motionGroup; LegController legController = o.GetComponent(typeof(LegController)) as LegController; int num = legController.legs.Length; m_cycles = new LegCycleData[num]; for (int i = 0; i < num; i++) { cycles[i] = new LegCycleData(); cycles[i].cycleCenter = orig.cycles[i].cycleCenter; cycles[i].cycleScaling = orig.cycles[i].cycleScaling; cycles[i].cycleDirection = -orig.cycles[i].cycleDirection; cycles[i].stanceTime = 1f - orig.cycles[i].stanceTime; cycles[i].liftTime = 1f - orig.cycles[i].landTime; cycles[i].liftoffTime = 1f - orig.cycles[i].strikeTime; cycles[i].postliftTime = 1f - orig.cycles[i].prelandTime; cycles[i].prelandTime = 1f - orig.cycles[i].postliftTime; cycles[i].strikeTime = 1f - orig.cycles[i].liftoffTime; cycles[i].landTime = 1f - orig.cycles[i].liftTime; cycles[i].cycleDistance = orig.cycles[i].cycleDistance; cycles[i].stancePosition = orig.cycles[i].stancePosition; cycles[i].heelToetipVector = orig.cycles[i].heelToetipVector; } } } public class PolarGradientBandInterpolator : Interpolator { public PolarGradientBandInterpolator(float[][] samplePoints) : base(samplePoints) { samples = samplePoints; } public override float[] Interpolate(float[] output, bool normalize) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) float[] array = BasicChecks(output); if (array != null) { return array; } array = new float[samples.Length]; Vector3[] array2 = (Vector3[])(object)new Vector3[samples.Length]; Vector3 val = default(Vector3); if (output.Length == 2) { ((Vector3)(ref val))..ctor(output[0], output[1], 0f); for (int i = 0; i < samples.Length; i++) { ref Vector3 reference = ref array2[i]; reference = new Vector3(samples[i][0], samples[i][1], 0f); } } else { if (output.Length != 3) { return null; } ((Vector3)(ref val))..ctor(output[0], output[1], output[2]); for (int j = 0; j < samples.Length; j++) { ref Vector3 reference2 = ref array2[j]; reference2 = new Vector3(samples[j][0], samples[j][1], samples[j][2]); } } Vector3 val6 = default(Vector3); Vector3 val7 = default(Vector3); for (int k = 0; k < samples.Length; k++) { bool flag = false; float num = 1f; for (int l = 0; l < samples.Length; l++) { if (k == l) { continue; } Vector3 val2 = array2[k]; Vector3 val3 = array2[l]; float num2 = 2f; float num3; float num4; Vector3 val4; if (val2 == Vector3.zero) { num3 = Vector3.Angle(val, val3) * ((float)Math.PI / 180f); num4 = 0f; val4 = val; num2 = 1f; } else if (val3 == Vector3.zero) { num3 = Vector3.Angle(val, val2) * ((float)Math.PI / 180f); num4 = num3; val4 = val; num2 = 1f; } else { num3 = Vector3.Angle(val2, val3) * ((float)Math.PI / 180f); if (num3 > 0f) { if (val == Vector3.zero) { num4 = num3; val4 = val; } else { Vector3 val5 = Vector3.Cross(val2, val3); val4 = Util.ProjectOntoPlane(val, val5); num4 = Vector3.Angle(val2, val4) * ((float)Math.PI / 180f); if (num3 < (float)Math.PI * 99f / 100f && Vector3.Dot(Vector3.Cross(val2, val4), val5) < 0f) { num4 *= -1f; } } } else { val4 = val; num4 = 0f; } } float magnitude = ((Vector3)(ref val2)).magnitude; float magnitude2 = ((Vector3)(ref val3)).magnitude; float magnitude3 = ((Vector3)(ref val4)).magnitude; float num5 = (magnitude + magnitude2) / 2f; magnitude /= num5; magnitude2 /= num5; magnitude3 /= num5; ((Vector3)(ref val6))..ctor(num3 * num2, magnitude2 - magnitude, 0f); ((Vector3)(ref val7))..ctor(num4 * num2, magnitude3 - magnitude, 0f); float num6 = 1f - Vector3.Dot(val6, val7) / ((Vector3)(ref val6)).sqrMagnitude; if (num6 < 0f) { flag = true; break; } num = Mathf.Min(num, num6); } if (!flag) { array[k] = num; } } if (normalize) { float num7 = 0f; for (int m = 0; m < samples.Length; m++) { num7 += array[m]; } if (num7 > 0f) { for (int n = 0; n < samples.Length; n++) { array[n] /= num7; } } } return array; } } public struct TimePoint { public float time; public Vector3 point; public TimePoint(float time, Vector3 point) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) this.time = time; this.point = point; } } public class TrajectoryVisualizer { private Color color; private float length; private bool dotted; private List trajectory = new List(); public TrajectoryVisualizer(Color color, float length) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) this.color = color; this.length = length; } public void AddPoint(float time, Vector3 point) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) trajectory.Add(new TimePoint(time, point)); while (trajectory[0].time < time - length) { trajectory.RemoveAt(0); } } public void Render() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) if (trajectory.Count != 0) { DrawArea drawArea = new DrawArea3D(Vector3.zero, Vector3.one, Matrix4x4.identity); float time = trajectory[trajectory.Count - 1].time; GL.Begin(1); for (int i = 0; i < trajectory.Count - 1; i++) { Color c = color; c.a = (time - trajectory[i].time) / length; c.a = 1f - c.a * c.a; drawArea.DrawLine(trajectory[i].point, trajectory[i + 1].point, c); } GL.End(); } } } public class Util { public static bool IsSaneNumber(float f) { if (float.IsNaN(f)) { return false; } if (f == float.PositiveInfinity) { return false; } if (f == float.NegativeInfinity) { return false; } if (f > 1E+12f) { return false; } if (f < -1E+12f) { return false; } return true; } public static Vector3 Clamp(Vector3 v, float length) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) float magnitude = ((Vector3)(ref v)).magnitude; if (magnitude > length) { return v / magnitude * length; } return v; } public static float Mod(float x, float period) { float num = x % period; return (!(num >= 0f)) ? (num + period) : num; } public static int Mod(int x, int period) { int num = x % period; return (num < 0) ? (num + period) : num; } public static float Mod(float x) { return Mod(x, 1f); } public static int Mod(int x) { return Mod(x, 1); } public static float CyclicDiff(float high, float low, float period, bool skipWrap) { if (!skipWrap) { high = Mod(high, period); low = Mod(low, period); } return (!(high >= low)) ? (high + period - low) : (high - low); } public static int CyclicDiff(int high, int low, int period, bool skipWrap) { if (!skipWrap) { high = Mod(high, period); low = Mod(low, period); } return (high < low) ? (high + period - low) : (high - low); } public static float CyclicDiff(float high, float low, float period) { return CyclicDiff(high, low, period, skipWrap: false); } public static int CyclicDiff(int high, int low, int period) { return CyclicDiff(high, low, period, skipWrap: false); } public static float CyclicDiff(float high, float low) { return CyclicDiff(high, low, 1f, skipWrap: false); } public static int CyclicDiff(int high, int low) { return CyclicDiff(high, low, 1, skipWrap: false); } public static bool CyclicIsLower(float compared, float comparedTo, float reference, float period) { compared = Mod(compared, period); comparedTo = Mod(comparedTo, period); if (CyclicDiff(compared, reference, period, skipWrap: true) < CyclicDiff(comparedTo, reference, period, skipWrap: true)) { return true; } return false; } public static bool CyclicIsLower(int compared, int comparedTo, int reference, int period) { compared = Mod(compared, period); comparedTo = Mod(comparedTo, period); if (CyclicDiff(compared, reference, period, skipWrap: true) < CyclicDiff(comparedTo, reference, period, skipWrap: true)) { return true; } return false; } public static bool CyclicIsLower(float compared, float comparedTo, float reference) { return CyclicIsLower(compared, comparedTo, reference, 1f); } public static bool CyclicIsLower(int compared, int comparedTo, int reference) { return CyclicIsLower(compared, comparedTo, reference, 1); } public static float CyclicLerp(float a, float b, float t, float period) { if (Mathf.Abs(b - a) <= period / 2f) { return a * (1f - t) + b * t; } if (b < a) { a -= period; } else { b -= period; } return Mod(a * (1f - t) + b * t); } public static Vector3 ProjectOntoPlane(Vector3 v, Vector3 normal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return v - Vector3.Project(v, normal); } public static Vector3 SetHeight(Vector3 originalVector, Vector3 referenceHeightVector, Vector3 upVector) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ProjectOntoPlane(originalVector, upVector); Vector3 val2 = Vector3.Project(referenceHeightVector, upVector); return val + val2; } public static Vector3 GetHighest(Vector3 a, Vector3 b, Vector3 upVector) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Dot(a, upVector) >= Vector3.Dot(b, upVector)) { return a; } return b; } public static Vector3 GetLowest(Vector3 a, Vector3 b, Vector3 upVector) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Dot(a, upVector) <= Vector3.Dot(b, upVector)) { return a; } return b; } public static Matrix4x4 RelativeMatrix(Transform t, Transform relativeTo) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) return relativeTo.worldToLocalMatrix * t.localToWorldMatrix; } public static Vector3 TransformVector(Matrix4x4 m, Vector3 v) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) return ((Matrix4x4)(ref m)).MultiplyPoint(v) - ((Matrix4x4)(ref m)).MultiplyPoint(Vector3.zero); } public static Vector3 TransformVector(Transform t, Vector3 v) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return TransformVector(t.localToWorldMatrix, v); } public static void TransformFromMatrix(Matrix4x4 matrix, Transform trans) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) trans.rotation = QuaternionFromMatrix(matrix); trans.position = Vector4.op_Implicit(((Matrix4x4)(ref matrix)).GetColumn(3)); } public static Quaternion QuaternionFromMatrix(Matrix4x4 m) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) Quaternion result = new Quaternion { w = Mathf.Sqrt(Mathf.Max(0f, 1f + ((Matrix4x4)(ref m))[0, 0] + ((Matrix4x4)(ref m))[1, 1] + ((Matrix4x4)(ref m))[2, 2])) / 2f, x = Mathf.Sqrt(Mathf.Max(0f, 1f + ((Matrix4x4)(ref m))[0, 0] - ((Matrix4x4)(ref m))[1, 1] - ((Matrix4x4)(ref m))[2, 2])) / 2f, y = Mathf.Sqrt(Mathf.Max(0f, 1f - ((Matrix4x4)(ref m))[0, 0] + ((Matrix4x4)(ref m))[1, 1] - ((Matrix4x4)(ref m))[2, 2])) / 2f, z = Mathf.Sqrt(Mathf.Max(0f, 1f - ((Matrix4x4)(ref m))[0, 0] - ((Matrix4x4)(ref m))[1, 1] + ((Matrix4x4)(ref m))[2, 2])) / 2f }; result.x *= Mathf.Sign(result.x * (((Matrix4x4)(ref m))[2, 1] - ((Matrix4x4)(ref m))[1, 2])); result.y *= Mathf.Sign(result.y * (((Matrix4x4)(ref m))[0, 2] - ((Matrix4x4)(ref m))[2, 0])); result.z *= Mathf.Sign(result.z * (((Matrix4x4)(ref m))[1, 0] - ((Matrix4x4)(ref m))[0, 1])); return result; } public static Matrix4x4 MatrixFromQuaternion(Quaternion q) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) return CreateMatrix(q * Vector3.right, q * Vector3.up, q * Vector3.forward, Vector3.zero); } public static Matrix4x4 MatrixFromQuaternionPosition(Quaternion q, Vector3 p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 result = MatrixFromQuaternion(q); ((Matrix4x4)(ref result)).SetColumn(3, Vector4.op_Implicit(p)); ((Matrix4x4)(ref result))[3, 3] = 1f; return result; } public static Matrix4x4 MatrixSlerp(Matrix4x4 a, Matrix4x4 b, float t) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) t = Mathf.Clamp01(t); Matrix4x4 result = MatrixFromQuaternion(Quaternion.Slerp(QuaternionFromMatrix(a), QuaternionFromMatrix(b), t)); ((Matrix4x4)(ref result)).SetColumn(3, ((Matrix4x4)(ref a)).GetColumn(3) * (1f - t) + ((Matrix4x4)(ref b)).GetColumn(3) * t); ((Matrix4x4)(ref result))[3, 3] = 1f; return result; } public static Matrix4x4 CreateMatrix(Vector3 right, Vector3 up, Vector3 forward, Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 identity = Matrix4x4.identity; ((Matrix4x4)(ref identity)).SetColumn(0, Vector4.op_Implicit(right)); ((Matrix4x4)(ref identity)).SetColumn(1, Vector4.op_Implicit(up)); ((Matrix4x4)(ref identity)).SetColumn(2, Vector4.op_Implicit(forward)); ((Matrix4x4)(ref identity)).SetColumn(3, Vector4.op_Implicit(position)); ((Matrix4x4)(ref identity))[3, 3] = 1f; return identity; } public static Matrix4x4 CreateMatrixPosition(Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 identity = Matrix4x4.identity; ((Matrix4x4)(ref identity)).SetColumn(3, Vector4.op_Implicit(position)); ((Matrix4x4)(ref identity))[3, 3] = 1f; return identity; } public static void TranslateMatrix(ref Matrix4x4 m, Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) ((Matrix4x4)(ref m)).SetColumn(3, Vector4.op_Implicit(Vector4.op_Implicit(((Matrix4x4)(ref m)).GetColumn(3)) + position)); ((Matrix4x4)(ref m))[3, 3] = 1f; } public static Vector3 ConstantSlerp(Vector3 from, Vector3 to, float angle) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min(1f, angle / Vector3.Angle(from, to)); return Vector3.Slerp(from, to, num); } public static Quaternion ConstantSlerp(Quaternion from, Quaternion to, float angle) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min(1f, angle / Quaternion.Angle(from, to)); return Quaternion.Slerp(from, to, num); } public static Vector3 ConstantLerp(Vector3 from, Vector3 to, float length) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return from + Clamp(to - from, length); } public static Vector3 Bezier(Vector3 a, Vector3 b, Vector3 c, Vector3 d, float t) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Lerp(a, b, t); Vector3 val2 = Vector3.Lerp(b, c, t); Vector3 val3 = Vector3.Lerp(c, d, t); Vector3 val4 = Vector3.Lerp(val, val2, t); Vector3 val5 = Vector3.Lerp(val2, val3, t); return Vector3.Lerp(val4, val5, t); } public static GameObject Create3dText(Font font, string text, Vector3 position, float size, Color color) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("text_" + text); Component obj = val.AddComponent(typeof(TextMesh)); TextMesh val2 = (TextMesh)(object)((obj is TextMesh) ? obj : null); val.AddComponent(typeof(MeshRenderer)); val2.font = font; val.GetComponent().material = font.material; val.GetComponent().material.color = color; val2.text = text; val.transform.localScale = Vector3.one * size; val.transform.Translate(position); return val; } public static float[] GetLineSphereIntersections(Vector3 lineStart, Vector3 lineDir, Vector3 sphereCenter, float sphereRadius) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) float sqrMagnitude = ((Vector3)(ref lineDir)).sqrMagnitude; float num = 2f * (Vector3.Dot(lineStart, lineDir) - Vector3.Dot(lineDir, sphereCenter)); float num2 = ((Vector3)(ref lineStart)).sqrMagnitude + ((Vector3)(ref sphereCenter)).sqrMagnitude - 2f * Vector3.Dot(lineStart, sphereCenter) - sphereRadius * sphereRadius; float num3 = num * num - 4f * sqrMagnitude * num2; if (num3 < 0f) { return null; } float num4 = (0f - num - Mathf.Sqrt(num3)) / (2f * sqrMagnitude); float num5 = (0f - num + Mathf.Sqrt(num3)) / (2f * sqrMagnitude); if (num4 < num5) { return new float[2] { num4, num5 }; } return new float[2] { num5, num4 }; } } public class DrawArea { public Vector3 min; public Vector3 max; public Vector3 canvasMin = new Vector3(0f, 0f, 0f); public Vector3 canvasMax = new Vector3(1f, 1f, 1f); public DrawArea(Vector3 min, Vector3 max) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) this.min = min; this.max = max; } public virtual Vector3 Point(Vector3 p) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) return Camera.main.ScreenToWorldPoint(Vector3.Scale(new Vector3((p.x - canvasMin.x) / (canvasMax.x - canvasMin.x), (p.y - canvasMin.y) / (canvasMax.y - canvasMin.y), 0f), max - min) + min + Vector3.forward * Camera.main.nearClipPlane * 1.1f); } public void DrawLine(Vector3 a, Vector3 b, Color c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) GL.Color(c); GL.Vertex(Point(a)); GL.Vertex(Point(b)); } public void DrawRay(Vector3 start, Vector3 dir, Color c) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) DrawLine(start, start + dir, c); } public void DrawRect(Vector3 a, Vector3 b, Color c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) GL.Color(c); GL.Vertex(Point(new Vector3(a.x, a.y, 0f))); GL.Vertex(Point(new Vector3(a.x, b.y, 0f))); GL.Vertex(Point(new Vector3(b.x, b.y, 0f))); GL.Vertex(Point(new Vector3(b.x, a.y, 0f))); } public void DrawDiamond(Vector3 a, Vector3 b, Color c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) GL.Color(c); GL.Vertex(Point(new Vector3(a.x, (a.y + b.y) / 2f, 0f))); GL.Vertex(Point(new Vector3((a.x + b.x) / 2f, b.y, 0f))); GL.Vertex(Point(new Vector3(b.x, (a.y + b.y) / 2f, 0f))); GL.Vertex(Point(new Vector3((a.x + b.x) / 2f, a.y, 0f))); } public void DrawRect(Vector3 corner, Vector3 dirA, Vector3 dirB, Color c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) GL.Color(c); Vector3[] array = (Vector3[])(object)new Vector3[2] { dirA, dirB }; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { Vector3 val = corner + array[(j + 1) % 2] * (float)i; GL.Vertex(Point(val)); GL.Vertex(Point(val + array[j])); } } } public void DrawCube(Vector3 corner, Vector3 dirA, Vector3 dirB, Vector3 dirC, Color c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) GL.Color(c); Vector3[] array = (Vector3[])(object)new Vector3[3] { dirA, dirB, dirC }; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { for (int k = 0; k < 3; k++) { Vector3 val = corner + array[(k + 1) % 3] * (float)i + array[(k + 2) % 3] * (float)j; GL.Vertex(Point(val)); GL.Vertex(Point(val + array[k])); } } } } } public class DrawArea3D : DrawArea { public Matrix4x4 matrix; public DrawArea3D(Vector3 min, Vector3 max, Matrix4x4 matrix) : base(min, max) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) this.matrix = matrix; } public override Vector3 Point(Vector3 p) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) return ((Matrix4x4)(ref matrix)).MultiplyPoint3x4(Vector3.Scale(new Vector3((p.x - canvasMin.x) / (canvasMax.x - canvasMin.x), (p.y - canvasMin.y) / (canvasMax.y - canvasMin.y), p.z), max - min) + min); } } public class SmoothFollower { private Vector3 targetPosition; private Vector3 position; private Vector3 velocity; private float smoothingTime; private float prediction; public SmoothFollower(float smoothingTime) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) targetPosition = Vector3.zero; position = Vector3.zero; velocity = Vector3.zero; this.smoothingTime = smoothingTime; prediction = 1f; } public SmoothFollower(float smoothingTime, float prediction) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) targetPosition = Vector3.zero; position = Vector3.zero; velocity = Vector3.zero; this.smoothingTime = smoothingTime; this.prediction = prediction; } public Vector3 Update(Vector3 targetPositionNew, float deltaTime) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (targetPositionNew - targetPosition) / deltaTime; targetPosition = targetPositionNew; float num = Mathf.Min(1f, deltaTime / smoothingTime); velocity = velocity * (1f - num) + (targetPosition + val * prediction - position) * num; position += velocity * Time.deltaTime; return position; } public Vector3 Update(Vector3 targetPositionNew, float deltaTime, bool reset) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (reset) { targetPosition = targetPositionNew; position = targetPositionNew; velocity = Vector3.zero; return position; } return Update(targetPositionNew, deltaTime); } public Vector3 GetPosition() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return position; } public Vector3 GetVelocity() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return velocity; } } namespace JerryComponent { public class nvg : MonoBehaviour { [SerializeField] public Material m_Material = null; private void Start() { } private void Update() { } private void OnRenderImage(RenderTexture _Source, RenderTexture _Destination) { Graphics.Blit((Texture)(object)_Source, _Destination, m_Material); } } } namespace JerryAr.SosigBody { [BepInPlugin("JerryAr.SosigBody", "SosigBody", "1.0.0")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] [BepInDependency("VIP.TommySoucy.H3MP", "1.7.6")] public class SosigBodyPlugin : BaseUnityPlugin { private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); internal static ManualLogSource Logger; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; LoadAssets(); } private void LoadAssets() { Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "JerryAr.SosigBody"); OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.SosigBody", "", "", "rupilot_sosig", ""); GameManager.AddPlayerPrefabID("RUPilot_Sosig"); OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.SosigBody", "", "", "ruspetsnaz_sosig", ""); GameManager.AddPlayerPrefabID("RUSpetsnaz_Sosig"); OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.SosigBody", "", "", "uspilot_sosig", ""); GameManager.AddPlayerPrefabID("USPilot_Sosig"); OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.SosigBody", "", "", "usranger_sosig", ""); GameManager.AddPlayerPrefabID("USRanger_Sosig"); } } } namespace JerryComponent { public class NVGapply : MonoBehaviour { public Material nvgmat; private float timen = 0f; private float bri = 0f; public GameObject rot; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if (rot.transform.localEulerAngles.x > 80f) { timen += Time.deltaTime; bri = timen; nvgmat.SetFloat("Brightness", bri); if (bri > 3f) { bri = 3f; timen = 3f; } } if (rot.transform.localEulerAngles.x <= 80f) { timen -= Time.deltaTime; bri = timen; nvgmat.SetFloat("Brightness", bri); if (bri < 0f) { bri = 0f; timen = 0f; } } } } internal class HandFollowing : MonoBehaviour { public string handAnimaControName_Gun; public string handAnimaControName_Mag; private GameObject _player; private GameObject _POLeft; private GameObject _PORight; private FVRViveHand leftHand; private FVRViveHand rightHand; public Transform _ZuoShouWeiZhi; public Transform _YouShouWeiZhi; private void Start() { _player = ((Component)Object.FindObjectOfType()).gameObject; leftHand = ((Component)_player.transform.Find("Controller (left)")).GetComponent(); rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent(); } private void Update() { HandFollow(); } private void HandFollow() { //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)leftHand.CurrentInteractable != (Object)null) { if ((Object)(object)((Component)leftHand.CurrentInteractable).GetComponent().PoseOverride_Touch != (Object)null) { _ZuoShouWeiZhi.position = ((Component)leftHand.CurrentInteractable).GetComponent().PoseOverride_Touch.position; _ZuoShouWeiZhi.rotation = ((Component)leftHand.CurrentInteractable).GetComponent().PoseOverride_Touch.rotation; ((Component)_ZuoShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Mag, false); ((Component)_ZuoShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Gun, true); } else { _ZuoShouWeiZhi.position = ((Component)leftHand.CurrentInteractable).gameObject.transform.position; _ZuoShouWeiZhi.rotation = GM.CurrentMovementManager.LeftHand.rotation; ((Component)_ZuoShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Mag, true); ((Component)_ZuoShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Gun, false); } } else { _ZuoShouWeiZhi.position = GM.CurrentMovementManager.LeftHand.position; _ZuoShouWeiZhi.rotation = GM.CurrentMovementManager.LeftHand.rotation; ((Component)_ZuoShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Mag, false); ((Component)_ZuoShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Gun, false); } if (!((Object)(object)rightHand.CurrentInteractable != (Object)null)) { _YouShouWeiZhi.position = GM.CurrentMovementManager.RightHand.position; _YouShouWeiZhi.rotation = GM.CurrentMovementManager.RightHand.rotation; ((Component)_YouShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Mag, false); ((Component)_YouShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Gun, false); } else if ((Object)(object)((Component)rightHand.CurrentInteractable).GetComponent().PoseOverride_Touch != (Object)null) { _YouShouWeiZhi.position = ((Component)rightHand.CurrentInteractable).gameObject.GetComponent().PoseOverride_Touch.position; _YouShouWeiZhi.rotation = ((Component)rightHand.CurrentInteractable).gameObject.GetComponent().PoseOverride_Touch.rotation; ((Component)_YouShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Mag, false); ((Component)_YouShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Gun, true); } else { _YouShouWeiZhi.position = ((Component)rightHand.CurrentInteractable).gameObject.transform.position; _YouShouWeiZhi.rotation = GM.CurrentMovementManager.RightHand.rotation; ((Component)_YouShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Mag, true); ((Component)_YouShouWeiZhi).GetComponentInChildren().SetBool(handAnimaControName_Gun, false); } } } public class AutoSize : FVRInteractiveObject { public enum Axis { X, Y, Z } private bool m_isLargeAperture = true; public Transform Flipsight; public float m_flipsightStartRotX; public float m_flipsightEndRotX = -90f; private float m_flipsightCurRotX; public Axis RotAxis; private float m_curFlipLerp; public float m_tarFlipLerp; private float m_lastFlipLerp; public AudioEvent AudClipOpen; public AudioEvent AudClipClose; public override void Awake() { ((FVRInteractiveObject)this).Awake(); } public override void SimpleInteraction(FVRViveHand hand) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); m_isLargeAperture = !m_isLargeAperture; try { if (!m_isLargeAperture) { SM.PlayGenericSound(AudClipOpen, ((Component)this).transform.position); } else { SM.PlayGenericSound(AudClipClose, ((Component)this).transform.position); } } catch { } } public override void FVRUpdate() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Invalid comparison between Unknown and I4 //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).FVRUpdate(); if (m_isLargeAperture) { m_tarFlipLerp = 0f; } else { m_tarFlipLerp = 1f; } m_curFlipLerp = Mathf.MoveTowards(m_curFlipLerp, m_tarFlipLerp, Time.deltaTime * 4f); if (Mathf.Abs(m_curFlipLerp - m_lastFlipLerp) > 0.01f) { m_flipsightCurRotX = Mathf.Lerp(m_flipsightStartRotX, m_flipsightEndRotX, m_curFlipLerp); Axis rotAxis = RotAxis; if ((int)rotAxis != 0) { if ((int)rotAxis != 1) { if ((int)rotAxis == 2) { Flipsight.localEulerAngles = new Vector3(0f, 0f, m_flipsightCurRotX); } } else { Flipsight.localEulerAngles = new Vector3(0f, m_flipsightCurRotX, 0f); } } else { Flipsight.localEulerAngles = new Vector3(m_flipsightCurRotX, 0f, 0f); } } m_lastFlipLerp = m_curFlipLerp; } } } public class ChangeBodyH3MP : MonoBehaviour { private void Start() { } private void Update() { } } namespace JerryComponent { public class Derringerautochamber : MonoBehaviour { public Derringer der; public GameObject rot; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (rot.transform.localEulerAngles.x < 15f) { der.m_hingeState = (HingeState)0; } if (rot.transform.localEulerAngles.x >= 15f) { der.m_hingeState = (HingeState)2; } } } public class HeadRotate : MonoBehaviour { public GameObject rotGEO; public GameObject headGEO; private void Start() { } private void Update() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) headGEO.transform.localEulerAngles = new Vector3(-1f * rotGEO.transform.localEulerAngles.x, -1f * rotGEO.transform.localEulerAngles.y, -1f * rotGEO.transform.localEulerAngles.z); } } public class QBslotSizeChange : MonoBehaviour { public FVRQuickBeltSlot slot; public GameObject rot; private void Start() { } private void Update() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)slot.CurObject != (Object)null) { if (rot.transform.localEulerAngles.x <= 50f) { ((Component)slot.CurObject).transform.localScale = new Vector3(0f, 0f, 0f); } if (rot.transform.localEulerAngles.x > 50f) { ((Component)slot.CurObject).transform.localScale = new Vector3(1f, 1f, 1f); } } if (!((Object)(object)slot.CurObject == (Object)null)) { } } } public class RotFade : MonoBehaviour { public Material mat; public GameObject thisobj; public float alpha; public float refa; private void FixedUpdate() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if (thisobj.activeInHierarchy) { alpha = Mathf.SmoothDamp(alpha, 1f, ref refa, 0.5f); mat.SetColor("_Color", new Color(1f, 1f, 1f, alpha)); if (alpha >= 0.9f) { mat.SetInt("_Mode", 0); } } else if (!thisobj.activeInHierarchy) { alpha = 0f; mat.SetColor("_Color", new Color(1f, 1f, 1f, 0f)); mat.SetInt("_Mode", 2); } } } public class ScorchAISkill : MonoBehaviour { public GameObject rotcrouch; public GameObject northrot; public GameObject southrot; public GameObject eastrot; public GameObject westrot; public FVRPhysicalObject grabL; public FVRPhysicalObject grabR; public GameObject _FWaudio; public GameObject shieldrot; public GameObject _FlameWall; public GameObject _FlameLine; public GameObject _Gas; public Transform _FlamePos; public Transform _GasPos; private bool flamewalled = true; private bool flamewallrdy = false; private bool flamelined = true; private bool flamelinerdy = false; private bool gassed = true; private bool gasrdy = false; private bool shieldon = false; private bool shieldrdy = true; private float timeW = 0f; private float timeWt = 15f; private float timeL = 0f; private float timeLt = 15f; private float timeG = 0f; private float timeGt = 25f; private float timeS = 0f; private void Start() { } private void Update() { //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_063f: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Unknown result type (might be due to invalid IL or missing references) if (shieldon && shieldrdy) { timeS += 1f * Time.deltaTime; if (timeS > 10f) { timeS = 10f; shieldrdy = false; } } else if (!shieldon) { timeS -= 1f * Time.deltaTime; if (timeS < 0f) { timeS = 0f; } if (timeS <= 0f) { shieldrdy = true; } } if ((Object)(object)((FVRInteractiveObject)grabL).m_hand != (Object)null) { if (((FVRInteractiveObject)grabL).m_hand.Input.AXButtonPressed) { if (shieldrdy) { shieldrot.transform.localEulerAngles = new Vector3(90f, 0f, 0f); shieldon = true; } if (!shieldrdy) { shieldrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); shieldon = false; } } else { shieldrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); shieldon = false; } } else { shieldrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); shieldon = false; } if (flamewalled) { if (timeWt < 30f) { timeWt += 1f * Time.deltaTime; _FWaudio.SetActive(false); } if (timeWt >= 30f) { flamewallrdy = true; _FWaudio.SetActive(true); } } if (flamewallrdy && (Object)(object)((FVRInteractiveObject)grabR).m_hand != (Object)null) { if (((FVRInteractiveObject)grabR).m_hand.Input.BYButtonPressed) { rotcrouch.transform.localEulerAngles = new Vector3(90f, 0f, 0f); timeW += 1f * Time.deltaTime; if (timeW >= 0.5f) { flamewalled = false; } if (!flamewalled) { rotcrouch.transform.localEulerAngles = new Vector3(0f, 0f, 0f); Object.Instantiate(_FlameWall, _FlamePos.position, _FlamePos.rotation); timeW = 0f; timeWt = 0f; flamewalled = true; flamewallrdy = false; } } else { rotcrouch.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } if ((Object)(object)((FVRInteractiveObject)grabL).m_hand == (Object)null && (Object)(object)((FVRInteractiveObject)grabR).m_hand == (Object)null) { rotcrouch.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if (!flamewallrdy && !flamelinerdy) { rotcrouch.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if (flamelined) { if (timeLt < 15f) { timeLt += 1f * Time.deltaTime; } if (timeLt >= 15f) { flamelinerdy = true; } } if (flamelinerdy && (Object)(object)((FVRInteractiveObject)grabL).m_hand != (Object)null) { if (((FVRInteractiveObject)grabL).m_hand.Input.BYButtonPressed) { rotcrouch.transform.localEulerAngles = new Vector3(90f, 0f, 0f); timeL += 1f * Time.deltaTime; if (timeL >= 0.5f) { flamelined = false; } if (!flamelined) { rotcrouch.transform.localEulerAngles = new Vector3(0f, 0f, 0f); Object.Instantiate(_FlameLine, _FlamePos.position, _FlamePos.rotation); timeL = 0f; timeLt = 0f; flamelined = true; flamelinerdy = false; } } else { rotcrouch.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } if (gassed) { if (timeGt < 25f) { timeGt += 1f * Time.deltaTime; } if (timeGt >= 25f) { gasrdy = true; } } if (gasrdy && (Object)(object)((FVRInteractiveObject)grabR).m_hand != (Object)null && ((FVRInteractiveObject)grabR).m_hand.Input.AXButtonPressed) { timeG += Time.deltaTime; if (timeG >= 0.5f) { gassed = false; } if (!gassed) { Object.Instantiate(_Gas, _GasPos.position, _GasPos.rotation); timeG = 0f; timeGt = 0f; gassed = true; gasrdy = false; } } } } public class ScorchSkill : MonoBehaviour { public Kick kick; public GameObject _FWaudio; public GameObject shieldrot; public GameObject _FlameWall; public GameObject _FlameLine; public GameObject _Gas; public Transform _FlamePos; public Transform _GasPos; private bool flamewalled = true; private bool flamewallrdy = false; private bool flamelined = true; private bool flamelinerdy = false; private bool gassed = true; private bool gasrdy = false; private bool shieldon = false; private bool shieldrdy = true; private float timeW = 0f; private float timeWt = 15f; private float timeL = 0f; private float timeLt = 15f; private float timeG = 0f; private float timeGt = 25f; private float timeS = 0f; private void Start() { } private void Update() { //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_0608: Unknown result type (might be due to invalid IL or missing references) if (shieldon) { timeS += Time.deltaTime; if (timeS > 10f) { timeS = 10f; shieldrdy = false; } if (timeS <= 10f) { shieldrdy = true; } } else if (!shieldon) { timeS -= Time.deltaTime; if (timeS < 0f) { timeS = 0f; } } if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && GM.CurrentMovementManager.Hands[0].Input.GripPressed && GM.CurrentMovementManager.Hands[0].Input.TriggerPressed) { if (shieldrdy) { shieldrot.transform.localEulerAngles = new Vector3(90f, 0f, 0f); shieldon = true; } if (!shieldrdy) { shieldrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); shieldon = false; } } else { shieldrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); shieldon = false; } if (flamewalled) { if (timeWt < 30f) { timeWt += Time.deltaTime; _FWaudio.SetActive(false); } if (timeWt >= 30f) { flamewallrdy = true; _FWaudio.SetActive(true); } } if (flamewallrdy && GM.CurrentMovementManager.Hands[0].Input.GripPressed && GM.CurrentMovementManager.Hands[1].Input.GripPressed && (Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null) { if (((Component)kick._KHandL).transform.localPosition.y >= 0.2f && ((Component)kick._KHandR).transform.localPosition.y >= 0.2f) { timeW += Time.deltaTime; if (timeW >= 0.5f) { flamewalled = false; } } if (kick.speedL >= 2f && kick.speedR >= 2f && !flamewalled) { Object.Instantiate(_FlameWall, _FlamePos.position, _FlamePos.rotation); timeW = 0f; timeWt = 0f; flamewalled = true; flamewallrdy = false; } } if (flamelined) { if (timeLt < 15f) { timeLt += Time.deltaTime; } if (timeLt >= 15f) { flamelinerdy = true; } } if (flamelinerdy = (Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && GM.CurrentMovementManager.Hands[1].Input.GripPressed && GM.CurrentMovementManager.Hands[1].Input.TriggerPressed) { if (((Component)kick._KHandR).transform.localPosition.y >= 0.2f) { timeL += Time.deltaTime; if (timeL >= 0.5f) { flamelined = false; } } if (kick.speedR >= 2f && !flamelined) { Object.Instantiate(_FlameLine, _FlamePos.position, _FlamePos.rotation); timeL = 0f; timeLt = 0f; flamelined = true; flamelinerdy = false; } } if (gassed) { if (timeGt < 25f) { timeGt += Time.deltaTime; } if (timeGt >= 25f) { gasrdy = true; } } if (!(gasrdy = (Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && GM.CurrentMovementManager.Hands[0].Input.GripPressed && !GM.CurrentMovementManager.Hands[1].Input.GripPressed)) { return; } if (((Component)kick._KHandL).transform.localPosition.y >= 0.2f) { timeG += Time.deltaTime; if (timeG >= 0.5f) { gassed = false; } } if (kick.speedL >= 2f && !gassed) { Object.Instantiate(_Gas, _GasPos.position, _GasPos.rotation); timeG = 0f; timeGt = 0f; gassed = true; gasrdy = false; } } } public class SpawnTitan : FVRPhysicalObject { public FVRObject TitanPrefab; public GameObject GroundEffect; public GameObject TitanEffect; [NonSerialized] public GameObject T; [NonSerialized] public GameObject TE; public GameObject TitanFall; [NonSerialized] public GameObject TF; [NonSerialized] public GameObject hitpoint = new GameObject("hitpoint"); public bool Fell = false; public bool Spawned = false; public KillAfter kill; public LineRenderer LR; public Transform laserpoint; public Transform aperture; public LayerMask lm; public bool ranged = false; private void FixedUpdate() { //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) if (((FVRInteractiveObject)this).IsHeld) { if (((FVRInteractiveObject)this).m_hand.Input.TriggerFloat > 0.9f && ranged) { ((Renderer)LR).enabled = false; Fell = true; } if (!Fell) { Ray val = default(Ray); ((Ray)(ref val))..ctor(aperture.position, aperture.forward); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 150f, LayerMask.op_Implicit(lm))) { if (((RaycastHit)(ref val2)).distance >= 100f) { ranged = false; ((Renderer)LR).enabled = false; ((Component)laserpoint).transform.localPosition = new Vector3(0f, 0f, 0f); } else if (((RaycastHit)(ref val2)).distance < 100f) { ranged = true; ((Component)laserpoint).transform.position = ((RaycastHit)(ref val2)).point; ((Renderer)LR).enabled = true; LR.SetPosition(0, ((Component)aperture).transform.position); LR.SetPosition(1, ((Component)laserpoint).transform.position); } } else if (!Physics.Raycast(val, ref val2)) { ranged = false; ((Renderer)LR).enabled = false; ((Component)laserpoint).transform.localPosition = new Vector3(0f, 0f, 0f); } } } else if (!((FVRInteractiveObject)this).IsHeld) { ((Component)laserpoint).transform.localPosition = new Vector3(0f, 0f, 0f); ranged = false; ((Renderer)LR).enabled = false; } if (Fell && !Spawned) { if ((Object)(object)TF == (Object)null) { TF = Object.Instantiate(TitanFall, new Vector3(((Component)laserpoint).transform.position.x, ((Component)laserpoint).transform.position.y + 50f, ((Component)laserpoint).transform.position.z), ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.rotation); } if ((Object)(object)TE == (Object)null) { TE = Object.Instantiate(TitanEffect, new Vector3(((Component)laserpoint).transform.position.x, ((Component)laserpoint).transform.position.y + 50f, ((Component)laserpoint).transform.position.z), ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.rotation); } hitpoint.transform.SetParent((Transform)null); hitpoint.transform.position = ((Component)laserpoint).transform.position; if ((Object)(object)T == (Object)null) { T = Object.Instantiate(((AnvilAsset)TitanPrefab).GetGameObject(), hitpoint.transform.position, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.rotation); T.SetActive(false); } Spawned = true; } if (Spawned && (Object)(object)TF != (Object)null) { if ((Object)(object)TE != (Object)null) { TE.transform.position = TF.transform.position; } if (TF.transform.position.y <= hitpoint.transform.position.y) { T.SetActive(true); Object.Instantiate(GroundEffect, hitpoint.transform.position, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.rotation); Object.Destroy((Object)(object)TF); Object.Destroy((Object)(object)hitpoint); ((Behaviour)kill).enabled = true; } } } } public class Sprayautofire : MonoBehaviour { public HairsprayCan can; private void Start() { } private void Update() { can.m_isSpraying = true; } } public class TitanEject : MonoBehaviour { public GameObject hatchaudio; public GameObject ejectaudio; public GameObject titanchara; public SphereCollider spc; public AutoTitan ai; public GameObject screenejct; public GameObject aim; public GameObject trackpoint; public GameObject grableft; public GameObject grabright; public GameObject gunrotbase; public GameObject jxcdelta; public GameObject rotgeoprefab; public GameObject titanai; public GameObject titan; public KillAfter hatchkill; public AR15HandleFlipperSounds handle; public bool ishouldeject = false; public bool exploded = false; public bool eject = false; public GameObject explosion; public GameObject explode; public GameObject hatch; public bool rigided = false; public bool forced = false; public Collider handlecol; public GameObject ejecthandle; public float countdown = 7f; private void Start() { ((Behaviour)hatchkill).enabled = false; } private void Update() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) if (ai.pilotInSeat && ejecthandle.transform.localEulerAngles.x < 45f && (Object)(object)spc != (Object)null) { ((Collider)spc).enabled = true; } if (!ai.pilotInSeat && ejecthandle.transform.localEulerAngles.x < 45f && (Object)(object)spc != (Object)null) { ((Collider)spc).enabled = false; } if (ejecthandle.transform.localEulerAngles.x > 45f) { if ((Object)(object)handle != (Object)null) { ((FVRInteractiveObject)handle).EndInteraction(((FVRInteractiveObject)handle).m_hand); ((FVRInteractiveObject)handle).EndInteractionDistance = 0.01f; ((FVRInteractiveObject)handle).EndInteractionIfDistant = true; } screenejct.transform.localEulerAngles = new Vector3(90f, 0f, 0f); if (countdown >= 0f) { countdown -= 1f * Time.deltaTime; } if (!rigided && !forced && (double)countdown < 6.5) { Rigidbody val = hatch.AddComponent(); rigided = true; hatchaudio.SetActive(true); val.AddRelativeForce(new Vector3(0f, 7.5f, 10f), (ForceMode)1); val.AddRelativeTorque(new Vector3(-20f, 0f, 0f), (ForceMode)1); forced = true; ((Behaviour)hatchkill).enabled = true; } if (rigided && forced && !eject && countdown < 5f) { ai.pilotInSeat = false; ejectaudio.SetActive(true); GM.CurrentMovementManager.Blast(Vector3.up, 20f, true); ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null); eject = true; } if (countdown < 2f && rigided && forced && eject) { Object.Instantiate(explosion, titan.transform.position, titan.transform.rotation); Object.Instantiate(explode, titan.transform.position, titan.transform.rotation); Object.Destroy((Object)(object)aim); Object.Destroy((Object)(object)trackpoint); Object.Destroy((Object)(object)grableft); Object.Destroy((Object)(object)grabright); Object.Destroy((Object)(object)gunrotbase); Object.Destroy((Object)(object)jxcdelta); Object.Destroy((Object)(object)rotgeoprefab); Object.Destroy((Object)(object)titanai); Object.Destroy((Object)(object)titan); } } } } public class mechhands : MonoBehaviour { private GameObject pilothL; private GameObject pilothR; private GameObject handL; private GameObject handR; public Transform posL; public Transform posR; private Transform oposL; private Transform oposR; public GameObject mechhL; public GameObject mechhR; public GameObject rot; private FVRViveHand vhL; private FVRViveHand vhR; public SphereCollider hcL; public SphereCollider hcR; private SphereCollider vhcL; private SphereCollider vhcR; public GameObject hatch; public GameObject hatchrot; public void Start() { vhL = GameObject.Find("Controller (left)").GetComponent(); vhL = GameObject.Find("Controller (right)").GetComponent(); vhcL = vhL.Collider_Palm; vhcR = vhR.Collider_Palm; oposL = vhL.PoseOverride; oposR = vhR.PoseOverride; } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) if (hatchrot.transform.localEulerAngles.x >= 45f) { hatch.layer = 28; } if (hatchrot.transform.localEulerAngles.x < 45f) { hatch.layer = 0; } pilothL = GameObject.Find("HAND L GUN IDLE Pilot"); pilothR = GameObject.Find("HAND R GUN IDLE Pilot"); if (rot.transform.localEulerAngles.x >= 45f || (Object)(object)pilothL != (Object)null || (Object)(object)pilothR != (Object)null) { vhL.Collider_Palm = hcL; vhR.Collider_Palm = hcR; vhL.PoseOverride = posL; vhR.PoseOverride = posR; mechhL.transform.localEulerAngles = new Vector3(pilothL.transform.localEulerAngles.x, pilothL.transform.localEulerAngles.y, pilothL.transform.localEulerAngles.z); mechhR.transform.localEulerAngles = new Vector3(pilothR.transform.localEulerAngles.x, pilothR.transform.localEulerAngles.y, pilothR.transform.localEulerAngles.z); mechhL.transform.localPosition = new Vector3(pilothL.transform.localPosition.x, pilothL.transform.localPosition.y, pilothL.transform.localPosition.z); mechhR.transform.localPosition = new Vector3(pilothR.transform.localPosition.x, pilothR.transform.localPosition.y, pilothR.transform.localPosition.z); } if (rot.transform.localEulerAngles.x < 45f) { vhL.Collider_Palm = vhcL; vhR.Collider_Palm = vhcL; vhL.PoseOverride = oposL; vhR.PoseOverride = oposR; mechhL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); mechhL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); mechhL.transform.localPosition = new Vector3(0f, 0f, 0f); mechhL.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)pilothL == (Object)null && (Object)(object)pilothR == (Object)null && (Object)(object)vhL == (Object)null && !((Object)(object)vhR == (Object)null)) { } } } public class sizeapply : MonoBehaviour { public AutoSize flipper; private void Start() { flipper.m_tarFlipLerp = 1f; } private void Update() { } } [RequireComponent(typeof(AudioSource))] public class AdvancedVoiceChanger : MonoBehaviour { public enum VoicePreset { Normal, YoungGirl, YoungGirl2, DeepMale, Robot, Alien, Chipmunk, Demon, Telephone, Radio, Custom } [Serializable] public struct PresetParameters { public float Pitch; public float Distortion; public float LowPass; public float Resonance; public float VibratoDepth; public float VibratoSpeed; public bool Echo; public bool Chorus; public PresetParameters(float pitch, float distortion, float lowPass, float resonance, float vibratoDepth, float vibratoSpeed, bool echo, bool chorus) { Pitch = pitch; Distortion = distortion; LowPass = lowPass; Resonance = resonance; VibratoDepth = vibratoDepth; VibratoSpeed = vibratoSpeed; Echo = echo; Chorus = chorus; } } [Header("麦克风设置")] public string selectedDevice; public bool useLoop = true; public int recordingLength = 10; public bool started = false; public int micorder = 0; public AudioEvent click; public AR15HandleSightFlipper mictoggle; public AR15HandleSightFlipper micpower; [Header("音色预设")] [Tooltip("从预设音色中选择")] public VoicePreset currentPreset = VoicePreset.Normal; [Header("音色调整参数")] [Range(0.1f, 3f)] public float pitchShift = 1f; [Range(0f, 1f)] public float distortion = 0f; [Range(0f, 1f)] public float lowPassCutoff = 1f; [Range(0f, 2f)] public float resonance = 0f; [Range(0f, 1f)] public float vibratoDepth = 0f; [Range(0.1f, 20f)] public float vibratoSpeed = 5f; [Header("高级效果")] public bool enableEcho = false; [Range(0f, 1f)] public float echoMix = 0.3f; [Range(0f, 1f)] public float echoDelay = 0.2f; public bool enableChorus = false; [Range(0f, 1f)] public float chorusMix = 0.5f; private Dictionary presetLibrary; private AudioSource audioSource; private AudioClip microphoneClip; private bool isMicrophoneActive = false; private int lastSamplePosition = 0; private float[] microphoneDataBuffer; private const int SAMPLE_RATE = 44100; private VoicePreset targetPreset; private PresetParameters currentParams; private PresetParameters targetParams; private float transitionProgress = 0f; private bool isTransitioning = false; private float[] echoBuffer; private int echoBufferIndex = 0; private void Start() { audioSource = ((Component)this).GetComponent(); } private void InitializePresetLibrary() { presetLibrary = new Dictionary { { VoicePreset.YoungGirl, new PresetParameters(1.8f, 0.05f, 0.7f, 0.3f, 0.1f, 6f, echo: false, chorus: false) }, { VoicePreset.YoungGirl2, new PresetParameters(1.3f, 0f, 0.95f, 0.1f, 0.01f, 6f, echo: false, chorus: false) }, { VoicePreset.DeepMale, new PresetParameters(0.65f, 0.15f, 0.4f, 0.7f, 0.05f, 4f, echo: false, chorus: false) }, { VoicePreset.Normal, new PresetParameters(1f, 0f, 1f, 0f, 0f, 5f, echo: false, chorus: false) }, { VoicePreset.Robot, new PresetParameters(0.9f, 0.8f, 0.5f, 0.2f, 0f, 0f, echo: false, chorus: true) }, { VoicePreset.Alien, new PresetParameters(2.3f, 0.4f, 0.3f, 1.2f, 0.3f, 8f, echo: true, chorus: false) }, { VoicePreset.Chipmunk, new PresetParameters(2.5f, 0.1f, 0.9f, 0.1f, 0.15f, 10f, echo: false, chorus: false) }, { VoicePreset.Demon, new PresetParameters(0.4f, 0.9f, 0.2f, 1.5f, 0.2f, 3f, echo: true, chorus: false) }, { VoicePreset.Telephone, new PresetParameters(1.1f, 0.2f, 0.6f, 0.4f, 0f, 0f, echo: false, chorus: false) }, { VoicePreset.Radio, new PresetParameters(1f, 0.3f, 0.8f, 0.5f, 0.05f, 7f, echo: false, chorus: false) } }; } private IEnumerator InitializeMicrophone() { if (Microphone.devices.Length == 0) { Debug.LogError((object)"未检测到麦克风设备!"); yield break; } if (string.IsNullOrEmpty(selectedDevice)) { selectedDevice = Microphone.devices[micorder]; Debug.Log((object)("使用默认麦克风: " + selectedDevice)); } microphoneClip = Microphone.Start(selectedDevice, useLoop, recordingLength, 44100); yield return (object)new WaitForSeconds(0.3f); if (Microphone.GetPosition(selectedDevice) <= 0) { Debug.LogError((object)"麦克风启动失败,请检查权限设置!"); yield break; } audioSource.clip = AudioClip.Create("ProcessedMic", 44100 * recordingLength, 1, 44100, false); microphoneDataBuffer = new float[44100 * recordingLength]; int echoBufferSize = (int)(44100f * echoDelay); echoBuffer = new float[(echoBufferSize <= 0) ? 1024 : echoBufferSize]; Debug.Log((object)"高级音色变换器已启动!"); } private void Update() { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!mictoggle.m_isLargeAperture) { if (micorder < Microphone.devices.Length - 1) { micorder++; } else if (micorder >= Microphone.devices.Length - 1) { micorder = 0; } SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).gameObject.transform.position); mictoggle.m_isLargeAperture = true; } if (!micpower.m_isLargeAperture) { isMicrophoneActive = !isMicrophoneActive; SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).gameObject.transform.position); micpower.m_isLargeAperture = true; } if (isMicrophoneActive) { if (!started) { InitializePresetLibrary(); ((MonoBehaviour)this).StartCoroutine(InitializeMicrophone()); started = true; } ProcessMicrophoneData(); currentParams = presetLibrary[currentPreset]; if (currentPreset == VoicePreset.Custom) { currentParams.Pitch = pitchShift; currentParams.Distortion = distortion; currentParams.LowPass = lowPassCutoff; currentParams.Resonance = resonance; currentParams.VibratoDepth = vibratoDepth; currentParams.VibratoSpeed = vibratoSpeed; currentParams.Echo = enableEcho; currentParams.Chorus = enableChorus; } } if (!isMicrophoneActive) { ((MonoBehaviour)this).StopCoroutine(InitializeMicrophone()); started = false; audioSource.Stop(); audioSource.clip = null; audioSource.loop = false; } } private void ProcessMicrophoneData() { int position = Microphone.GetPosition(selectedDevice); if (position <= 0) { return; } int num = 0; if (position > lastSamplePosition) { num = position - lastSamplePosition; } else if (position < lastSamplePosition) { num = microphoneDataBuffer.Length - lastSamplePosition + position; } if (num > 0) { float[] array = new float[num]; microphoneClip.GetData(array, lastSamplePosition); float[] array2 = ProcessAudioData(array); audioSource.clip.SetData(array2, lastSamplePosition); if (!audioSource.isPlaying) { audioSource.Play(); } lastSamplePosition = position % microphoneDataBuffer.Length; } } private float[] ProcessAudioData(float[] inputData) { float[] array = new float[inputData.Length]; float time = Time.time; for (int i = 0; i < inputData.Length; i++) { float num = inputData[i]; float num2 = 1f; if (currentParams.VibratoDepth > 0.01f) { num2 = 1f + Mathf.Sin(time * currentParams.VibratoSpeed + (float)i * 0.001f) * currentParams.VibratoDepth * 0.1f; } float num3 = currentParams.Pitch * num2; if (Mathf.Abs(num3 - 1f) > 0.01f) { int num4 = (int)((float)i * num3); if (num4 < inputData.Length && num4 >= 0) { num = inputData[num4]; } } if (currentParams.Resonance > 0.01f && i > 1) { float num5 = currentParams.Resonance * 0.1f; num = num * (1f + num5) - array[i - 1] * num5 * 0.5f - array[i - 2] * num5 * 0.3f; } if (currentParams.Distortion > 0.01f) { float num6 = currentParams.Distortion * 3f; num = Mathf.Atan(num * num6) / Mathf.Atan(num6); } if (currentParams.LowPass < 0.99f && i > 0) { float lowPass = currentParams.LowPass; num = array[i - 1] * lowPass + num * (1f - lowPass); if (i > 1 && lowPass < 0.8f) { num = array[i - 1] * (lowPass + 0.1f) + num * (0.9f - lowPass); } } if (currentParams.Chorus && i > 100) { int num7 = 50 + (int)(Mathf.Sin(time * 2f + (float)i * 0.001f) * 30f); if (i - num7 >= 0) { num = num * 0.7f + array[i - num7] * 0.3f; } } if (currentParams.Echo && echoBuffer.Length > 0) { float num8 = echoBuffer[echoBufferIndex]; num = num * (1f - echoMix) + num8 * echoMix; echoBuffer[echoBufferIndex] = num * 0.6f; echoBufferIndex = (echoBufferIndex + 1) % echoBuffer.Length; } array[i] = Mathf.Clamp(num, -1f, 1f); } return array; } private void StartPresetTransition(VoicePreset newPreset) { if (presetLibrary.ContainsKey(newPreset)) { targetPreset = newPreset; targetParams = presetLibrary[newPreset]; if (currentPreset == VoicePreset.Custom) { SaveCurrentToCustom(); } isTransitioning = true; transitionProgress = 0f; } } private void UpdateTransition() { transitionProgress += Time.deltaTime * 2f; if (transitionProgress >= 1f) { transitionProgress = 1f; isTransitioning = false; currentPreset = targetPreset; ApplyCurrentParameters(); } pitchShift = Mathf.Lerp(currentParams.Pitch, targetParams.Pitch, transitionProgress); distortion = Mathf.Lerp(currentParams.Distortion, targetParams.Distortion, transitionProgress); lowPassCutoff = Mathf.Lerp(currentParams.LowPass, targetParams.LowPass, transitionProgress); resonance = Mathf.Lerp(currentParams.Resonance, targetParams.Resonance, transitionProgress); vibratoDepth = Mathf.Lerp(currentParams.VibratoDepth, targetParams.VibratoDepth, transitionProgress); vibratoSpeed = Mathf.Lerp(currentParams.VibratoSpeed, targetParams.VibratoSpeed, transitionProgress); enableEcho = targetParams.Echo; enableChorus = targetParams.Chorus; } private void ApplyCurrentParameters() { pitchShift = currentParams.Pitch; distortion = currentParams.Distortion; lowPassCutoff = currentParams.LowPass; resonance = currentParams.Resonance; vibratoDepth = currentParams.VibratoDepth; vibratoSpeed = currentParams.VibratoSpeed; enableEcho = currentParams.Echo; enableChorus = currentParams.Chorus; } private void SaveCurrentToCustom() { presetLibrary[VoicePreset.Custom] = new PresetParameters(pitchShift, distortion, lowPassCutoff, resonance, vibratoDepth, vibratoSpeed, enableEcho, enableChorus); } public void SetVoicePreset(VoicePreset preset) { currentPreset = preset; } public string[] GetAvailablePresets() { return Enum.GetNames(typeof(VoicePreset)); } public void SaveCustomPreset(string presetName) { SaveCurrentToCustom(); } private void OnDestroy() { if (isMicrophoneActive && Microphone.IsRecording(selectedDevice)) { Microphone.End(selectedDevice); } } } internal class AircraftSeat : FVRInteractiveObject { public static Dictionary currentSeat = new Dictionary(); public FVRViveHand hand; public GameObject SitPos; public GameObject EjectPos; public Transform _setPos; private FVRMovementManager _playerMovement; public bool isplayerrotated = false; public override void SimpleInteraction(FVRViveHand hand) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); if (hand.IsThisTheRightHand) { hand = hand.OtherHand; } if ((Object)(object)this.hand == (Object)null) { if (currentSeat.ContainsKey(hand)) { currentSeat[hand].RemoveHand(); } currentSeat.Add(hand, this); this.hand = hand; hand.MovementManager.TeleportToPoint(SitPos.transform.position, false, SitPos.transform.localEulerAngles); } else if ((Object)(object)hand == (Object)(object)this.hand) { RemoveHand(); if ((Object)(object)EjectPos != (Object)null) { ((Component)hand.MovementManager).transform.position = EjectPos.transform.position; } } } private void Awake() { _playerMovement = Object.FindObjectOfType(); } public void Update() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hand != (Object)null) { if (Vector3.Distance(((Component)hand.MovementManager).transform.position, ((Component)this).transform.position) > 25f) { RemoveHand(); } ((Component)hand.MovementManager).transform.position = SitPos.transform.position; Vector3 eulerAngles = ((Component)hand.MovementManager).transform.eulerAngles; ((Component)hand.MovementManager).transform.eulerAngles = Vector3.Lerp(((Component)hand.MovementManager).transform.eulerAngles, eulerAngles, 0.2f * Time.deltaTime); PlayerForwardFollowSet(); isplayerrotated = true; if (GM.CurrentPlayerBody.GetPlayerHealth() <= 0f) { RemoveHand(); } if (((Component)hand.MovementManager).transform.position.y < GM.CurrentSceneSettings.CatchHeight) { RemoveHand(); } } } private void PlayerForwardFollowSet() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) ((Component)_playerMovement).transform.rotation = Quaternion.RotateTowards(((Component)_playerMovement).transform.rotation, ((Component)_setPos).transform.rotation, 5f); } public void RemoveHand() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (currentSeat.ContainsKey(hand)) { currentSeat.Remove(hand); } hand = null; if (isplayerrotated) { ((Component)_playerMovement).transform.eulerAngles = new Vector3(0f, 0f, 0f); isplayerrotated = false; } } private void OnDestroy() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) ((Component)_playerMovement).transform.eulerAngles = new Vector3(0f, 0f, 0f); } } } namespace DestinyScript { public class AngryNoob_FingerTracking : MonoBehaviour { [Header("第24次测试")] [Tooltip("请添加五根手指最靠近手腕位置的骨骼,请按照的顺序添加骨骼位置")] public Transform[] _fingers; [Tooltip("请添加五根手指的指尖顺序与 'Fingers' 相同 如果没有 请再指尖位置创建一个空物体.")] public Transform[] _fingerTips; [Space] [Tooltip("是否为左手")] public bool _LeftHand; public bool _handGrap; [Space] [Tooltip("不要手动添加下面的信息")] public List _fingers_Origin_V = new List(); public List _finger_Origin_Q = new List(); public List _fingerJ = new List(); public List _finger_Target_V = new List(); public List _finger_Target_Q = new List(); public List _finger_Target_J = new List(); [Space] [Header("测试使用")] [Range(0f, 1f)] public float _finger_1; [Range(0f, 1f)] public float _finger_2; [Range(0f, 1f)] public float _finger_3; [Range(0f, 1f)] public float _finger_4; [Range(0f, 1f)] public float _finger_5; [SerializeField] [HideInInspector] public Vector3[] index_OV; [SerializeField] [HideInInspector] public Vector3[] index_TV; [SerializeField] [HideInInspector] public Vector3[] middle_OV; [SerializeField] [HideInInspector] public Vector3[] middle_TV; [SerializeField] [HideInInspector] public Vector3[] ring_OV; [SerializeField] [HideInInspector] public Vector3[] ring_TV; [SerializeField] [HideInInspector] public Vector3[] pinky_OV; [SerializeField] [HideInInspector] public Vector3[] pinky_TV; [SerializeField] [HideInInspector] public Vector3[] thumb_OV; [SerializeField] [HideInInspector] public Vector3[] thumb_TV; [SerializeField] [HideInInspector] public Quaternion[] index_OQ; [SerializeField] [HideInInspector] public Quaternion[] index_TQ; [SerializeField] [HideInInspector] public Quaternion[] middle_OQ; [SerializeField] [HideInInspector] public Quaternion[] middle_TQ; [SerializeField] [HideInInspector] public Quaternion[] ring_OQ; [SerializeField] [HideInInspector] public Quaternion[] ring_TQ; [SerializeField] [HideInInspector] public Quaternion[] pinky_OQ; [SerializeField] [HideInInspector] public Quaternion[] pinky_TQ; [SerializeField] [HideInInspector] public Quaternion[] thumb_OQ; [SerializeField] [HideInInspector] public Quaternion[] thumb_TQ; [SerializeField] [HideInInspector] public Transform[] index_FJ; [SerializeField] [HideInInspector] public Transform[] index_TFJ; [SerializeField] [HideInInspector] public Transform[] middle_FJ; [SerializeField] [HideInInspector] public Transform[] middle_TFJ; [SerializeField] [HideInInspector] public Transform[] ring_FJ; [SerializeField] [HideInInspector] public Transform[] ring_TFJ; [SerializeField] [HideInInspector] public Transform[] pinky_FJ; [SerializeField] [HideInInspector] public Transform[] pinky_TFJ; [SerializeField] [HideInInspector] public Transform[] thumb_FJ; [SerializeField] [HideInInspector] public Transform[] thumb_TFJ; private FVRViveHand _hand_FVRVH; private static int recursiveJudg; private static int recursiveJudg_CloseHand; private int index_C = 0; private int _close_fingerArray = 0; private int index = 0; private int fingerArray = 0; private float T; private float I; private float M; private float R; private float P; private float Tref; private float Iref; private float Mref; private float Rref; private float Pref; private void Awake() { Finger_Load(); } private void Start() { if (_LeftHand) { _hand_FVRVH = ((Component)((Component)Object.FindObjectOfType()).transform.Find("Controller (left)")).GetComponent(); } else { _hand_FVRVH = ((Component)((Component)Object.FindObjectOfType()).transform.Find("Controller (right)")).GetComponent(); } _hand_FVRVH.Display_Controller_Quest2.SetActive(false); _hand_FVRVH.Display_Controller_RiftS.SetActive(false); _hand_FVRVH.Display_Controller_HPR2.SetActive(false); _hand_FVRVH.Display_Controller_Cosmos.SetActive(false); _hand_FVRVH.Display_Controller_Vive.SetActive(false); _hand_FVRVH.Display_Controller_Touch.SetActive(false); _hand_FVRVH.Display_Controller_Index.SetActive(false); _hand_FVRVH.Display_Controller_WMR.SetActive(false); _hand_FVRVH.Display_Controller_Quest3.SetActive(false); } private void LateUpdate() { FingerTracking_Index(); if (_hand_FVRVH.Display_Controller_Vive.activeSelf || _hand_FVRVH.Display_Controller_Touch.activeSelf || _hand_FVRVH.Display_Controller_Index.activeSelf || _hand_FVRVH.Display_Controller_WMR.activeSelf) { _hand_FVRVH.Display_Controller_Vive.SetActive(false); _hand_FVRVH.Display_Controller_Touch.SetActive(false); _hand_FVRVH.Display_Controller_Index.SetActive(false); _hand_FVRVH.Display_Controller_WMR.SetActive(false); } } private void FingerTracking_Index() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Invalid comparison between Unknown and I4 //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Invalid comparison between Unknown and I4 //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_1057: Unknown result type (might be due to invalid IL or missing references) //IL_106f: Unknown result type (might be due to invalid IL or missing references) //IL_107a: Unknown result type (might be due to invalid IL or missing references) //IL_10a6: Unknown result type (might be due to invalid IL or missing references) //IL_10be: Unknown result type (might be due to invalid IL or missing references) //IL_10c9: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_1135: Unknown result type (might be due to invalid IL or missing references) //IL_114d: Unknown result type (might be due to invalid IL or missing references) //IL_1158: Unknown result type (might be due to invalid IL or missing references) //IL_1184: Unknown result type (might be due to invalid IL or missing references) //IL_119c: Unknown result type (might be due to invalid IL or missing references) //IL_11a7: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_1213: Unknown result type (might be due to invalid IL or missing references) //IL_122b: Unknown result type (might be due to invalid IL or missing references) //IL_1236: Unknown result type (might be due to invalid IL or missing references) //IL_1262: Unknown result type (might be due to invalid IL or missing references) //IL_127a: Unknown result type (might be due to invalid IL or missing references) //IL_1285: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0778: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_12f1: Unknown result type (might be due to invalid IL or missing references) //IL_1309: Unknown result type (might be due to invalid IL or missing references) //IL_1314: Unknown result type (might be due to invalid IL or missing references) //IL_1340: Unknown result type (might be due to invalid IL or missing references) //IL_1358: Unknown result type (might be due to invalid IL or missing references) //IL_1363: Unknown result type (might be due to invalid IL or missing references) //IL_0ac6: Unknown result type (might be due to invalid IL or missing references) //IL_0ade: Unknown result type (might be due to invalid IL or missing references) //IL_0ae9: Unknown result type (might be due to invalid IL or missing references) //IL_0b15: Unknown result type (might be due to invalid IL or missing references) //IL_0b2d: Unknown result type (might be due to invalid IL or missing references) //IL_0b38: Unknown result type (might be due to invalid IL or missing references) //IL_13cf: Unknown result type (might be due to invalid IL or missing references) //IL_13e7: Unknown result type (might be due to invalid IL or missing references) //IL_13f2: Unknown result type (might be due to invalid IL or missing references) //IL_141e: Unknown result type (might be due to invalid IL or missing references) //IL_1436: Unknown result type (might be due to invalid IL or missing references) //IL_1441: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07ec: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_0823: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_0846: Unknown result type (might be due to invalid IL or missing references) //IL_0b89: Unknown result type (might be due to invalid IL or missing references) //IL_0ba1: Unknown result type (might be due to invalid IL or missing references) //IL_0bac: Unknown result type (might be due to invalid IL or missing references) //IL_0bd8: Unknown result type (might be due to invalid IL or missing references) //IL_0bf0: Unknown result type (might be due to invalid IL or missing references) //IL_0bfb: Unknown result type (might be due to invalid IL or missing references) //IL_0897: Unknown result type (might be due to invalid IL or missing references) //IL_08af: Unknown result type (might be due to invalid IL or missing references) //IL_08ba: Unknown result type (might be due to invalid IL or missing references) //IL_08e6: Unknown result type (might be due to invalid IL or missing references) //IL_08fe: Unknown result type (might be due to invalid IL or missing references) //IL_0909: Unknown result type (might be due to invalid IL or missing references) //IL_0c4c: Unknown result type (might be due to invalid IL or missing references) //IL_0c64: Unknown result type (might be due to invalid IL or missing references) //IL_0c6f: Unknown result type (might be due to invalid IL or missing references) //IL_0c9b: Unknown result type (might be due to invalid IL or missing references) //IL_0cb3: Unknown result type (might be due to invalid IL or missing references) //IL_0cbe: Unknown result type (might be due to invalid IL or missing references) //IL_0f67: Unknown result type (might be due to invalid IL or missing references) //IL_0f7f: Unknown result type (might be due to invalid IL or missing references) //IL_0f8f: Unknown result type (might be due to invalid IL or missing references) //IL_0fbb: Unknown result type (might be due to invalid IL or missing references) //IL_0fd3: Unknown result type (might be due to invalid IL or missing references) //IL_0fe3: Unknown result type (might be due to invalid IL or missing references) //IL_0e7c: Unknown result type (might be due to invalid IL or missing references) //IL_0e94: Unknown result type (might be due to invalid IL or missing references) //IL_0ea4: Unknown result type (might be due to invalid IL or missing references) //IL_0ed0: Unknown result type (might be due to invalid IL or missing references) //IL_0ee8: Unknown result type (might be due to invalid IL or missing references) //IL_0ef8: Unknown result type (might be due to invalid IL or missing references) //IL_0970: Unknown result type (might be due to invalid IL or missing references) //IL_0988: Unknown result type (might be due to invalid IL or missing references) //IL_0993: Unknown result type (might be due to invalid IL or missing references) //IL_09bf: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09e2: Unknown result type (might be due to invalid IL or missing references) //IL_0d25: Unknown result type (might be due to invalid IL or missing references) //IL_0d3d: Unknown result type (might be due to invalid IL or missing references) //IL_0d48: Unknown result type (might be due to invalid IL or missing references) //IL_0d74: Unknown result type (might be due to invalid IL or missing references) //IL_0d8c: Unknown result type (might be due to invalid IL or missing references) //IL_0d97: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_hand_FVRVH != (Object)null && !_handGrap && (int)_hand_FVRVH.CMode == 3) { if (_hand_FVRVH.Input.FingerCurl_Index >= 0.005f) { for (int i = 0; i < _fingerJ[0].Length; i++) { _fingerJ[0][i].localPosition = Vector3.Lerp(_fingers_Origin_V[0][i], _finger_Target_V[0][i], _hand_FVRVH.Input.FingerCurl_Index); _fingerJ[0][i].localRotation = Quaternion.Lerp(_finger_Origin_Q[0][i], _finger_Target_Q[0][i], _hand_FVRVH.Input.FingerCurl_Index); } } if (_hand_FVRVH.Input.FingerCurl_Middle >= 0.005f) { for (int j = 0; j < _fingerJ[1].Length; j++) { _fingerJ[1][j].localPosition = Vector3.Lerp(_fingers_Origin_V[1][j], _finger_Target_V[1][j], _hand_FVRVH.Input.FingerCurl_Middle); _fingerJ[1][j].localRotation = Quaternion.Lerp(_finger_Origin_Q[1][j], _finger_Target_Q[1][j], _hand_FVRVH.Input.FingerCurl_Middle); } } if (_hand_FVRVH.Input.FingerCurl_Ring >= 0.005f) { for (int k = 0; k < _fingerJ[2].Length; k++) { _fingerJ[2][k].localPosition = Vector3.Lerp(_fingers_Origin_V[2][k], _finger_Target_V[2][k], _hand_FVRVH.Input.FingerCurl_Ring); _fingerJ[2][k].localRotation = Quaternion.Lerp(_finger_Origin_Q[2][k], _finger_Target_Q[2][k], _hand_FVRVH.Input.FingerCurl_Ring); } } if (_hand_FVRVH.Input.FingerCurl_Pinky >= 0.005f) { for (int l = 0; l < _fingerJ[3].Length; l++) { _fingerJ[3][l].localPosition = Vector3.Lerp(_fingers_Origin_V[3][l], _finger_Target_V[3][l], _hand_FVRVH.Input.FingerCurl_Pinky); _fingerJ[3][l].localRotation = Quaternion.Lerp(_finger_Origin_Q[3][l], _finger_Target_Q[3][l], _hand_FVRVH.Input.FingerCurl_Pinky); } } if (_hand_FVRVH.Input.FingerCurl_Thumb >= 0.005f) { for (int m = 0; m < _fingerJ[4].Length; m++) { _fingerJ[4][m].localPosition = Vector3.Lerp(_fingers_Origin_V[4][m], _finger_Target_V[4][m], _hand_FVRVH.Input.FingerCurl_Thumb); _fingerJ[4][m].localRotation = Quaternion.Lerp(_finger_Origin_Q[4][m], _finger_Target_Q[4][m], _hand_FVRVH.Input.FingerCurl_Thumb); } } return; } if ((Object)(object)_hand_FVRVH != (Object)null && !_handGrap && (int)_hand_FVRVH.CMode == 1) { I = Mathf.SmoothDamp(I, _hand_FVRVH.Input.TriggerFloat, ref Iref, 0.2f); float num = 0f; for (int n = 0; n < _fingerJ[0].Length; n++) { _fingerJ[0][n].localPosition = Vector3.Lerp(_fingers_Origin_V[0][n], _finger_Target_V[0][n], I); _fingerJ[0][n].localRotation = Quaternion.Lerp(_finger_Origin_Q[0][n], _finger_Target_Q[0][n], I); } bool gripPressed = _hand_FVRVH.Input.GripPressed; if (gripPressed) { T = Mathf.SmoothDamp(T, 1f, ref Tref, 0.2f); M = Mathf.SmoothDamp(M, 1f, ref Mref, 0.2f); R = Mathf.SmoothDamp(R, 1f, ref Rref, 0.15f); P = Mathf.SmoothDamp(P, 1f, ref Pref, 0.1f); for (int num2 = 0; num2 < _fingerJ[1].Length; num2++) { _fingerJ[1][num2].localPosition = Vector3.Lerp(_fingers_Origin_V[1][num2], _finger_Target_V[1][num2], M); _fingerJ[1][num2].localRotation = Quaternion.Lerp(_finger_Origin_Q[1][num2], _finger_Target_Q[1][num2], M); } for (int num3 = 0; num3 < _fingerJ[2].Length; num3++) { _fingerJ[2][num3].localPosition = Vector3.Lerp(_fingers_Origin_V[2][num3], _finger_Target_V[2][num3], R); _fingerJ[2][num3].localRotation = Quaternion.Lerp(_finger_Origin_Q[2][num3], _finger_Target_Q[2][num3], R); } for (int num4 = 0; num4 < _fingerJ[3].Length; num4++) { _fingerJ[3][num4].localPosition = Vector3.Lerp(_fingers_Origin_V[3][num4], _finger_Target_V[3][num4], P); _fingerJ[3][num4].localRotation = Quaternion.Lerp(_finger_Origin_Q[3][num4], _finger_Target_Q[3][num4], P); } for (int num5 = 0; num5 < _fingerJ[4].Length; num5++) { if (num <= 1f) { _fingerJ[4][num5].localPosition = Vector3.Lerp(_fingers_Origin_V[4][num5], _finger_Target_V[4][num5], T); _fingerJ[4][num5].localRotation = Quaternion.Lerp(_finger_Origin_Q[4][num5], _finger_Target_Q[4][num5], T); } } } else if (!gripPressed) { T = Mathf.SmoothDamp(T, 0f, ref Tref, 0.2f); M = Mathf.SmoothDamp(M, 0f, ref Mref, 0.2f); R = Mathf.SmoothDamp(R, 0f, ref Rref, 0.15f); P = Mathf.SmoothDamp(P, 0f, ref Pref, 0.1f); for (int num6 = 0; num6 < _fingerJ[1].Length; num6++) { _fingerJ[1][num6].localPosition = Vector3.Lerp(_fingers_Origin_V[1][num6], _finger_Target_V[1][num6], M); _fingerJ[1][num6].localRotation = Quaternion.Lerp(_finger_Origin_Q[1][num6], _finger_Target_Q[1][num6], M); } for (int num7 = 0; num7 < _fingerJ[2].Length; num7++) { _fingerJ[2][num7].localPosition = Vector3.Lerp(_fingers_Origin_V[2][num7], _finger_Target_V[2][num7], R); _fingerJ[2][num7].localRotation = Quaternion.Lerp(_finger_Origin_Q[2][num7], _finger_Target_Q[2][num7], R); } for (int num8 = 0; num8 < _fingerJ[3].Length; num8++) { _fingerJ[3][num8].localPosition = Vector3.Lerp(_fingers_Origin_V[3][num8], _finger_Target_V[3][num8], P); _fingerJ[3][num8].localRotation = Quaternion.Lerp(_finger_Origin_Q[3][num8], _finger_Target_Q[3][num8], P); } for (int num9 = 0; num9 < _fingerJ[4].Length; num9++) { if (num <= 1f) { _fingerJ[4][num9].localPosition = Vector3.Lerp(_fingers_Origin_V[4][num9], _finger_Target_V[4][num9], T); _fingerJ[4][num9].localRotation = Quaternion.Lerp(_finger_Origin_Q[4][num9], _finger_Target_Q[4][num9], T); } } } bool flag = _hand_FVRVH.Input.Secondary2AxisInputAxes.x >= 0.01f || _hand_FVRVH.Input.Secondary2AxisInputAxes.y >= 0.01f; if (_hand_FVRVH.Input.AXButtonPressed || _hand_FVRVH.Input.BYButtonPressed || flag) { for (int num10 = 0; num10 < _fingerJ[4].Length; num10++) { if (num <= 1f) { _fingerJ[4][num10].localPosition = Vector3.Lerp(_fingers_Origin_V[4][num10], _finger_Target_V[4][num10], num += 0.01f); _fingerJ[4][num10].localRotation = Quaternion.Lerp(_finger_Origin_Q[4][num10], _finger_Target_Q[4][num10], num += 0.01f); } } return; } for (int num11 = 0; num11 < _fingerJ[4].Length; num11++) { if (num >= 0f) { _fingerJ[4][num11].localPosition = Vector3.Lerp(_fingers_Origin_V[4][num11], _finger_Target_V[4][num11], num -= 0.01f); _fingerJ[4][num11].localRotation = Quaternion.Lerp(_finger_Origin_Q[4][num11], _finger_Target_Q[4][num11], num -= 0.01f); } } return; } if (_finger_1 >= 0.005f) { for (int num12 = 0; num12 < _fingerJ[0].Length; num12++) { _fingerJ[0][num12].localPosition = Vector3.Lerp(_fingers_Origin_V[0][num12], _finger_Target_V[0][num12], _finger_1); _fingerJ[0][num12].localRotation = Quaternion.Lerp(_finger_Origin_Q[0][num12], _finger_Target_Q[0][num12], _finger_1); } } if (_finger_2 >= 0.005f) { for (int num13 = 0; num13 < _fingerJ[1].Length; num13++) { _fingerJ[1][num13].localPosition = Vector3.Lerp(_fingers_Origin_V[1][num13], _finger_Target_V[1][num13], _finger_2); _fingerJ[1][num13].localRotation = Quaternion.Lerp(_finger_Origin_Q[1][num13], _finger_Target_Q[1][num13], _finger_2); } } if (_finger_3 >= 0.005f) { for (int num14 = 0; num14 < _fingerJ[2].Length; num14++) { _fingerJ[2][num14].localPosition = Vector3.Lerp(_fingers_Origin_V[2][num14], _finger_Target_V[2][num14], _finger_3); _fingerJ[2][num14].localRotation = Quaternion.Lerp(_finger_Origin_Q[2][num14], _finger_Target_Q[2][num14], _finger_3); } } if (_finger_4 >= 0.005f) { for (int num15 = 0; num15 < _fingerJ[3].Length; num15++) { _fingerJ[3][num15].localPosition = Vector3.Lerp(_fingers_Origin_V[3][num15], _finger_Target_V[3][num15], _finger_4); _fingerJ[3][num15].localRotation = Quaternion.Lerp(_finger_Origin_Q[3][num15], _finger_Target_Q[3][num15], _finger_4); } } if (_finger_5 >= 0.005f) { for (int num16 = 0; num16 < _fingerJ[4].Length; num16++) { _fingerJ[4][num16].localPosition = Vector3.Lerp(_fingers_Origin_V[4][num16], _finger_Target_V[4][num16], _finger_5); _fingerJ[4][num16].localRotation = Quaternion.Lerp(_finger_Origin_Q[4][num16], _finger_Target_Q[4][num16], _finger_5); } } } [ContextMenu("Set Open Hand Pos")] public unsafe void GetFirstFingerPointAndRotate() { //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _fingers.Length; i++) { int count = 0; GetFingerPosfirstTransform(_fingers[i], ref count, ((Component)_fingerTips[i]).gameObject); _fingers_Origin_V.Add((Vector3[])(object)new Vector3[count]); _finger_Origin_Q.Add((Quaternion[])(object)new Quaternion[count]); _fingerJ.Add((Transform[])(object)new Transform[count]); SetFingerPosFirstTransform(_fingers[i], ref index, i, ref fingerArray); fingerArray = 0; recursiveJudg = 0; } MonoBehaviour.print((object)("手指起始位置数量---" + _fingers_Origin_V.Count + "--")); MonoBehaviour.print((object)("手指起始旋转数量---" + _finger_Origin_Q.Count + "--")); MonoBehaviour.print((object)("手指数组数量" + _fingers.Length)); MonoBehaviour.print((object)("手指数组数量_save" + _fingerJ.Count)); for (int j = 0; j < _fingers_Origin_V.Count; j++) { for (int k = 0; k < _fingers_Origin_V[j].Length; k++) { string text = "_fingers_Origin_V---"; string text2 = _fingers_Origin_V[j].Length.ToString(); string text3 = "--"; Vector3 val = _fingers_Origin_V[j][k]; MonoBehaviour.print((object)(text + text2 + text3 + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString())); } } for (int l = 0; l < _finger_Origin_Q.Count; l++) { for (int m = 0; m < _finger_Origin_Q[l].Length; m++) { MonoBehaviour.print((object)("_finger_Origin_Q---" + l + "-" + _finger_Origin_Q[l].Length + "--" + ((object)((Quaternion)(ref _finger_Origin_Q[l][m])).eulerAngles/*cast due to .constrained prefix*/).ToString())); } } for (int n = 0; n < _fingerJ.Count; n++) { for (int num = 0; num < _fingerJ[n].Length; num++) { string[] obj = new string[5] { _fingerJ[n].Length.ToString(), "---", ((object)_fingerJ[n][num].localPosition/*cast due to .constrained prefix*/).ToString(), "--", null }; Quaternion localRotation = _fingerJ[n][num].localRotation; obj[4] = ((object)((Quaternion)(ref localRotation)).eulerAngles/*cast due to .constrained prefix*/).ToString(); MonoBehaviour.print((object)string.Concat(obj)); } MonoBehaviour.print((object)("手指Transform_Save" + _fingerJ[n].Length)); } } private int GetFingerPosfirstTransform(Transform fingerObj, ref int count, GameObject k) { if ((Object)(object)((Component)fingerObj).gameObject != (Object)(object)k) { count++; for (int i = 0; i < fingerObj.childCount; i++) { GetFingerPosfirstTransform(fingerObj.GetChild(i), ref count, k); } } return count; } private void SetFingerPosFirstTransform(Transform fingerObj, ref int a, int k, ref int fingerArray) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((Component)fingerObj).gameObject != (Object)(object)((Component)_fingerTips[k]).gameObject)) { return; } for (int i = 0; i < fingerObj.childCount; i++) { MonoBehaviour.print((object)("setFingerOpsValve__" + fingerObj.childCount)); GetFingerPoint(k, fingerObj.localPosition, fingerObj.localRotation, fingerObj, fingerArray); fingerArray++; if (recursiveJudg < 1) { index++; } recursiveJudg = 1; SetFingerPosFirstTransform(fingerObj.GetChild(i), ref index, k, ref fingerArray); } } private void GetFingerPoint(int c, Vector3 _position, Quaternion _quaternion, Transform fingerObj_Jpoint, int fingerArray) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) _fingers_Origin_V[c].SetValue(_position, fingerArray); _finger_Origin_Q[c].SetValue(_quaternion, fingerArray); _fingerJ[c].SetValue(fingerObj_Jpoint, fingerArray); } [ContextMenu("Set Close Hand Pos")] public unsafe void GetCloseFingerPointAndRotate() { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _fingers.Length; i++) { int count_C = 0; GetCloseFingerPosfirstTransform(_fingers[i], ref count_C, ((Component)_fingerTips[i]).gameObject); _finger_Target_V.Add((Vector3[])(object)new Vector3[count_C]); _finger_Target_Q.Add((Quaternion[])(object)new Quaternion[count_C]); _finger_Target_J.Add((Transform[])(object)new Transform[count_C]); SetCloseFingerPosFirstTransform(_fingers[i], ref index_C, i, ref _close_fingerArray); _close_fingerArray = 0; recursiveJudg_CloseHand = 0; } for (int j = 0; j < _finger_Target_J.Count; j++) { for (int k = 0; k < _finger_Target_J[j].Length; k++) { string[] obj = new string[6] { "握拳", _finger_Target_J[j].Length.ToString(), "---", ((object)_finger_Target_J[j][k].localPosition/*cast due to .constrained prefix*/).ToString(), "--", null }; Quaternion localRotation = _finger_Target_J[j][k].localRotation; obj[5] = ((object)((Quaternion)(ref localRotation)).eulerAngles/*cast due to .constrained prefix*/).ToString(); MonoBehaviour.print((object)string.Concat(obj)); } MonoBehaviour.print((object)("手指Transform_Save" + _fingerJ[j].Length)); } for (int l = 0; l < _finger_Target_V.Count; l++) { for (int m = 0; m < _finger_Target_V[l].Length; m++) { string text = "手指目标/弯曲:数组数量---"; string text2 = l.ToString(); string text3 = "--"; Vector3 val = _finger_Target_V[l][m]; MonoBehaviour.print((object)(text + text2 + text3 + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString())); } } for (int n = 0; n < _finger_Target_Q.Count; n++) { for (int num = 0; num < _finger_Target_Q[n].Length; num++) { MonoBehaviour.print((object)("手指目标旋转---" + n + "--" + ((object)((Quaternion)(ref _finger_Target_Q[n][num])).eulerAngles/*cast due to .constrained prefix*/).ToString())); } } } private int GetCloseFingerPosfirstTransform(Transform fingerObj, ref int count_C, GameObject k) { if ((Object)(object)((Component)fingerObj).gameObject != (Object)(object)k) { count_C++; for (int i = 0; i < fingerObj.childCount; i++) { GetCloseFingerPosfirstTransform(fingerObj.GetChild(i), ref count_C, k); } } return count_C; } private void SetCloseFingerPosFirstTransform(Transform fingerObj, ref int index_C, int k, ref int _close_fingerArray1) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((Component)fingerObj).gameObject != (Object)(object)((Component)_fingerTips[k]).gameObject)) { return; } for (int i = 0; i < fingerObj.childCount; i++) { GetCloseFingerPoint(k, fingerObj.localPosition, fingerObj.localRotation, fingerObj, ref _close_fingerArray); _close_fingerArray++; if (recursiveJudg_CloseHand < 1) { index_C++; } recursiveJudg_CloseHand = 1; SetCloseFingerPosFirstTransform(fingerObj.GetChild(i), ref index_C, k, ref _close_fingerArray); } } private void GetCloseFingerPoint(int d, Vector3 _position, Quaternion _quaternion, Transform fingerObj_Jpoint, ref int _close_fingerArray) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) _finger_Target_V[d].SetValue(_position, _close_fingerArray); _finger_Target_Q[d].SetValue(_quaternion, _close_fingerArray); _finger_Target_J[d].SetValue(fingerObj_Jpoint, _close_fingerArray); } [ContextMenu("Save Value")] public void Finger_Save() { Save_Vector3(); Save_Quaternion(); Save_Transform(); } [ContextMenu("Save Transfomr")] public void Finger_Save_Transform() { Save_Transform(); } private unsafe void Finger_Load() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) Load_Vector3(); Load_Quaternion(); Load_Transform(); for (int i = 0; i < _fingers_Origin_V.Count; i++) { for (int j = 0; j < _fingers_Origin_V[i].Length; j++) { string[] array = new string[6] { "_fingers_Origin_V.Length----", i.ToString(), "-", _fingers_Origin_V[i].Length.ToString(), "--_fingers_Origin_V[x][x]", null }; int num = 5; Vector3 val = _fingers_Origin_V[i][j]; array[num] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString(); } } for (int k = 0; k < _finger_Origin_Q.Count; k++) { for (int l = 0; l < _finger_Origin_Q[k].Length; l++) { } } for (int m = 0; m < _fingerJ.Count; m++) { for (int n = 0; n < _fingerJ[m].Length; n++) { } } } public void Save_Vector3() { index_OV = (Vector3[])(object)new Vector3[_fingers_Origin_V[1].Length]; middle_OV = (Vector3[])(object)new Vector3[_fingers_Origin_V[2].Length]; ring_OV = (Vector3[])(object)new Vector3[_fingers_Origin_V[3].Length]; pinky_OV = (Vector3[])(object)new Vector3[_fingers_Origin_V[4].Length]; thumb_OV = (Vector3[])(object)new Vector3[_fingers_Origin_V[0].Length]; index_TV = (Vector3[])(object)new Vector3[_finger_Target_V[1].Length]; middle_TV = (Vector3[])(object)new Vector3[_finger_Target_V[2].Length]; ring_TV = (Vector3[])(object)new Vector3[_finger_Target_V[3].Length]; pinky_TV = (Vector3[])(object)new Vector3[_finger_Target_V[4].Length]; thumb_TV = (Vector3[])(object)new Vector3[_finger_Target_V[0].Length]; _fingers_Origin_V[1].CopyTo(index_OV, 0); _fingers_Origin_V[2].CopyTo(middle_OV, 0); _fingers_Origin_V[3].CopyTo(ring_OV, 0); _fingers_Origin_V[4].CopyTo(pinky_OV, 0); _fingers_Origin_V[0].CopyTo(thumb_OV, 0); _finger_Target_V[1].CopyTo(index_TV, 0); _finger_Target_V[2].CopyTo(middle_TV, 0); _finger_Target_V[3].CopyTo(ring_TV, 0); _finger_Target_V[4].CopyTo(pinky_TV, 0); _finger_Target_V[0].CopyTo(thumb_TV, 0); } public void Save_Quaternion() { index_OQ = (Quaternion[])(object)new Quaternion[_finger_Origin_Q[1].Length]; middle_OQ = (Quaternion[])(object)new Quaternion[_finger_Origin_Q[2].Length]; ring_OQ = (Quaternion[])(object)new Quaternion[_finger_Origin_Q[3].Length]; pinky_OQ = (Quaternion[])(object)new Quaternion[_finger_Origin_Q[4].Length]; thumb_OQ = (Quaternion[])(object)new Quaternion[_finger_Origin_Q[0].Length]; index_TQ = (Quaternion[])(object)new Quaternion[_finger_Target_Q[1].Length]; middle_TQ = (Quaternion[])(object)new Quaternion[_finger_Target_Q[2].Length]; ring_TQ = (Quaternion[])(object)new Quaternion[_finger_Target_Q[3].Length]; pinky_TQ = (Quaternion[])(object)new Quaternion[_finger_Target_Q[4].Length]; thumb_TQ = (Quaternion[])(object)new Quaternion[_finger_Target_Q[0].Length]; _finger_Origin_Q[1].CopyTo(index_OQ, 0); _finger_Origin_Q[2].CopyTo(middle_OQ, 0); _finger_Origin_Q[3].CopyTo(ring_OQ, 0); _finger_Origin_Q[4].CopyTo(pinky_OQ, 0); _finger_Origin_Q[0].CopyTo(thumb_OQ, 0); _finger_Target_Q[1].CopyTo(index_TQ, 0); _finger_Target_Q[2].CopyTo(middle_TQ, 0); _finger_Target_Q[3].CopyTo(ring_TQ, 0); _finger_Target_Q[4].CopyTo(pinky_TQ, 0); _finger_Target_Q[0].CopyTo(thumb_TQ, 0); } public void Save_Transform() { index_FJ = (Transform[])(object)new Transform[_fingerJ[1].Length]; middle_FJ = (Transform[])(object)new Transform[_fingerJ[2].Length]; ring_FJ = (Transform[])(object)new Transform[_fingerJ[3].Length]; pinky_FJ = (Transform[])(object)new Transform[_fingerJ[4].Length]; thumb_FJ = (Transform[])(object)new Transform[_fingerJ[0].Length]; index_TFJ = (Transform[])(object)new Transform[_finger_Target_J[1].Length]; middle_TFJ = (Transform[])(object)new Transform[_finger_Target_J[2].Length]; ring_TFJ = (Transform[])(object)new Transform[_finger_Target_J[3].Length]; pinky_TFJ = (Transform[])(object)new Transform[_finger_Target_J[4].Length]; thumb_TFJ = (Transform[])(object)new Transform[_finger_Target_J[0].Length]; _fingerJ[1].CopyTo(index_FJ, 0); _fingerJ[2].CopyTo(middle_FJ, 0); _fingerJ[3].CopyTo(ring_FJ, 0); _fingerJ[4].CopyTo(pinky_FJ, 0); _fingerJ[0].CopyTo(thumb_FJ, 0); _finger_Target_J[1].CopyTo(index_TFJ, 0); _finger_Target_J[2].CopyTo(middle_TFJ, 0); _finger_Target_J[3].CopyTo(ring_TFJ, 0); _finger_Target_J[4].CopyTo(pinky_TFJ, 0); _finger_Target_J[0].CopyTo(thumb_TFJ, 0); } public void Load_Vector3() { _fingers_Origin_V.Add(index_OV); _fingers_Origin_V.Add(middle_OV); _fingers_Origin_V.Add(ring_OV); _fingers_Origin_V.Add(pinky_OV); _fingers_Origin_V.Add(thumb_OV); _finger_Target_V.Add(index_TV); _finger_Target_V.Add(middle_TV); _finger_Target_V.Add(ring_TV); _finger_Target_V.Add(pinky_TV); _finger_Target_V.Add(thumb_TV); } public void Load_Quaternion() { _finger_Origin_Q.Add(index_OQ); _finger_Origin_Q.Add(middle_OQ); _finger_Origin_Q.Add(ring_OQ); _finger_Origin_Q.Add(pinky_OQ); _finger_Origin_Q.Add(thumb_OQ); _finger_Target_Q.Add(index_TQ); _finger_Target_Q.Add(middle_TQ); _finger_Target_Q.Add(ring_TQ); _finger_Target_Q.Add(pinky_TQ); _finger_Target_Q.Add(thumb_TQ); } public void Load_Transform() { _fingerJ.Add(index_FJ); _fingerJ.Add(middle_FJ); _fingerJ.Add(ring_FJ); _fingerJ.Add(pinky_FJ); _fingerJ.Add(thumb_FJ); _finger_Target_J.Add(index_TFJ); _finger_Target_J.Add(middle_TFJ); _finger_Target_J.Add(ring_TFJ); _finger_Target_J.Add(pinky_TFJ); _finger_Target_J.Add(thumb_TFJ); } [ContextMenu("TestSavePosAndRotate")] public void TestSavePosAndRotate() { Finger_Load(); } [ContextMenu("Clear hand_Pos")] public void ClearAllHand_Pos() { _fingers_Origin_V.Clear(); _finger_Origin_Q.Clear(); _fingerJ.Clear(); _finger_Target_V.Clear(); _finger_Target_Q.Clear(); _finger_Target_J.Clear(); _fingers_Origin_V = new List(); _finger_Origin_Q = new List(); _fingerJ = new List(); _finger_Target_V = new List(); _finger_Target_Q = new List(); _finger_Target_J = new List(); index_C = 0; _close_fingerArray = 0; index = 0; fingerArray = 0; } [ContextMenu("Clear Open Hand_Pos")] public void ClearOpenHand_Pos() { _fingers_Origin_V.Clear(); _finger_Origin_Q.Clear(); _fingerJ.Clear(); _fingers_Origin_V = new List(); _finger_Origin_Q = new List(); _fingerJ = new List(); index = 0; fingerArray = 0; } [ContextMenu("Clear Close Hand_Pos")] public void ClearCloseHand_Pos() { _finger_Target_V.Clear(); _finger_Target_Q.Clear(); _finger_Target_J.Clear(); _finger_Target_V = new List(); _finger_Target_Q = new List(); _finger_Target_J = new List(); index_C = 0; _close_fingerArray = 0; } [ContextMenu("Preview OpenHand_Pos")] public void PreviewOpenHand_Pos() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _fingerJ.Count; i++) { for (int j = 0; j < _fingerJ[i].Length; j++) { _fingerJ[i][j].localPosition = _fingers_Origin_V[i][j]; _fingerJ[i][j].localRotation = _finger_Origin_Q[i][j]; } } } [ContextMenu("Preview Close Hand_Pos")] public void PreviewCloseHand_Pos() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _finger_Target_J.Count; i++) { for (int j = 0; j < _finger_Target_J[i].Length; j++) { _finger_Target_J[i][j].localPosition = _finger_Target_V[i][j]; _finger_Target_J[i][j].localRotation = _finger_Target_Q[i][j]; } } } } } namespace JerryComponent { public class AutoTitan : MonoBehaviour { public bool isLeftGrab; public bool isRightGrab; public GameObject T203Prop; public Transform proptar; public Vector3 PropRef; public TitanGrab LeftTitanHand; public TitanGrab RightTitanHand; public Collider thiscol; public bool isWeapon = false; public GameObject T203Mesh; public Transform AimingR; public GameObject breachopen; public GameObject breachclose; public GameObject enteraudio; public GameObject shieldrot; public GameObject aimR; public LayerMask lm; public bool ammospawned = false; public FVRFireArmChamber chamber; public float countdown; public Derringer derringer; public GameObject crouch; public GameObject realSeatpos; public GameObject trigger; public Transform idleL; public Transform idleR; public FVRPhysicalObject grabL; public FVRPhysicalObject grabR; public GameObject t203lid; public Transform muzzle; public FVRFireArmRound projectile; public Transform ammopouch; public Transform reloadwell; public Transform foregrip; public bool isReloaded = false; public GameObject ammo; public bool isAmmoinHand = false; public Vector3 velocity; public Transform nearestAI; public GameObject mark; public float distanceNearest = 0f; public List currentAI = null; public HeadRotate hr; public GameObject headGeo; public bool pilotblasted = false; public GameObject seatblast; public bool hatch = false; public GameObject screen; public GameObject hatchGeo; public float currentcrouchVel = 0f; public float agentoffset = 0f; public NavMeshAgent agent; public AR15HandleSightFlipper hatchtoggle; public GameObject followingtarget; public GameObject leftHand; public GameObject HL; public GameObject HR; public GameObject rightHand; public bool iHaveAPilot = false; public bool iFindAPilot = false; public bool iEatAPilot = false; public bool iSpitAPilot = false; public GameObject handtargetL; public GameObject handtargetR; public Vector3 currentVelL = Vector3.zero; public Vector3 currentVelR = Vector3.zero; public Vector3 currentVelHatch = Vector3.zero; public Transform seatpos; public Transform grabpilotpos; public Transform realgrabpilotpos; public bool pilotInSeat; public GameObject handLpilot; public GameObject handRpilot; public bool isAuto = true; public Transform player; public GameObject lookAtObj; public bool startwaiting = false; public float wait = 10f; public GameObject CamHead; private void Start() { T203Mesh.gameObject.transform.SetParent((Transform)null); HL.transform.SetParent((Transform)null); HR.transform.SetParent((Transform)null); ((Component)proptar).transform.SetParent((Transform)null); ((Component)muzzle).gameObject.transform.SetParent((Transform)null); } private void Update() { //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_093e: Unknown result type (might be due to invalid IL or missing references) //IL_094e: Unknown result type (might be due to invalid IL or missing references) //IL_095e: Unknown result type (might be due to invalid IL or missing references) //IL_0987: Unknown result type (might be due to invalid IL or missing references) //IL_098c: Unknown result type (might be due to invalid IL or missing references) //IL_09a5: Unknown result type (might be due to invalid IL or missing references) //IL_09aa: Unknown result type (might be due to invalid IL or missing references) //IL_09c9: Unknown result type (might be due to invalid IL or missing references) //IL_09ce: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09ec: Unknown result type (might be due to invalid IL or missing references) //IL_09fc: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_07d8: Unknown result type (might be due to invalid IL or missing references) //IL_076a: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0a6c: Unknown result type (might be due to invalid IL or missing references) //IL_0a85: Unknown result type (might be due to invalid IL or missing references) //IL_080e: Unknown result type (might be due to invalid IL or missing references) //IL_0827: Unknown result type (might be due to invalid IL or missing references) //IL_0837: Unknown result type (might be due to invalid IL or missing references) //IL_084c: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_0b2b: Unknown result type (might be due to invalid IL or missing references) //IL_0b30: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Unknown result type (might be due to invalid IL or missing references) //IL_08b7: Unknown result type (might be due to invalid IL or missing references) //IL_08d0: Unknown result type (might be due to invalid IL or missing references) //IL_08d5: Unknown result type (might be due to invalid IL or missing references) //IL_08f4: Unknown result type (might be due to invalid IL or missing references) //IL_08f9: Unknown result type (might be due to invalid IL or missing references) //IL_0902: Unknown result type (might be due to invalid IL or missing references) //IL_06ca: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Unknown result type (might be due to invalid IL or missing references) //IL_06fe: Unknown result type (might be due to invalid IL or missing references) //IL_0b83: Unknown result type (might be due to invalid IL or missing references) //IL_0bb6: Unknown result type (might be due to invalid IL or missing references) //IL_0bbb: Unknown result type (might be due to invalid IL or missing references) //IL_0bc9: Unknown result type (might be due to invalid IL or missing references) //IL_1326: Unknown result type (might be due to invalid IL or missing references) //IL_134a: Unknown result type (might be due to invalid IL or missing references) //IL_136e: Unknown result type (might be due to invalid IL or missing references) //IL_0cfb: Unknown result type (might be due to invalid IL or missing references) //IL_0d25: Unknown result type (might be due to invalid IL or missing references) //IL_0d45: Unknown result type (might be due to invalid IL or missing references) //IL_0d65: Unknown result type (might be due to invalid IL or missing references) //IL_0dfc: Unknown result type (might be due to invalid IL or missing references) //IL_0e26: Unknown result type (might be due to invalid IL or missing references) //IL_0e46: Unknown result type (might be due to invalid IL or missing references) //IL_0e66: Unknown result type (might be due to invalid IL or missing references) //IL_0ff7: Unknown result type (might be due to invalid IL or missing references) //IL_101b: Unknown result type (might be due to invalid IL or missing references) //IL_1036: Unknown result type (might be due to invalid IL or missing references) //IL_1051: Unknown result type (might be due to invalid IL or missing references) //IL_0eaf: Unknown result type (might be due to invalid IL or missing references) //IL_13b7: Unknown result type (might be due to invalid IL or missing references) //IL_13cc: Unknown result type (might be due to invalid IL or missing references) //IL_13dc: Unknown result type (might be due to invalid IL or missing references) //IL_13f1: Unknown result type (might be due to invalid IL or missing references) //IL_1401: Unknown result type (might be due to invalid IL or missing references) //IL_1094: Unknown result type (might be due to invalid IL or missing references) //IL_10b8: Unknown result type (might be due to invalid IL or missing references) //IL_10d3: Unknown result type (might be due to invalid IL or missing references) //IL_10ee: Unknown result type (might be due to invalid IL or missing references) //IL_1112: Unknown result type (might be due to invalid IL or missing references) //IL_0efe: Unknown result type (might be due to invalid IL or missing references) //IL_1441: Unknown result type (might be due to invalid IL or missing references) //IL_144c: Unknown result type (might be due to invalid IL or missing references) //IL_145c: Unknown result type (might be due to invalid IL or missing references) //IL_1477: Unknown result type (might be due to invalid IL or missing references) //IL_14b1: Unknown result type (might be due to invalid IL or missing references) //IL_14c1: Unknown result type (might be due to invalid IL or missing references) //IL_14cb: Unknown result type (might be due to invalid IL or missing references) //IL_170a: Unknown result type (might be due to invalid IL or missing references) //IL_171a: Unknown result type (might be due to invalid IL or missing references) //IL_14fb: Unknown result type (might be due to invalid IL or missing references) //IL_151b: Unknown result type (might be due to invalid IL or missing references) //IL_152b: Unknown result type (might be due to invalid IL or missing references) //IL_153b: Unknown result type (might be due to invalid IL or missing references) //IL_1550: Unknown result type (might be due to invalid IL or missing references) //IL_1560: Unknown result type (might be due to invalid IL or missing references) //IL_1b49: Unknown result type (might be due to invalid IL or missing references) //IL_1b4e: Unknown result type (might be due to invalid IL or missing references) //IL_1940: Unknown result type (might be due to invalid IL or missing references) //IL_1950: Unknown result type (might be due to invalid IL or missing references) //IL_1735: Unknown result type (might be due to invalid IL or missing references) //IL_1749: Unknown result type (might be due to invalid IL or missing references) //IL_15a4: Unknown result type (might be due to invalid IL or missing references) //IL_15c4: Unknown result type (might be due to invalid IL or missing references) //IL_15d4: Unknown result type (might be due to invalid IL or missing references) //IL_15e4: Unknown result type (might be due to invalid IL or missing references) //IL_1604: Unknown result type (might be due to invalid IL or missing references) //IL_117a: Unknown result type (might be due to invalid IL or missing references) //IL_118f: Unknown result type (might be due to invalid IL or missing references) //IL_119f: Unknown result type (might be due to invalid IL or missing references) //IL_199a: Unknown result type (might be due to invalid IL or missing references) //IL_19b5: Unknown result type (might be due to invalid IL or missing references) //IL_19e2: Unknown result type (might be due to invalid IL or missing references) //IL_19f2: Unknown result type (might be due to invalid IL or missing references) //IL_1a02: Unknown result type (might be due to invalid IL or missing references) //IL_17b0: Unknown result type (might be due to invalid IL or missing references) //IL_17d0: Unknown result type (might be due to invalid IL or missing references) //IL_17e0: Unknown result type (might be due to invalid IL or missing references) //IL_17e5: Unknown result type (might be due to invalid IL or missing references) //IL_17f9: Unknown result type (might be due to invalid IL or missing references) //IL_17fe: Unknown result type (might be due to invalid IL or missing references) //IL_1818: Unknown result type (might be due to invalid IL or missing references) //IL_181d: Unknown result type (might be due to invalid IL or missing references) //IL_1826: Unknown result type (might be due to invalid IL or missing references) //IL_1836: Unknown result type (might be due to invalid IL or missing references) //IL_1857: Unknown result type (might be due to invalid IL or missing references) //IL_1867: Unknown result type (might be due to invalid IL or missing references) //IL_186c: Unknown result type (might be due to invalid IL or missing references) //IL_1885: Unknown result type (might be due to invalid IL or missing references) //IL_1895: Unknown result type (might be due to invalid IL or missing references) //IL_176f: Unknown result type (might be due to invalid IL or missing references) //IL_11e3: Unknown result type (might be due to invalid IL or missing references) //IL_11f8: Unknown result type (might be due to invalid IL or missing references) //IL_11fd: Unknown result type (might be due to invalid IL or missing references) //IL_1a2a: Unknown result type (might be due to invalid IL or missing references) //IL_1a2f: Unknown result type (might be due to invalid IL or missing references) //IL_18de: Unknown result type (might be due to invalid IL or missing references) //IL_18ee: Unknown result type (might be due to invalid IL or missing references) //IL_18c4: Unknown result type (might be due to invalid IL or missing references) //IL_1656: Unknown result type (might be due to invalid IL or missing references) //IL_1666: Unknown result type (might be due to invalid IL or missing references) //IL_1676: Unknown result type (might be due to invalid IL or missing references) //IL_1696: Unknown result type (might be due to invalid IL or missing references) //IL_16ab: Unknown result type (might be due to invalid IL or missing references) //IL_16bb: Unknown result type (might be due to invalid IL or missing references) //IL_1a76: Unknown result type (might be due to invalid IL or missing references) //IL_1a8b: Unknown result type (might be due to invalid IL or missing references) //IL_1a98: Unknown result type (might be due to invalid IL or missing references) //IL_1a60: Unknown result type (might be due to invalid IL or missing references) //IL_191d: Unknown result type (might be due to invalid IL or missing references) //IL_126c: Unknown result type (might be due to invalid IL or missing references) //IL_127c: Unknown result type (might be due to invalid IL or missing references) //IL_1b97: Unknown result type (might be due to invalid IL or missing references) //IL_1b9d: Invalid comparison between Unknown and I4 //IL_1b12: Unknown result type (might be due to invalid IL or missing references) //IL_1b22: Unknown result type (might be due to invalid IL or missing references) //IL_1ac3: Unknown result type (might be due to invalid IL or missing references) //IL_1ad7: Unknown result type (might be due to invalid IL or missing references) if (isWeapon) { T203Mesh.SetActive(true); T203Prop.SetActive(false); LeftTitanHand.isbarehands = false; RightTitanHand.isbarehands = false; if (!isAuto && !isRightGrab) { handtargetR.transform.position = Vector3.SmoothDamp(handtargetR.transform.position, proptar.position, ref currentVelR, 0.25f); if (Vector3.Distance(handtargetR.transform.position, proptar.position) < 0.05f) { isWeapon = false; } } } if (!isWeapon) { isAmmoinHand = false; ammo.SetActive(false); LeftTitanHand.isbarehands = true; RightTitanHand.isbarehands = true; T203Mesh.SetActive(false); T203Prop.SetActive(true); T203Prop.transform.eulerAngles = ((Component)proptar).transform.eulerAngles; T203Prop.transform.position = proptar.position; } leftHand.transform.eulerAngles = handtargetL.transform.eulerAngles; rightHand.transform.eulerAngles = handtargetR.transform.eulerAngles; if (isAuto) { thiscol.enabled = true; CamHead.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } else if (!isAuto) { thiscol.enabled = false; } if (hatchGeo.transform.localEulerAngles.x > 85f) { screen.SetActive(true); } if (hatchGeo.transform.localEulerAngles.x <= 85f) { screen.SetActive(false); } crouch.transform.localEulerAngles = new Vector3(agentoffset, 0f, 0f); if (hatch) { hatchGeo.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if (!hatch) { hatchGeo.transform.localEulerAngles = new Vector3(90f, 0f, 0f); } if (!agent.isOnNavMesh) { } if (!iSpitAPilot && !iHaveAPilot && !iFindAPilot && !iEatAPilot && Vector3.Distance(((Component)GM.CurrentMovementManager).gameObject.transform.position, ((Component)this).transform.position) <= 10f && !GM.CurrentMovementManager.m_isGrounded) { iFindAPilot = true; isAuto = false; startwaiting = true; } if (!pilotInSeat) { enteraudio.SetActive(false); headGeo.transform.eulerAngles = Vector3.RotateTowards(headGeo.transform.eulerAngles, ((Component)GM.CurrentPlayerBody).transform.position, 5f, 5f); AxisLookAt(headGeo.transform, ((Component)GM.CurrentPlayerBody.Head).transform.position, Vector3.forward); ((Behaviour)hr).enabled = false; } if (pilotInSeat) { if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { CamHead.transform.eulerAngles = new Vector3(((Component)GM.CurrentPlayerBody.Head).gameObject.transform.eulerAngles.x, ((Component)GM.CurrentPlayerBody.Head).gameObject.transform.eulerAngles.y, 0f); } else { CamHead.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } iHaveAPilot = true; iFindAPilot = false; iEatAPilot = false; enteraudio.SetActive(true); ((Behaviour)hr).enabled = true; headGeo.transform.localEulerAngles = new Vector3(0f, 0f, 0f); pilotblasted = false; agentoffset = 0f; hatch = false; ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent(realSeatpos.transform); ((Component)GM.CurrentPlayerBody).gameObject.transform.position = realSeatpos.transform.position; ((Component)GM.CurrentPlayerBody).gameObject.transform.eulerAngles = realSeatpos.transform.eulerAngles; agent.SetDestination(followingtarget.transform.position); agent.angularSpeed = 0f; agent.stoppingDistance = 0f; if (((FVRInteractiveObject)grabL).IsHeld) { followingtarget.transform.localPosition = new Vector3(0.5f * ((FVRInteractiveObject)grabL).m_hand.Input.TouchpadAxes.x, 0f, 0.5f * ((FVRInteractiveObject)grabL).m_hand.Input.TouchpadAxes.y); } else if (!((FVRInteractiveObject)grabL).IsHeld) { followingtarget.transform.localPosition = new Vector3(0f, 0f, 0f); } if (((FVRInteractiveObject)grabR).IsHeld && (((FVRInteractiveObject)grabR).m_hand.Input.TouchpadAxes.x < -0.5f || ((FVRInteractiveObject)grabR).m_hand.Input.TouchpadAxes.x > 0.5f)) { ((Component)agent).gameObject.transform.localEulerAngles = new Vector3(0f, ((Component)agent).gameObject.transform.localEulerAngles.y + 5f * ((FVRInteractiveObject)grabR).m_hand.Input.TouchpadAxes.x, 0f); } } if ((Object)(object)GM.CurrentPlayerBody.Head != (Object)null && !iHaveAPilot && !iFindAPilot && (Object)(object)nearestAI == (Object)null) { agentoffset = 0f; agent.SetDestination(((Component)GM.CurrentPlayerBody.Head).transform.position); agent.angularSpeed = 200f; } if ((Object)(object)GM.CurrentPlayerBody.Head != (Object)null) { if (!iHaveAPilot && iFindAPilot && Vector3.Distance(((Component)this).gameObject.transform.position, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position) <= 7.5f) { agentoffset = 90f; handtargetL.transform.position = Vector3.SmoothDamp(handtargetL.transform.position, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position, ref currentVelL, 0.2f); if (Vector3.Distance(HL.transform.position, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position) <= 0.75f) { startwaiting = false; wait = 10f; hatch = true; ((Component)GM.CurrentPlayerBody).gameObject.transform.position = new Vector3(((Component)grabpilotpos).gameObject.transform.position.x, ((Component)grabpilotpos).gameObject.transform.position.y - 1f, ((Component)grabpilotpos).gameObject.transform.position.z); iEatAPilot = true; } } if (iEatAPilot) { iFindAPilot = false; handtargetL.transform.position = Vector3.SmoothDamp(handtargetL.transform.position, ((Component)seatpos).transform.position, ref currentVelL, 0.35f); ((Component)GM.CurrentPlayerBody).gameObject.transform.position = new Vector3(((Component)realgrabpilotpos).gameObject.transform.position.x, ((Component)realgrabpilotpos).gameObject.transform.position.y - 0.75f, ((Component)realgrabpilotpos).gameObject.transform.position.z); if (Vector3.Distance(handtargetL.transform.position, ((Component)seatpos).transform.position) < 0.15f) { pilotInSeat = true; } } } if (startwaiting) { if (wait >= 0f) { wait -= 1f * Time.deltaTime; } if (wait <= 0f || Vector3.Distance(((Component)this).gameObject.transform.position, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position) > 10f) { startwaiting = false; isAuto = true; agentoffset = 0f; hatch = false; pilotInSeat = false; iHaveAPilot = false; iFindAPilot = false; wait = 10f; } } if (!hatchtoggle.m_isLargeAperture && pilotInSeat) { iSpitAPilot = true; } if (iSpitAPilot) { if (!hatch) { hatch = true; } if (hatchGeo.transform.localEulerAngles.x < 20f) { pilotInSeat = false; iHaveAPilot = false; if (!pilotblasted) { ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null); GM.CurrentMovementManager.Blast(seatblast.transform.forward, 7.5f, true); ((Component)GM.CurrentPlayerBody).gameObject.transform.eulerAngles = new Vector3(0f, ((Component)GM.CurrentPlayerBody).gameObject.transform.eulerAngles.y, 0f); agent.stoppingDistance = 5f; pilotblasted = true; countdown = 2f; } } if (pilotblasted) { if (countdown >= 0f) { countdown -= 1f * Time.deltaTime; } if (countdown < 0f) { hatchtoggle.m_isLargeAperture = true; iSpitAPilot = false; hatch = false; isAuto = true; } } } if (isReloaded) { breachclose.SetActive(true); breachopen.SetActive(false); } if (!isReloaded) { breachclose.SetActive(false); breachopen.SetActive(true); } if (!isAuto && pilotInSeat) { if ((Object)(object)((FVRInteractiveObject)grabL).m_hand != (Object)null) { handLpilot.transform.position = ((Component)((FVRInteractiveObject)grabL).m_hand).gameObject.transform.position; handLpilot.transform.eulerAngles = ((Component)((FVRInteractiveObject)grabL).m_hand).gameObject.transform.eulerAngles; handtargetL.transform.localPosition = handLpilot.transform.localPosition; handtargetL.transform.localEulerAngles = handLpilot.transform.localEulerAngles; if (((FVRInteractiveObject)grabL).m_hand.Input.TriggerFloat > 0.5f) { isLeftGrab = true; } else if (((FVRInteractiveObject)grabL).m_hand.Input.TriggerFloat < 0.5f) { isLeftGrab = false; } } if ((Object)(object)((FVRInteractiveObject)grabR).m_hand != (Object)null) { handRpilot.transform.position = ((Component)((FVRInteractiveObject)grabR).m_hand).gameObject.transform.position; handRpilot.transform.eulerAngles = ((Component)((FVRInteractiveObject)grabR).m_hand).gameObject.transform.eulerAngles; handtargetR.transform.localPosition = handRpilot.transform.localPosition; handtargetR.transform.localEulerAngles = handRpilot.transform.localEulerAngles; if (((FVRInteractiveObject)grabR).m_hand.Input.TouchpadAxes.y > 0.5f) { trigger.transform.localEulerAngles = new Vector3(90f, 0f, 0f); } else if (((FVRInteractiveObject)grabR).m_hand.Input.TouchpadAxes.y <= 0.5f) { trigger.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if (((FVRInteractiveObject)grabR).m_hand.Input.TriggerFloat > 0.5f) { isRightGrab = true; } else if (((FVRInteractiveObject)grabR).m_hand.Input.TriggerFloat < 0.5f) { isRightGrab = false; } if (((FVRInteractiveObject)grabR).m_hand.Input.TouchpadAxes.y < -0.5f) { agentoffset = 90f; } else if (((FVRInteractiveObject)grabR).m_hand.Input.TouchpadAxes.y >= -0.5f) { agentoffset = 0f; } } if ((Object)(object)((FVRInteractiveObject)grabL).m_hand == (Object)null) { handLpilot.transform.localPosition = new Vector3(0f, 0f, 0f); handLpilot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); handtargetL.transform.position = idleL.position; handtargetL.transform.eulerAngles = idleL.eulerAngles; isLeftGrab = false; } if ((Object)(object)((FVRInteractiveObject)grabR).m_hand == (Object)null) { handRpilot.transform.localPosition = new Vector3(0f, 0f, 0f); handRpilot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); handtargetR.transform.position = idleR.position; handtargetR.transform.eulerAngles = idleR.eulerAngles; trigger.transform.localEulerAngles = new Vector3(0f, 0f, 0f); isRightGrab = false; agentoffset = 0f; } if (!isWeapon) { isAmmoinHand = false; } else if (isWeapon) { if (!isReloaded) { t203lid.transform.localEulerAngles = new Vector3(35f, 0f, 0f); if (Vector3.Distance(handtargetL.transform.position, ((Component)ammopouch).transform.position) < 0.5f) { isAmmoinHand = true; } } if (isReloaded) { t203lid.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if (trigger.transform.localEulerAngles.x > 45f) { derringer.FireBarrel(derringer.m_curBarrel); isReloaded = false; } } if (!isAmmoinHand) { ammo.SetActive(false); } if (isAmmoinHand) { ammo.SetActive(true); if (Vector3.Distance(ammo.transform.position, ((Component)reloadwell).transform.position) < 0.5f) { chamber.SetRound(projectile, false); isReloaded = true; isAmmoinHand = false; } } } } if (currentAI == null || (Object)(object)nearestAI == (Object)null || distanceNearest > 2500f) { if (isAuto) { agent.stoppingDistance = 5f; } mark.SetActive(false); mark.transform.localPosition = new Vector3(0f, 0f, 0f); lookAtObj.transform.localEulerAngles = new Vector3(0f, 0f, 0f); shieldrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if (!isAuto) { return; } agent.angularSpeed = 200f; if (!isWeapon) { handtargetR.transform.position = Vector3.SmoothDamp(handtargetR.transform.position, T203Prop.gameObject.transform.position, ref currentVelR, 0.25f); if (Vector3.Distance(handtargetR.transform.position, T203Prop.transform.position) < 0.05f) { isWeapon = true; } } if (isWeapon) { handtargetR.transform.position = Vector3.SmoothDamp(handtargetR.transform.position, AimingR.position, ref currentVelR, 0.5f); handtargetR.transform.eulerAngles = AimingR.eulerAngles; LimitView(-70f, 70f, -45f, 45f); aimR.transform.rotation = Quaternion.Lerp(aimR.transform.rotation, lookAtObj.transform.rotation, 1f); if (!isReloaded) { t203lid.transform.localEulerAngles = new Vector3(35f, 0f, 0f); handtargetL.transform.position = Vector3.SmoothDamp(handtargetL.transform.position, ((Component)ammopouch).transform.position, ref currentVelL, 0.5f); if (Vector3.Distance(handtargetL.transform.position, ((Component)ammopouch).transform.position) < 0.05f) { isAmmoinHand = true; } } if (isReloaded) { t203lid.transform.localEulerAngles = new Vector3(0f, 0f, 0f); handtargetL.transform.position = Vector3.SmoothDamp(handtargetL.transform.position, ((Component)foregrip).transform.position, ref currentVelL, 0.25f); handtargetL.transform.eulerAngles = ((Component)foregrip).transform.eulerAngles; } if (!isAmmoinHand) { ammo.SetActive(false); } if (isAmmoinHand) { ammo.SetActive(true); handtargetL.transform.position = Vector3.SmoothDamp(handtargetL.transform.position, ((Component)reloadwell).transform.position, ref currentVelL, 0.5f); handtargetL.transform.eulerAngles = ((Component)reloadwell).transform.eulerAngles; if (Vector3.Distance(ammo.transform.position, ((Component)reloadwell).transform.position) < 1.5f) { chamber.SetRound(projectile, false); isReloaded = true; isAmmoinHand = false; } } } if ((Object)(object)nearestAI != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)nearestAI).transform.position) <= 6f) { if (Vector3.Distance(((Component)this).transform.position, ((Component)GM.CurrentPlayerBody.Head).transform.position) < 10f) { agent.SetDestination(((Component)nearestAI).transform.position); } agent.stoppingDistance = 2f; agentoffset = 75f; lookAtObj.transform.localEulerAngles = new Vector3(0f, 0f, 0f); handtargetL.transform.position = Vector3.SmoothDamp(handtargetL.transform.position, new Vector3(((Component)nearestAI).transform.position.x, ((Component)nearestAI).transform.position.y + 0.1f, ((Component)nearestAI).transform.position.z), ref currentVelL, 0.5f); AxisLookAtAll(handtargetL.transform, ((Component)nearestAI).transform.position, -handtargetL.transform.right); if (Vector3.Distance(((Component)GM.CurrentPlayerBody.Head).transform.position, handtargetL.transform.position) > 6f) { shieldrot.transform.localEulerAngles = new Vector3(90f, 0f, 0f); } if (Vector3.Distance(((Component)GM.CurrentPlayerBody.Head).transform.position, handtargetL.transform.position) < 6f) { shieldrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } if ((Object)(object)nearestAI != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)nearestAI).transform.position) > 6f) { agentoffset = 0f; agent.stoppingDistance = 5f; shieldrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); agent.SetDestination(((Component)nearestAI).transform.position); mark.SetActive(true); mark.transform.position = Vector3.SmoothDamp(mark.transform.position, ((Component)nearestAI).transform.position, ref velocity, 0.1f); if (isReloaded) { AxisLookAt(lookAtObj.transform, nearestAI.position, Vector3.forward); } if (!isReloaded) { lookAtObj.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } RaycastHit val = default(RaycastHit); if (Physics.SphereCast(((Component)muzzle).transform.position, 1f, ((Component)muzzle).transform.forward, ref val, 500f, LayerMask.op_Implicit(lm)) && isReloaded && Vector3.Distance(((Component)nearestAI).transform.position, ((Component)GM.CurrentPlayerBody.Head).transform.position) > 5f) { derringer.FireBarrel(derringer.m_curBarrel); isReloaded = false; } distanceNearest = Vector3.Distance(player.position, ((Component)nearestAI).transform.position); } AxisLookAt(mark.transform, lookAtObj.transform.position, Vector3.forward); if (currentAI == null) { return; } for (int i = 0; i < currentAI.Count; i++) { if ((Object)(object)currentAI[i] == (Object)null || (int)currentAI[i].S.BodyState == 3) { currentAI.Remove(currentAI[i]); } } nearestAI = GetNearestGameObject(player, currentAI); } private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f); } private void AxisLookAtAll(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; } public Transform GetNearestGameObject(Transform player, List objects) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) Transform val = null; if (objects == null || (Object)(object)val == (Object)null) { } if (objects.Count > 0 && (Object)(object)objects[0] != (Object)null) { val = ((Component)objects[0]).transform; float num = Vector3.Distance(player.position, ((Component)objects[0]).transform.position); for (int i = 1; i < objects.Count; i++) { float num2 = Vector3.Distance(player.position, ((Component)objects[i]).transform.position); if (num > num2) { num = num2; val = ((Component)objects[i]).transform; } } } return val; } private void OnTriggerEnter(Collider other) { if (((Object)((Component)other).gameObject).name == "Sosig_Torso") { currentAI.Add(((Component)other).gameObject.GetComponent()); } } public void LimitView(float minViewX, float MaxViewX, float minViewY, float MaxViewY) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Clamp(aimR.transform.rotation.x, minViewX, MaxViewX); float num2 = Mathf.Clamp(aimR.transform.rotation.y, minViewY, MaxViewY); Quaternion rotation = default(Quaternion); ((Quaternion)(ref rotation))..ctor(num, num2, 0f, aimR.transform.rotation.w); aimR.transform.rotation = rotation; } } public class Blink : MonoBehaviour { public SkinnedMeshRenderer skin; private float blendOne = 0f; private float blendSpeed = 100f; private bool blinked; private float nextTime; private float rate = 5f; private void Start() { ((MonoBehaviour)this).InvokeRepeating("blinkeyes25", 5.02f, 5f); ((MonoBehaviour)this).InvokeRepeating("blinkeyes50", 5.04f, 5f); ((MonoBehaviour)this).InvokeRepeating("blinkeyes75", 5.06f, 5f); ((MonoBehaviour)this).InvokeRepeating("blinkeyes100", 5.08f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes0", 5.1f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes25", 5.12f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes50", 5.14f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes75", 5.16f, 5f); } public void blinkeyes25() { skin.SetBlendShapeWeight(0, 25f); } public void blinkeyes50() { skin.SetBlendShapeWeight(0, 50f); } public void blinkeyes75() { skin.SetBlendShapeWeight(0, 75f); } public void blinkeyes100() { skin.SetBlendShapeWeight(0, 100f); } public void openeyes0() { skin.SetBlendShapeWeight(0, 75f); } public void openeyes25() { skin.SetBlendShapeWeight(0, 50f); } public void openeyes50() { skin.SetBlendShapeWeight(0, 25f); } public void openeyes75() { skin.SetBlendShapeWeight(0, 0f); } private void Update() { } } public class BlinkCustom : MonoBehaviour { public SkinnedMeshRenderer skin; public int num; private float blendOne = 0f; private float blendSpeed = 100f; private bool blinked; private float nextTime; private float rate = 5f; private void Start() { ((MonoBehaviour)this).InvokeRepeating("blinkeyes25", 5.02f, 5f); ((MonoBehaviour)this).InvokeRepeating("blinkeyes50", 5.04f, 5f); ((MonoBehaviour)this).InvokeRepeating("blinkeyes75", 5.06f, 5f); ((MonoBehaviour)this).InvokeRepeating("blinkeyes100", 5.08f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes0", 5.1f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes25", 5.12f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes50", 5.14f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes75", 5.16f, 5f); } public void blinkeyes25() { skin.SetBlendShapeWeight(num, 25f); } public void blinkeyes50() { skin.SetBlendShapeWeight(num, 50f); } public void blinkeyes75() { skin.SetBlendShapeWeight(num, 75f); } public void blinkeyes100() { skin.SetBlendShapeWeight(num, 100f); } public void openeyes0() { skin.SetBlendShapeWeight(num, 75f); } public void openeyes25() { skin.SetBlendShapeWeight(num, 50f); } public void openeyes50() { skin.SetBlendShapeWeight(num, 25f); } public void openeyes75() { skin.SetBlendShapeWeight(num, 0f); } private void Update() { } } public class DeathCamera : MonoBehaviour { public bool spawned = true; public bool isdead = true; public GameObject cam; public GameObject cam2; public GameObject camholderpos; public GameObject camholderrot; private void Start() { cam.SetActive(false); spawned = true; } private void Update() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (isdead) { cam.SetActive(true); ((Component)GM.CurrentMovementManager).transform.position = cam2.transform.position; ((Component)GM.CurrentMovementManager).transform.eulerAngles = cam2.transform.eulerAngles; camholderpos.transform.localPosition = -((Component)GM.CurrentPlayerBody.Head).gameObject.transform.localPosition; spawned = false; } if (!isdead) { cam.SetActive(false); if (!spawned) { ((Component)GM.CurrentMovementManager).transform.position = GM.CurrentSceneSettings.DeathResetPoint.position; spawned = true; } ((Component)GM.CurrentMovementManager).transform.eulerAngles = new Vector3(0f, ((Component)GM.CurrentMovementManager).transform.eulerAngles.y, 0f); } } private void OnDestroy() { cam.SetActive(false); } } public class DeleteOnRot : MonoBehaviour { public GameObject rot; public AR15HandleFlipperSounds deleteobj; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (rot.transform.localEulerAngles.x > 45f) { if ((Object)(object)((FVRInteractiveObject)deleteobj).m_hand != (Object)null) { ((FVRInteractiveObject)deleteobj).EndInteraction(((FVRInteractiveObject)deleteobj).m_hand); ((FVRInteractiveObject)deleteobj).m_hand.ForceSetInteractable((FVRInteractiveObject)null); } Object.Destroy((Object)(object)((Component)deleteobj).gameObject); } } } public class DisConGeo : MonoBehaviour { public bool disabled = false; public GameObject switchtrig; private void Start() { } private void FixedUpdate() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)GM.CurrentMovementManager != (Object)null)) { return; } if (switchtrig.transform.localEulerAngles.x < 45f) { GM.CurrentMovementManager.Hands[0].Display_Controller.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_InteractionSphere.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_InteractionSphere_Palm.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_InteractionSphere.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_InteractionSphere_Palm.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_Cosmos.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_HPR2.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_Index.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_Quest2.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_Quest3.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_RiftS.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_Touch.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_Vive.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_WMR.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Cosmos.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_HPR2.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Index.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Quest2.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Quest3.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_RiftS.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Touch.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Vive.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_WMR.SetActive(false); if (!disabled) { GM.CurrentMovementManager.Hands[0].Collider_Fingers.radius = GM.CurrentMovementManager.Hands[0].Collider_Fingers.radius * 2f; GM.CurrentMovementManager.Hands[0].Collider_Palm.radius = GM.CurrentMovementManager.Hands[0].Collider_Palm.radius * 2f; GM.CurrentMovementManager.Hands[1].Collider_Fingers.radius = GM.CurrentMovementManager.Hands[1].Collider_Fingers.radius * 2f; GM.CurrentMovementManager.Hands[1].Collider_Palm.radius = GM.CurrentMovementManager.Hands[1].Collider_Palm.radius * 2f; disabled = true; } } else if (switchtrig.transform.localEulerAngles.x > 45f) { if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null) { GM.CurrentMovementManager.Hands[0].Display_Controller.SetActive(true); GM.CurrentMovementManager.Hands[0].Display_InteractionSphere.SetActive(true); GM.CurrentMovementManager.Hands[0].Display_InteractionSphere_Palm.SetActive(true); } else if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable != (Object)null) { GM.CurrentMovementManager.Hands[0].Display_Controller.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_InteractionSphere.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_InteractionSphere_Palm.SetActive(false); } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null) { GM.CurrentMovementManager.Hands[1].Display_Controller.SetActive(true); GM.CurrentMovementManager.Hands[1].Display_InteractionSphere.SetActive(true); GM.CurrentMovementManager.Hands[1].Display_InteractionSphere_Palm.SetActive(true); } else if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable != (Object)null) { GM.CurrentMovementManager.Hands[1].Display_Controller.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_InteractionSphere.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_InteractionSphere_Palm.SetActive(false); } GM.CurrentMovementManager.Hands[0].Display_Controller_Cosmos.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_HPR2.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_Index.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_Quest2.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_Quest3.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_RiftS.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_Touch.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_Vive.SetActive(false); GM.CurrentMovementManager.Hands[0].Display_Controller_WMR.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Cosmos.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_HPR2.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Index.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Quest2.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Quest3.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_RiftS.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Touch.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_Vive.SetActive(false); GM.CurrentMovementManager.Hands[1].Display_Controller_WMR.SetActive(false); if (disabled) { GM.CurrentMovementManager.Hands[0].Collider_Fingers.radius = GM.CurrentMovementManager.Hands[0].Collider_Fingers.radius * 0.5f; GM.CurrentMovementManager.Hands[0].Collider_Palm.radius = GM.CurrentMovementManager.Hands[0].Collider_Palm.radius * 0.5f; GM.CurrentMovementManager.Hands[1].Collider_Fingers.radius = GM.CurrentMovementManager.Hands[1].Collider_Fingers.radius * 0.5f; GM.CurrentMovementManager.Hands[1].Collider_Palm.radius = GM.CurrentMovementManager.Hands[1].Collider_Palm.radius * 0.5f; disabled = false; } } } private void OnDestroy() { if ((Object)(object)GM.CurrentMovementManager != (Object)null) { GM.CurrentMovementManager.Hands[0].Display_Controller.SetActive(true); GM.CurrentMovementManager.Hands[0].Display_InteractionSphere.SetActive(true); GM.CurrentMovementManager.Hands[0].Display_InteractionSphere_Palm.SetActive(true); GM.CurrentMovementManager.Hands[1].Display_Controller.SetActive(true); GM.CurrentMovementManager.Hands[1].Display_InteractionSphere.SetActive(true); GM.CurrentMovementManager.Hands[1].Display_InteractionSphere_Palm.SetActive(true); } if (disabled) { GM.CurrentMovementManager.Hands[0].Collider_Fingers.radius = GM.CurrentMovementManager.Hands[0].Collider_Fingers.radius * 0.5f; GM.CurrentMovementManager.Hands[0].Collider_Palm.radius = GM.CurrentMovementManager.Hands[0].Collider_Palm.radius * 0.5f; GM.CurrentMovementManager.Hands[1].Collider_Fingers.radius = GM.CurrentMovementManager.Hands[1].Collider_Fingers.radius * 0.5f; GM.CurrentMovementManager.Hands[1].Collider_Palm.radius = GM.CurrentMovementManager.Hands[1].Collider_Palm.radius * 0.5f; disabled = false; } } } } namespace DestinyScript1 { public class FBTMP : MonoBehaviour { public PlayerBody _h3mpbody; public FVRObject FVRHIP; public FVRObject FVRKNEEL; public FVRObject FVRKNEER; public FVRObject FVRTOEL; public FVRObject FVRTOER; public GameObject HIP; public GameObject KNEEL; public GameObject KNEER; public GameObject TOEL; public GameObject TOER; public GameObject HIPTar; public GameObject KNEELTar; public GameObject KNEERTar; public GameObject TOELTar; public GameObject TOERTar; [NonSerialized] public GameObject HIPOBJ; [NonSerialized] public GameObject KNEELOBJ; [NonSerialized] public GameObject KNEEROBJ; [NonSerialized] public GameObject TOELOBJ; [NonSerialized] public GameObject TOEROBJ; public bool track = false; public void Start() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) HIPOBJ = Object.Instantiate(((AnvilAsset)FVRHIP).GetGameObject(), HIP.transform.position, HIP.transform.rotation); KNEELOBJ = Object.Instantiate(((AnvilAsset)FVRKNEEL).GetGameObject(), KNEEL.transform.position, KNEEL.transform.rotation); KNEEROBJ = Object.Instantiate(((AnvilAsset)FVRKNEER).GetGameObject(), KNEER.transform.position, KNEER.transform.rotation); TOELOBJ = Object.Instantiate(((AnvilAsset)FVRTOEL).GetGameObject(), TOEL.transform.position, TOEL.transform.rotation); TOEROBJ = Object.Instantiate(((AnvilAsset)FVRTOER).GetGameObject(), TOER.transform.position, TOER.transform.rotation); if ((Object)(object)Mod.managerObject == (Object)null) { track = true; return; } if ((Object)(object)GameManager.currentPlayerBody == (Object)(object)_h3mpbody) { track = true; return; } ((Behaviour)this).enabled = false; track = false; } private void Update() { //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) if (track) { HIPOBJ.transform.position = HIP.transform.position; HIPOBJ.transform.eulerAngles = HIP.transform.eulerAngles; KNEELOBJ.transform.position = KNEEL.transform.position; KNEELOBJ.transform.eulerAngles = KNEEL.transform.eulerAngles; KNEEROBJ.transform.position = KNEER.transform.position; KNEEROBJ.transform.eulerAngles = KNEER.transform.eulerAngles; TOELOBJ.transform.position = TOEL.transform.position; TOELOBJ.transform.eulerAngles = TOEL.transform.eulerAngles; TOEROBJ.transform.position = TOER.transform.position; TOEROBJ.transform.eulerAngles = TOER.transform.eulerAngles; } HIPTar.transform.position = HIPOBJ.transform.position; HIPTar.transform.eulerAngles = HIPOBJ.transform.eulerAngles; KNEELTar.transform.position = KNEELOBJ.transform.position; KNEELTar.transform.eulerAngles = KNEELOBJ.transform.eulerAngles; KNEERTar.transform.position = KNEEROBJ.transform.position; KNEERTar.transform.eulerAngles = KNEEROBJ.transform.eulerAngles; TOELTar.transform.position = TOELOBJ.transform.position; TOELTar.transform.eulerAngles = TOELOBJ.transform.eulerAngles; TOERTar.transform.position = TOEROBJ.transform.position; TOERTar.transform.eulerAngles = TOEROBJ.transform.eulerAngles; } } } namespace JerryFBT2 { [BepInPlugin("JerryFBT2", "FBT2", "1.0.0")] [BepInProcess("h3vr.exe")] public class FBTPlugin : BaseUnityPlugin { public static ConfigEntry HIP5tk; public static ConfigEntry FootLeft5tk; public static ConfigEntry FootRight5tk; public static ConfigEntry KneeLeft5tk; public static ConfigEntry KneeRight5tk; public static ConfigEntry HIP3tk; public static ConfigEntry FootLeft3tk; public static ConfigEntry FootRight3tk; private void SetConfig() { HIP3tk = ((BaseUnityPlugin)this).Config.Bind("HIP", "HIP Tracker for 3tracker model", 1, "From -1 to 15 (requires restart.)"); FootLeft3tk = ((BaseUnityPlugin)this).Config.Bind("FootLeft", "FootLeft Tracker for 3tracker model", 8, "From -1 to 15 (requires restart.)"); FootRight3tk = ((BaseUnityPlugin)this).Config.Bind("FootRight", "FootRight Tracker for 3tracker model", 10, "From -1 to 15 (requires restart.)"); HIP5tk = ((BaseUnityPlugin)this).Config.Bind("HIP", "HIP Tracker for 5tracker model", 1, "From -1 to 15 (requires restart.)"); FootLeft5tk = ((BaseUnityPlugin)this).Config.Bind("FootLeft", "FootLeft Tracker for 5tracker model", 8, "From -1 to 15 (requires restart.)"); FootRight5tk = ((BaseUnityPlugin)this).Config.Bind("FootRight", "FootRight Tracker for 5tracker model", 10, "From -1 to 15 (requires restart.)"); KneeLeft5tk = ((BaseUnityPlugin)this).Config.Bind("KneeLeft", "KneeLeft Tracker for 5tracker model", 7, "From -1 to 15 (requires restart.)"); KneeRight5tk = ((BaseUnityPlugin)this).Config.Bind("KneeRight", "KneeRight Tracker for 5tracker model", 9, "From -1 to 15 (requires restart.)"); } public void FixedUpdate() { SetConfig(); } } } namespace JerryComponent { public class FBTReader : MonoBehaviour { public SteamVR_TrackedObject HIP; public SteamVR_TrackedObject FOOTLEFT; public SteamVR_TrackedObject FOOTRIGHT; public bool is3TK = false; public SteamVR_TrackedObject KNEELEFT; public SteamVR_TrackedObject KNEERIGHT; private void Start() { if (is3TK) { HIP.SetDeviceIndex(FBTPlugin.HIP3tk.Value); FOOTLEFT.SetDeviceIndex(FBTPlugin.FootLeft3tk.Value); FOOTRIGHT.SetDeviceIndex(FBTPlugin.FootRight3tk.Value); KNEELEFT.SetDeviceIndex(-1); KNEERIGHT.SetDeviceIndex(-1); } else if (!is3TK) { HIP.SetDeviceIndex(FBTPlugin.HIP5tk.Value); FOOTLEFT.SetDeviceIndex(FBTPlugin.FootLeft5tk.Value); FOOTRIGHT.SetDeviceIndex(FBTPlugin.FootRight5tk.Value); KNEELEFT.SetDeviceIndex(FBTPlugin.KneeLeft5tk.Value); KNEERIGHT.SetDeviceIndex(FBTPlugin.KneeRight5tk.Value); } } } public class FBTScript : MonoBehaviour { public GameObject Main; public GameObject GO1; public GameObject GO2; public GameObject GO3; public GameObject GO4; public GameObject GO5; public GameObject GO6; public GameObject GO7; public GameObject GO8; public GameObject GO9; public GameObject GO10; public GameObject Root; public GameObject headref; private void Start() { GO1.transform.SetParent((Transform)null); GO2.transform.SetParent((Transform)null); GO3.transform.SetParent((Transform)null); GO4.transform.SetParent((Transform)null); GO5.transform.SetParent((Transform)null); GO6.transform.SetParent((Transform)null); GO7.transform.SetParent((Transform)null); GO8.transform.SetParent((Transform)null); GO9.transform.SetParent((Transform)null); GO10.transform.SetParent((Transform)null); Root.transform.SetParent((Transform)null); headref.transform.SetParent((Transform)null); } private void Update() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) headref.transform.position = GO1.transform.position; headref.transform.eulerAngles = GO1.transform.eulerAngles; if ((Object)(object)GO1 == (Object)null || (Object)(object)GO2 == (Object)null || (Object)(object)GO3 == (Object)null || (Object)(object)GO4 == (Object)null || (Object)(object)GO5 == (Object)null || (Object)(object)GO6 == (Object)null || (Object)(object)GO7 == (Object)null || (Object)(object)GO8 == (Object)null || (Object)(object)GO9 == (Object)null || (Object)(object)GO10 == (Object)null || (Object)(object)Root == (Object)null || (Object)(object)headref == (Object)null) { Object.Destroy((Object)(object)Main); } } private void OnDestroy() { Object.Destroy((Object)(object)GO1); Object.Destroy((Object)(object)GO2); Object.Destroy((Object)(object)GO3); Object.Destroy((Object)(object)GO4); Object.Destroy((Object)(object)GO5); Object.Destroy((Object)(object)GO6); Object.Destroy((Object)(object)GO7); Object.Destroy((Object)(object)GO8); Object.Destroy((Object)(object)GO9); Object.Destroy((Object)(object)GO10); Object.Destroy((Object)(object)Root); Object.Destroy((Object)(object)headref); } } } namespace JerryLegsIK { public class FOOTIK : MonoBehaviour { private Animator _animator; public LayerMask _layerMask; private Ray _ray; public Vector3 footOffset; [Range(0f, 1f)] public float rightFootPosWeight = 1f; [Range(0f, 1f)] public float rightFootRotWeight = 1f; [Range(0f, 1f)] public float leftFootPosWeight = 1f; [Range(0f, 1f)] public float leftFootRotWeight = 1f; public bool isOnGround; private void Start() { _animator = ((Component)this).GetComponent(); } private void OnAnimatorIK(int layerIndex) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) Vector3 iKPosition = _animator.GetIKPosition((AvatarIKGoal)1); RaycastHit val = default(RaycastHit); if (Physics.Raycast(iKPosition + Vector3.up, Vector3.down, ref val, 1.2f, LayerMask.op_Implicit(_layerMask))) { _animator.SetIKPositionWeight((AvatarIKGoal)1, rightFootPosWeight); _animator.SetIKPosition((AvatarIKGoal)1, ((RaycastHit)(ref val)).point + footOffset); Quaternion val2 = Quaternion.LookRotation(Vector3.ProjectOnPlane(((Component)this).transform.forward, ((RaycastHit)(ref val)).normal), ((RaycastHit)(ref val)).normal); _animator.SetIKRotationWeight((AvatarIKGoal)1, rightFootRotWeight); _animator.SetIKRotation((AvatarIKGoal)1, val2); isOnGround = true; } else { _animator.SetIKPositionWeight((AvatarIKGoal)1, 0f); isOnGround = false; } Vector3 iKPosition2 = _animator.GetIKPosition((AvatarIKGoal)0); if (Physics.Raycast(iKPosition2 + Vector3.up, Vector3.down, ref val, 1.2f, LayerMask.op_Implicit(_layerMask))) { _animator.SetIKPositionWeight((AvatarIKGoal)0, leftFootPosWeight); _animator.SetIKPosition((AvatarIKGoal)0, ((RaycastHit)(ref val)).point + footOffset); Quaternion val3 = Quaternion.LookRotation(Vector3.ProjectOnPlane(((Component)this).transform.forward, ((RaycastHit)(ref val)).normal), ((RaycastHit)(ref val)).normal); _animator.SetIKRotationWeight((AvatarIKGoal)0, leftFootPosWeight); _animator.SetIKRotation((AvatarIKGoal)0, val3); } else { _animator.SetIKPositionWeight((AvatarIKGoal)0, 0f); } } } } namespace JerryComponent { public class FacialExpressionCustom : MonoBehaviour { public SkinnedMeshRenderer skin; public GameObject fecube; public int num; private float blendOne = 0f; private float blendSpeed = 100f; private bool blinked; private float nextTime; private float rate = 5f; private void Start() { ((MonoBehaviour)this).InvokeRepeating("blinkeyes25", 5.02f, 5f); ((MonoBehaviour)this).InvokeRepeating("blinkeyes50", 5.04f, 5f); ((MonoBehaviour)this).InvokeRepeating("blinkeyes75", 5.06f, 5f); ((MonoBehaviour)this).InvokeRepeating("blinkeyes100", 5.08f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes0", 5.1f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes25", 5.12f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes50", 5.14f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeyes75", 5.16f, 5f); } public void blinkeyes25() { skin.SetBlendShapeWeight(num, 25f); } public void blinkeyes50() { skin.SetBlendShapeWeight(num, 50f); } public void blinkeyes75() { skin.SetBlendShapeWeight(num, 75f); } public void blinkeyes100() { skin.SetBlendShapeWeight(num, 100f); } public void openeyes0() { skin.SetBlendShapeWeight(num, 75f); } public void openeyes25() { skin.SetBlendShapeWeight(num, 50f); } public void openeyes50() { skin.SetBlendShapeWeight(num, 25f); } public void openeyes75() { skin.SetBlendShapeWeight(num, 0f); } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_0663: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_075e: Unknown result type (might be due to invalid IL or missing references) //IL_0763: Unknown result type (might be due to invalid IL or missing references) //IL_0703: Unknown result type (might be due to invalid IL or missing references) //IL_0708: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_0781: Unknown result type (might be due to invalid IL or missing references) //IL_0786: Unknown result type (might be due to invalid IL or missing references) //IL_085a: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Unknown result type (might be due to invalid IL or missing references) //IL_07ff: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Unknown result type (might be due to invalid IL or missing references) //IL_08d8: Unknown result type (might be due to invalid IL or missing references) //IL_08dd: Unknown result type (might be due to invalid IL or missing references) //IL_087d: Unknown result type (might be due to invalid IL or missing references) //IL_0882: Unknown result type (might be due to invalid IL or missing references) //IL_0956: Unknown result type (might be due to invalid IL or missing references) //IL_095b: Unknown result type (might be due to invalid IL or missing references) //IL_08fb: Unknown result type (might be due to invalid IL or missing references) //IL_0900: Unknown result type (might be due to invalid IL or missing references) //IL_09d4: Unknown result type (might be due to invalid IL or missing references) //IL_09d9: Unknown result type (might be due to invalid IL or missing references) //IL_0979: Unknown result type (might be due to invalid IL or missing references) //IL_097e: Unknown result type (might be due to invalid IL or missing references) //IL_0a52: Unknown result type (might be due to invalid IL or missing references) //IL_0a57: Unknown result type (might be due to invalid IL or missing references) //IL_09f7: Unknown result type (might be due to invalid IL or missing references) //IL_09fc: Unknown result type (might be due to invalid IL or missing references) //IL_0ad0: Unknown result type (might be due to invalid IL or missing references) //IL_0ad5: Unknown result type (might be due to invalid IL or missing references) //IL_0a75: Unknown result type (might be due to invalid IL or missing references) //IL_0a7a: Unknown result type (might be due to invalid IL or missing references) //IL_0b4e: Unknown result type (might be due to invalid IL or missing references) //IL_0b53: Unknown result type (might be due to invalid IL or missing references) //IL_0af3: Unknown result type (might be due to invalid IL or missing references) //IL_0af8: Unknown result type (might be due to invalid IL or missing references) //IL_0bcc: Unknown result type (might be due to invalid IL or missing references) //IL_0bd1: Unknown result type (might be due to invalid IL or missing references) //IL_0b71: Unknown result type (might be due to invalid IL or missing references) //IL_0b76: Unknown result type (might be due to invalid IL or missing references) //IL_0c4a: Unknown result type (might be due to invalid IL or missing references) //IL_0c4f: Unknown result type (might be due to invalid IL or missing references) //IL_0bef: Unknown result type (might be due to invalid IL or missing references) //IL_0bf4: Unknown result type (might be due to invalid IL or missing references) //IL_0cc8: Unknown result type (might be due to invalid IL or missing references) //IL_0ccd: Unknown result type (might be due to invalid IL or missing references) //IL_0c6d: Unknown result type (might be due to invalid IL or missing references) //IL_0c72: Unknown result type (might be due to invalid IL or missing references) //IL_0d46: Unknown result type (might be due to invalid IL or missing references) //IL_0d4b: Unknown result type (might be due to invalid IL or missing references) //IL_0ceb: Unknown result type (might be due to invalid IL or missing references) //IL_0cf0: Unknown result type (might be due to invalid IL or missing references) //IL_0dc4: Unknown result type (might be due to invalid IL or missing references) //IL_0dc9: Unknown result type (might be due to invalid IL or missing references) //IL_0d69: Unknown result type (might be due to invalid IL or missing references) //IL_0d6e: Unknown result type (might be due to invalid IL or missing references) //IL_0de7: Unknown result type (might be due to invalid IL or missing references) //IL_0dec: Unknown result type (might be due to invalid IL or missing references) if (fecube.transform.localEulerAngles.x < 0.5f) { skin.SetBlendShapeWeight(0, 0f); skin.SetBlendShapeWeight(1, 0f); skin.SetBlendShapeWeight(2, 0f); skin.SetBlendShapeWeight(3, 0f); skin.SetBlendShapeWeight(4, 0f); skin.SetBlendShapeWeight(5, 0f); skin.SetBlendShapeWeight(6, 0f); skin.SetBlendShapeWeight(7, 0f); skin.SetBlendShapeWeight(8, 0f); skin.SetBlendShapeWeight(9, 0f); skin.SetBlendShapeWeight(10, 0f); skin.SetBlendShapeWeight(11, 0f); skin.SetBlendShapeWeight(12, 0f); skin.SetBlendShapeWeight(13, 0f); skin.SetBlendShapeWeight(14, 0f); skin.SetBlendShapeWeight(15, 0f); skin.SetBlendShapeWeight(16, 0f); skin.SetBlendShapeWeight(17, 0f); skin.SetBlendShapeWeight(18, 0f); skin.SetBlendShapeWeight(19, 0f); skin.SetBlendShapeWeight(20, 0f); skin.SetBlendShapeWeight(21, 0f); skin.SetBlendShapeWeight(22, 0f); skin.SetBlendShapeWeight(23, 0f); skin.SetBlendShapeWeight(24, 0f); } if (fecube.transform.localEulerAngles.x > 0.5f) { skin.SetBlendShapeWeight(num, 0f); if (fecube.transform.localEulerAngles.x > 0.5f && fecube.transform.localEulerAngles.x < 1.5f) { skin.SetBlendShapeWeight(0, 100f); skin.SetBlendShapeWeight(1, 0f); } if (fecube.transform.localEulerAngles.x > 1.5f && fecube.transform.localEulerAngles.x < 2.5f) { skin.SetBlendShapeWeight(0, 0f); skin.SetBlendShapeWeight(1, 100f); skin.SetBlendShapeWeight(2, 0f); } if (fecube.transform.localEulerAngles.x > 2.5f && fecube.transform.localEulerAngles.x < 3.5f) { skin.SetBlendShapeWeight(1, 0f); skin.SetBlendShapeWeight(2, 100f); skin.SetBlendShapeWeight(3, 0f); } if (fecube.transform.localEulerAngles.x > 3.5f && fecube.transform.localEulerAngles.x < 4.5f) { skin.SetBlendShapeWeight(2, 0f); skin.SetBlendShapeWeight(3, 100f); skin.SetBlendShapeWeight(4, 0f); } if (fecube.transform.localEulerAngles.x > 4.5f && fecube.transform.localEulerAngles.x < 5.5f) { skin.SetBlendShapeWeight(3, 0f); skin.SetBlendShapeWeight(4, 100f); skin.SetBlendShapeWeight(5, 0f); } if (fecube.transform.localEulerAngles.x > 5.5f && fecube.transform.localEulerAngles.x < 6.5f) { skin.SetBlendShapeWeight(4, 0f); skin.SetBlendShapeWeight(5, 100f); skin.SetBlendShapeWeight(6, 0f); } if (fecube.transform.localEulerAngles.x > 6.5f && fecube.transform.localEulerAngles.x < 7.5f) { skin.SetBlendShapeWeight(5, 0f); skin.SetBlendShapeWeight(6, 100f); skin.SetBlendShapeWeight(7, 0f); } if (fecube.transform.localEulerAngles.x > 7.5f && fecube.transform.localEulerAngles.x < 8.5f) { skin.SetBlendShapeWeight(6, 0f); skin.SetBlendShapeWeight(7, 100f); skin.SetBlendShapeWeight(8, 0f); } if (fecube.transform.localEulerAngles.x > 8.5f && fecube.transform.localEulerAngles.x < 9.5f) { skin.SetBlendShapeWeight(7, 0f); skin.SetBlendShapeWeight(8, 100f); skin.SetBlendShapeWeight(9, 0f); } if (fecube.transform.localEulerAngles.x > 9.5f && fecube.transform.localEulerAngles.x < 10.5f) { skin.SetBlendShapeWeight(8, 0f); skin.SetBlendShapeWeight(9, 100f); skin.SetBlendShapeWeight(10, 0f); } if (fecube.transform.localEulerAngles.x > 10.5f && fecube.transform.localEulerAngles.x < 11.5f) { skin.SetBlendShapeWeight(9, 0f); skin.SetBlendShapeWeight(10, 100f); skin.SetBlendShapeWeight(11, 0f); } if (fecube.transform.localEulerAngles.x > 11.5f && fecube.transform.localEulerAngles.x < 12.5f) { skin.SetBlendShapeWeight(10, 0f); skin.SetBlendShapeWeight(11, 100f); skin.SetBlendShapeWeight(12, 0f); } if (fecube.transform.localEulerAngles.x > 12.5f && fecube.transform.localEulerAngles.x < 13.5f) { skin.SetBlendShapeWeight(11, 0f); skin.SetBlendShapeWeight(12, 100f); skin.SetBlendShapeWeight(13, 0f); } if (fecube.transform.localEulerAngles.x > 13.5f && fecube.transform.localEulerAngles.x < 14.5f) { skin.SetBlendShapeWeight(12, 0f); skin.SetBlendShapeWeight(13, 100f); skin.SetBlendShapeWeight(14, 0f); } if (fecube.transform.localEulerAngles.x > 14.5f && fecube.transform.localEulerAngles.x < 15.5f) { skin.SetBlendShapeWeight(13, 0f); skin.SetBlendShapeWeight(14, 100f); skin.SetBlendShapeWeight(15, 0f); } if (fecube.transform.localEulerAngles.x > 15.5f && fecube.transform.localEulerAngles.x < 16.5f) { skin.SetBlendShapeWeight(14, 0f); skin.SetBlendShapeWeight(15, 100f); skin.SetBlendShapeWeight(16, 0f); } if (fecube.transform.localEulerAngles.x > 16.5f && fecube.transform.localEulerAngles.x < 17.5f) { skin.SetBlendShapeWeight(15, 0f); skin.SetBlendShapeWeight(16, 100f); skin.SetBlendShapeWeight(17, 0f); } if (fecube.transform.localEulerAngles.x > 17.5f && fecube.transform.localEulerAngles.x < 18.5f) { skin.SetBlendShapeWeight(16, 0f); skin.SetBlendShapeWeight(17, 100f); skin.SetBlendShapeWeight(18, 0f); } if (fecube.transform.localEulerAngles.x > 18.5f && fecube.transform.localEulerAngles.x < 19.5f) { skin.SetBlendShapeWeight(17, 0f); skin.SetBlendShapeWeight(18, 100f); skin.SetBlendShapeWeight(19, 0f); } if (fecube.transform.localEulerAngles.x > 19.5f && fecube.transform.localEulerAngles.x < 20.5f) { skin.SetBlendShapeWeight(18, 0f); skin.SetBlendShapeWeight(19, 100f); skin.SetBlendShapeWeight(20, 0f); } if (fecube.transform.localEulerAngles.x > 20.5f && fecube.transform.localEulerAngles.x < 21.5f) { skin.SetBlendShapeWeight(19, 0f); skin.SetBlendShapeWeight(20, 100f); skin.SetBlendShapeWeight(21, 0f); } if (fecube.transform.localEulerAngles.x > 21.5f && fecube.transform.localEulerAngles.x < 22.5f) { skin.SetBlendShapeWeight(20, 0f); skin.SetBlendShapeWeight(21, 100f); skin.SetBlendShapeWeight(22, 0f); } if (fecube.transform.localEulerAngles.x > 22.5f && fecube.transform.localEulerAngles.x < 23.5f) { skin.SetBlendShapeWeight(21, 0f); skin.SetBlendShapeWeight(22, 100f); skin.SetBlendShapeWeight(23, 0f); } if (fecube.transform.localEulerAngles.x > 23.5f && fecube.transform.localEulerAngles.x < 24.5f) { skin.SetBlendShapeWeight(22, 0f); skin.SetBlendShapeWeight(23, 100f); skin.SetBlendShapeWeight(24, 0f); } if (fecube.transform.localEulerAngles.x > 24.5f && fecube.transform.localEulerAngles.x < 25.5f) { skin.SetBlendShapeWeight(23, 0f); skin.SetBlendShapeWeight(24, 100f); skin.SetBlendShapeWeight(25, 0f); } } } } } [Serializable] public class FootSettings { public Transform footTransform; public float raycastDistance = 1f; public float moveThreshold = 0.3f; public float stepDuration = 0.3f; public float stepHeight = 0.2f; [HideInInspector] public Vector3 targetPosition; [HideInInspector] public bool isMoving; [HideInInspector] public float moveProgress; } public class FeetPlacerDS : MonoBehaviour { [Header("主要参数")] public Transform headTransform; public LayerMask groundLayer; public float balanceOffset = 0.1f; public float feetSpacing = 0.6f; [Header("脚步设置")] public FootSettings leftFoot; public FootSettings rightFoot; [Header("调试")] public bool showGizmos = true; private Vector3 lastHeadPosition; private bool leftFootLeading; private void Start() { InitializeFootPositions(); } private void InitializeFootPositions() { UpdateFootPosition(ref leftFoot); UpdateFootPosition(ref rightFoot); } private void Update() { HandleFootMovement(ref leftFoot); HandleFootMovement(ref rightFoot); UpdateBodyBalance(); } private void HandleFootMovement(ref FootSettings foot) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) if (foot.isMoving) { foot.moveProgress += Time.deltaTime / foot.stepDuration; Vector3 val = Vector3.up * Mathf.Sin(foot.moveProgress * (float)Math.PI) * foot.stepHeight; foot.footTransform.position = Vector3.Lerp(foot.footTransform.position, foot.targetPosition + val, foot.moveProgress); if (foot.moveProgress >= 1f) { foot.isMoving = false; } } else { Vector3 val2 = ProjectFootPosition(headTransform.forward); float num = Vector3.Distance(foot.footTransform.position, val2); if (num > foot.moveThreshold) { StartFootMovement(ref foot, val2); } } } private Vector3 ProjectFootPosition(Vector3 headDirection) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) Vector3 val = headTransform.position + headDirection * feetSpacing + ((!leftFootLeading) ? headTransform.right : (-headTransform.right)) * feetSpacing * 0.5f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val + Vector3.up * 0.5f, Vector3.down, ref val2, 2f, LayerMask.op_Implicit(groundLayer))) { return ((RaycastHit)(ref val2)).point; } return val; } private void StartFootMovement(ref FootSettings foot, Vector3 targetPos) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) foot.targetPosition = targetPos; foot.isMoving = true; foot.moveProgress = 0f; leftFootLeading = !leftFootLeading; } private void UpdateBodyBalance() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (leftFoot.footTransform.position + rightFoot.footTransform.position) / 2f; Vector3 val2 = val + (headTransform.position - val) * balanceOffset; ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, val2, Time.deltaTime * 5f); } private void UpdateFootPosition(ref FootSettings foot) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(foot.footTransform.position + Vector3.up * 0.5f, Vector3.down, ref val, foot.raycastDistance, LayerMask.op_Implicit(groundLayer))) { foot.footTransform.position = ((RaycastHit)(ref val)).point; } } private void OnDrawGizmos() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (showGizmos && Application.isPlaying) { Gizmos.color = Color.red; Gizmos.DrawSphere(leftFoot.targetPosition, 0.1f); Gizmos.DrawSphere(rightFoot.targetPosition, 0.1f); Gizmos.color = Color.blue; Gizmos.DrawLine(headTransform.position, headTransform.position + headTransform.forward * feetSpacing); } } } namespace Cityrobo { public class ForceArea : MonoBehaviour { [Tooltip("Force per physics frame in Newtons. I'm assuming the player weights 75kg for the launch force calculation.")] public float Force = 500f; [Tooltip("Blue arrow dictates force direction.")] public Transform ForceVector; private Collider _trigger; private const float PLAYERWEIGHT = 75f; private Collider Trigger { get { if ((Object)(object)_trigger == (Object)null) { _trigger = ((Component)this).GetComponent(); return _trigger; } return _trigger; } } public void OnTriggerStay(Collider other) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)other.attachedRigidbody != (Object)null) { other.attachedRigidbody.AddForce(ForceVector.forward * Force); } } public void Update() { CheckPlayer(); } private void CheckPlayer() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) Vector3 point = default(Vector3); ((Vector3)(ref point))..ctor(((Component)GM.CurrentPlayerBody.Head).transform.position.x, ((Component)GM.CurrentPlayerBody).transform.position.y, ((Component)GM.CurrentPlayerBody.Head).transform.position.z); if (GM.CurrentMovementManager.IsSmoothLoco() && IsInsideCollider(Trigger, point)) { BlastPlayer(); } } private bool IsInsideCollider(Collider c, Vector3 point) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return c.ClosestPoint(point) == point; } private void BlastPlayer() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) float num = Time.deltaTime * Force / 75f; GM.CurrentMovementManager.Blast(ForceVector.forward, num, false); } } } namespace DestinyScript1 { public class HPR : MonoBehaviour { [Header("需要跟随VR设备的位置")] [Tooltip("(可选)头部的VR头显跟随与旋转位置")] public GameObject _head; public GameObject _neck; [Tooltip("双手跟随VR手柄的位置")] public Transform _ZuoShouWeiZhi; [Tooltip("双手跟随VR手柄的位置")] public Transform _YouShouWeiZhi; [Tooltip("(可选)VRIk脚本, 用来替换手部IK跟随位置")] public VRIK _VRIKCon; [Tooltip("(如果VRIK 为空 此处可以不添加)手部IK跟踪位置: 0 = VR手柄跟踪位, 1 = 武器抓握, 2 = 弹匣抓握, 3 = 护木抓握, 4 = 枪栓抓握,5 = 手枪滑套抓握, 6 = 子弹抓握, 7 = 手雷抓握, 8 = 手枪战术握法, 9 = 机枪机匣盖抓握位置")] public Transform[] _leftHandTarget; [Tooltip("(如果VRIK 为空 此处可以不添加)手部IK跟踪位置: 0 = VR手柄跟踪位, 1 = 武器抓握, 2 = 弹匣抓握, 3 = 护木抓握, 4 = 枪栓抓握,5 = 手枪滑套抓握, 6 = 子弹抓握, 7 = 手雷抓握, 8 = 手枪战术握法, 9 = 机枪机匣盖抓握位置")] public Transform[] _rightHandTarget; [Header("(可选)移动动画控制器")] public Animator playerAnime; [Header("(可选)左右手动画控制器")] public Animator leftHandAT; public Animator rightHandAT; [Header("移动动画float过渡条件名称")] public string AnimatorControllerName_X; public string AnimatorControllerName_Y; [Header("(如果左右手动画控制器为空 此处可以为空)动画bool过渡条件名称")] public string _gun; public string _mag; public string _grab; public string _bolt; public string _slide; public string _ammo; public string _trigger; public string _grenade; public string _HGCB; public string _gunCurved; [Header("双手手指动画开关控制")] public AngryNoob_FingerTracking _leftFingerTraking; public AngryNoob_FingerTracking _ringtFingerTraking; public PlayerBody _h3mpbody; private GameObject _player; private FVRViveHand leftHand; private FVRViveHand rightHand; private FVRInteractiveObject _gameObejctOnHands; private bool _leftContinuousGrip = false; private bool _rightContinuousGrip = false; private bool _gripCut = false; private bool _fier; [NonSerialized] private FVRFireArm gun; [NonSerialized] private Vector3 gunAngle; [NonSerialized] private Vector3 gunAngle_Touch; private bool curved; private void Awake() { _player = ((Component)Object.FindObjectOfType()).gameObject; } private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GameManager.OnPlayerBodyInit += new OnPlayerBodyInitDelegate(OnPlayerBodyInit); if ((Object)(object)Mod.managerObject == (Object)null) { leftHand = ((Component)_player.transform.Find("Controller (left)")).GetComponent(); rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent(); } else if ((Object)(object)GameManager.currentPlayerBody == (Object)(object)_h3mpbody) { leftHand = ((Component)_player.transform.Find("Controller (left)")).GetComponent(); rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent(); } else { Object.Destroy((Object)(object)this); } } public void OnPlayerBodyInit(FVRPlayerBody playerBody) { leftHand = ((Component)playerBody.LeftHand).GetComponent(); rightHand = ((Component)playerBody.RightHand).GetComponent(); } private void Update() { if ((Object)(object)leftHand != (Object)null) { HandFollow(leftHand, rightHand, _leftFingerTraking, ref _leftContinuousGrip, leftHandAT, rightHandAT, _leftHandTarget, _ZuoShouWeiZhi); HandFollow(rightHand, leftHand, _ringtFingerTraking, ref _rightContinuousGrip, rightHandAT, leftHandAT, _rightHandTarget, _YouShouWeiZhi); if ((Object)(object)_head != (Object)null && (Object)(object)_neck != (Object)null) { HeadFollowPlayerBody(); } if ((Object)(object)playerAnime != (Object)null) { PlayerAnimC(); } } } private void HeadFollowPlayerBody() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) _head.transform.position = GM.CurrentPlayerBody.Head.position; _neck.transform.rotation = GM.CurrentPlayerBody.Head.rotation; if (leftHand.Input.Secondary2AxisInputAxes.x >= 0.01f || leftHand.Input.Secondary2AxisInputAxes.y >= 0.01f || rightHand.Input.Secondary2AxisInputAxes.x >= 0.01f || rightHand.Input.Secondary2AxisInputAxes.y >= 0.01f) { Vector3 forward = _head.transform.forward; forward.y = 0f; ((Component)this).transform.rotation = Quaternion.LookRotation(forward, Vector3.up); } } private void HandFollow(FVRViveHand _hands, FVRViveHand _otherHand, AngryNoob_FingerTracking _fingerT, ref bool _Grip, Animator _handAnimator, Animator _otherHandAnim, Transform[] _handTarget, Transform _handPos) { //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07d3: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0683: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0672: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_hands.CurrentInteractable != (Object)null) { _gameObejctOnHands = ((Component)_hands.CurrentInteractable).GetComponent(); _fingerT._handGrap = true; if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch == (Object)null && _hands.m_timeGripButtonHasBeenHeld > 0f && !_Grip) { _Grip = true; } if ((Object)(object)_handAnimator != (Object)null) { HandsAnimationControll(_handAnimator, _otherHandAnim, _handTarget, _hands, _otherHand); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)gun == (Object)null) { gun = ((Component)_hands.CurrentInteractable).GetComponent(); if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride != (Object)null) { gunAngle = ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles; if (((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x >= 310f && ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x <= 360f) { ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles = new Vector3(310f, 0f, 0f); curved = true; } else if (((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x < 310f && ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x >= 180f) { curved = false; } } else if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride == (Object)null) { gunAngle = Vector3.zero; } if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch != (Object)null) { gunAngle_Touch = ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles; if (((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x >= 310f && ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x <= 360f) { ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles = new Vector3(310f, 0f, 0f); curved = true; } else if (((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x < 310f && ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x >= 180f) { curved = false; } } else if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch == (Object)null) { gunAngle_Touch = Vector3.zero; } } if (((FVRPhysicalObject)((Component)_hands.CurrentInteractable).GetComponent()).IsAltHeld) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.rotation; } else if (!((FVRPhysicalObject)((Component)_hands.CurrentInteractable).GetComponent()).IsAltHeld) { if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() == (Object)null) { if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } return; } if ((Object)(object)_otherHand.CurrentInteractable != (Object)null && (Object)(object)_hands.CurrentInteractable == (Object)null && DoubleHandMasturbating(_otherHand)) { _fingerT._handGrap = true; return; } if ((Object)(object)gun != (Object)null) { if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride != (Object)null) { ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles = gunAngle; } if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch != (Object)null) { ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles = gunAngle_Touch; } gunAngle = Vector3.zero; gunAngle_Touch = Vector3.zero; gun = null; } _gameObejctOnHands = null; if ((Object)(object)_handAnimator != (Object)null) { _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hands).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handTarget[0]; } else { _VRIKCon.solver.rightArm.target = _handTarget[0]; } } _fingerT._handGrap = false; _Grip = false; _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } private void HandsAnimationControll(Animator _handAnimator, Animator _otherHandAnim, Transform[] _handFollowPos, FVRViveHand _hand, FVRViveHand _otherHand) { switch (HandAnimControll(_otherHand)) { case 1: _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_mag, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[2]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[2]; } break; case 2: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grab, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; } break; case 3: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); if (curved) { _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_gunCurved, true); } else if (!curved) { _handAnimator.SetBool(_gun, true); _handAnimator.SetBool(_gunCurved, false); } _handAnimator.SetBool(_trigger, HandGunFier(_hand)); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[1]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[1]; } break; case 4: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_bolt, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[4]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[4]; } break; case 5: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_slide, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[5]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[5]; } break; case 6: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, true); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[6]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[6]; } break; case 7: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_grenade, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[7]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[7]; } break; case 8: _otherHandAnim.SetBool(_ammo, false); _handAnimator.SetBool(_trigger, HandGunFier(_hand)); _otherHandAnim.SetBool(_trigger, false); _otherHandAnim.SetBool(_grab, false); _otherHandAnim.SetBool(_gun, false); _otherHandAnim.SetBool(_slide, false); _otherHandAnim.SetBool(_bolt, false); _otherHandAnim.SetBool(_mag, false); _otherHandAnim.SetBool(_grenade, false); _otherHandAnim.SetBool(_HGCB, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.rightArm.target = _handFollowPos[8]; } else { _VRIKCon.solver.leftArm.target = _handFollowPos[8]; } break; case 9: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_mag, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[9]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[9]; } break; case 10: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grab, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; } break; default: _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_gun, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[1]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[1]; } break; } } private int HandAnimControll(FVRViveHand _otherHand) { int result = 1; if (typeof(FVRFireArm).IsAssignableFrom(((object)_gameObejctOnHands).GetType())) { if (((FVRPhysicalObject)((Component)_gameObejctOnHands).GetComponent()).IsAltHeld) { result = 10; } else if (!((FVRPhysicalObject)((Component)_gameObejctOnHands).GetComponent()).IsAltHeld) { result = 3; } } if (typeof(FVRFireArm).IsAssignableFrom(((object)_gameObejctOnHands).GetType()) && DoubleHandMasturbating(_otherHand) && (Object)(object)_otherHand.CurrentInteractable == (Object)null) { result = 8; } if ((object)typeof(FVRFireArmMagazine) == ((object)_gameObejctOnHands).GetType()) { result = 1; } if ((object)typeof(ClosedBoltHandle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(ClosedBolt) == ((object)_gameObejctOnHands).GetType() || (object)typeof(BoltActionRifle_Handle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(OpenBoltChargingHandle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(OpenBoltReceiverBolt) == ((object)_gameObejctOnHands).GetType()) { result = 4; } if ((object)typeof(FVRAlternateGrip) == ((object)_gameObejctOnHands).GetType() || (object)typeof(TubeFedShotgunHandle) == ((object)_gameObejctOnHands).GetType()) { result = 2; } if ((object)typeof(FVRFireArmRound) == ((object)_gameObejctOnHands).GetType()) { result = 6; } if ((object)typeof(HandgunSlide) == ((object)_gameObejctOnHands).GetType()) { result = 5; } if ((object)typeof(PinnedGrenade) == ((object)_gameObejctOnHands).GetType() || (object)typeof(FVRCappedGrenade) == ((object)_gameObejctOnHands).GetType()) { result = 7; } if ((object)typeof(FVRFireArmTopCover) == ((object)_gameObejctOnHands).GetType()) { result = 9; } return result; } private bool HandGunFier(FVRViveHand _hand) { if (_hand.Input.TriggerFloat >= 0.7f) { _fier = true; } else { _fier = false; } return _fier; } private bool DoubleHandMasturbating(FVRViveHand _otherHand) { if (HandsDistance() <= 0.15f && (Object)(object)_otherHand.CurrentInteractable == (Object)null && _otherHand.Input.TriggerDown) { _gripCut = !_gripCut; } if (HandsDistance() > 0.22f) { _gripCut = false; } return _gripCut; } private float HandsDistance() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return Vector3.Distance(GM.CurrentMovementManager.LeftHand.position, GM.CurrentMovementManager.RightHand.position); } private void PlayerAnimC() { playerAnime.SetFloat(AnimatorControllerName_X, leftHand.Input.Secondary2AxisInputAxes.x); playerAnime.SetFloat(AnimatorControllerName_Y, leftHand.Input.Secondary2AxisInputAxes.y); } public void OnDestroy() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GameManager.OnPlayerBodyInit -= new OnPlayerBodyInitDelegate(OnPlayerBodyInit); } } public class HPRNew : HPR { private GameObject _player; private FVRViveHand leftHand; private FVRViveHand rightHand; private FVRInteractiveObject _gameObejctOnHands; private bool _leftContinuousGrip = false; private bool _rightContinuousGrip = false; private bool _gripCut = false; private bool _fier; [NonSerialized] private FVRFireArm gun; [NonSerialized] private Vector3 gunAngle; [NonSerialized] private Vector3 gunAngle_Touch; private bool curved; private bool verticle; public GameObject HPL; public GameObject CGL; public GameObject DML; public GameObject HDML; public GameObject HPR; public GameObject CGR; public GameObject DMR; public GameObject HDMR; public bool cleared = false; public bool laststate = true; private void Awake() { _player = ((Component)GM.CurrentPlayerBody).gameObject; } private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GameManager.OnPlayerBodyInit += new OnPlayerBodyInitDelegate(OnPlayerBodyInit); if ((Object)(object)Mod.managerObject == (Object)null) { leftHand = ((Component)_player.transform.Find("Controller (left)")).GetComponent(); rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent(); } else if ((Object)(object)GameManager.currentPlayerBody == (Object)(object)_h3mpbody) { leftHand = ((Component)_player.transform.Find("Controller (left)")).GetComponent(); rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent(); } else { Object.Destroy((Object)(object)this); } } public new void OnPlayerBodyInit(FVRPlayerBody playerBody) { leftHand = ((Component)playerBody.LeftHand).GetComponent(); rightHand = ((Component)playerBody.RightHand).GetComponent(); } private void Update() { if ((Object)(object)leftHand != (Object)null) { HandFollow(leftHand, rightHand, _leftFingerTraking, ref _leftContinuousGrip, leftHandAT, rightHandAT, _leftHandTarget, _ZuoShouWeiZhi); HandFollow(rightHand, leftHand, _ringtFingerTraking, ref _rightContinuousGrip, rightHandAT, leftHandAT, _rightHandTarget, _YouShouWeiZhi); if ((Object)(object)_head != (Object)null && (Object)(object)_neck != (Object)null) { HeadFollowPlayerBody(); } if ((Object)(object)playerAnime != (Object)null) { PlayerAnimC(); } } } private void HeadFollowPlayerBody() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) _head.transform.position = GM.CurrentPlayerBody.Head.position; _neck.transform.rotation = GM.CurrentPlayerBody.Head.rotation; if (leftHand.Input.Secondary2AxisInputAxes.x >= 0.01f || leftHand.Input.Secondary2AxisInputAxes.y >= 0.01f || rightHand.Input.Secondary2AxisInputAxes.x >= 0.01f || rightHand.Input.Secondary2AxisInputAxes.y >= 0.01f) { Vector3 forward = _head.transform.forward; forward.y = 0f; ((Component)this).transform.rotation = Quaternion.LookRotation(forward, Vector3.up); } } private void HandFollow(FVRViveHand _hands, FVRViveHand _otherHand, AngryNoob_FingerTracking _fingerT, ref bool _Grip, Animator _handAnimator, Animator _otherHandAnim, Transform[] _handTarget, Transform _handPos) { //IL_5934: Unknown result type (might be due to invalid IL or missing references) //IL_5958: Unknown result type (might be due to invalid IL or missing references) //IL_597c: Unknown result type (might be due to invalid IL or missing references) //IL_59a0: Unknown result type (might be due to invalid IL or missing references) //IL_59c4: Unknown result type (might be due to invalid IL or missing references) //IL_59e8: Unknown result type (might be due to invalid IL or missing references) //IL_5a0c: Unknown result type (might be due to invalid IL or missing references) //IL_5a30: Unknown result type (might be due to invalid IL or missing references) //IL_5a54: Unknown result type (might be due to invalid IL or missing references) //IL_5a78: Unknown result type (might be due to invalid IL or missing references) //IL_5a9c: Unknown result type (might be due to invalid IL or missing references) //IL_5ade: Unknown result type (might be due to invalid IL or missing references) //IL_5b02: Unknown result type (might be due to invalid IL or missing references) //IL_5b26: Unknown result type (might be due to invalid IL or missing references) //IL_5b4a: Unknown result type (might be due to invalid IL or missing references) //IL_5b6e: Unknown result type (might be due to invalid IL or missing references) //IL_5b92: Unknown result type (might be due to invalid IL or missing references) //IL_5bb6: Unknown result type (might be due to invalid IL or missing references) //IL_5bda: Unknown result type (might be due to invalid IL or missing references) //IL_5bfe: Unknown result type (might be due to invalid IL or missing references) //IL_5c22: Unknown result type (might be due to invalid IL or missing references) //IL_5c46: Unknown result type (might be due to invalid IL or missing references) //IL_5538: Unknown result type (might be due to invalid IL or missing references) //IL_5e03: Unknown result type (might be due to invalid IL or missing references) //IL_5e15: Unknown result type (might be due to invalid IL or missing references) //IL_5c86: Unknown result type (might be due to invalid IL or missing references) //IL_572e: Unknown result type (might be due to invalid IL or missing references) //IL_55fb: Unknown result type (might be due to invalid IL or missing references) //IL_561b: Unknown result type (might be due to invalid IL or missing references) //IL_563b: Unknown result type (might be due to invalid IL or missing references) //IL_565b: Unknown result type (might be due to invalid IL or missing references) //IL_567f: Unknown result type (might be due to invalid IL or missing references) //IL_56a3: Unknown result type (might be due to invalid IL or missing references) //IL_5574: Unknown result type (might be due to invalid IL or missing references) //IL_5594: Unknown result type (might be due to invalid IL or missing references) //IL_55b4: Unknown result type (might be due to invalid IL or missing references) //IL_55d4: Unknown result type (might be due to invalid IL or missing references) //IL_4fdb: Unknown result type (might be due to invalid IL or missing references) //IL_4fff: Unknown result type (might be due to invalid IL or missing references) //IL_5023: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_5cc0: Unknown result type (might be due to invalid IL or missing references) //IL_5cc5: Unknown result type (might be due to invalid IL or missing references) //IL_5ccb: Unknown result type (might be due to invalid IL or missing references) //IL_5cd0: Unknown result type (might be due to invalid IL or missing references) //IL_5cb4: Unknown result type (might be due to invalid IL or missing references) //IL_57f1: Unknown result type (might be due to invalid IL or missing references) //IL_5811: Unknown result type (might be due to invalid IL or missing references) //IL_5831: Unknown result type (might be due to invalid IL or missing references) //IL_5851: Unknown result type (might be due to invalid IL or missing references) //IL_5875: Unknown result type (might be due to invalid IL or missing references) //IL_5899: Unknown result type (might be due to invalid IL or missing references) //IL_576a: Unknown result type (might be due to invalid IL or missing references) //IL_578a: Unknown result type (might be due to invalid IL or missing references) //IL_57aa: Unknown result type (might be due to invalid IL or missing references) //IL_57ca: Unknown result type (might be due to invalid IL or missing references) //IL_56c8: Unknown result type (might be due to invalid IL or missing references) //IL_56ec: Unknown result type (might be due to invalid IL or missing references) //IL_5065: Unknown result type (might be due to invalid IL or missing references) //IL_5089: Unknown result type (might be due to invalid IL or missing references) //IL_50ad: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_58be: Unknown result type (might be due to invalid IL or missing references) //IL_58e2: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_086d: Unknown result type (might be due to invalid IL or missing references) //IL_0891: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_50e4: Unknown result type (might be due to invalid IL or missing references) //IL_50fb: Unknown result type (might be due to invalid IL or missing references) //IL_076b: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_5132: Unknown result type (might be due to invalid IL or missing references) //IL_5144: Unknown result type (might be due to invalid IL or missing references) //IL_13d9: Unknown result type (might be due to invalid IL or missing references) //IL_13f9: Unknown result type (might be due to invalid IL or missing references) //IL_1419: Unknown result type (might be due to invalid IL or missing references) //IL_1439: Unknown result type (might be due to invalid IL or missing references) //IL_0d06: Unknown result type (might be due to invalid IL or missing references) //IL_0d27: Unknown result type (might be due to invalid IL or missing references) //IL_0ca1: Unknown result type (might be due to invalid IL or missing references) //IL_0cc2: Unknown result type (might be due to invalid IL or missing references) //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_54b3: Unknown result type (might be due to invalid IL or missing references) //IL_54c5: Unknown result type (might be due to invalid IL or missing references) //IL_5474: Unknown result type (might be due to invalid IL or missing references) //IL_5490: Unknown result type (might be due to invalid IL or missing references) //IL_189d: Unknown result type (might be due to invalid IL or missing references) //IL_18bd: Unknown result type (might be due to invalid IL or missing references) //IL_18dd: Unknown result type (might be due to invalid IL or missing references) //IL_18fd: Unknown result type (might be due to invalid IL or missing references) //IL_147a: Unknown result type (might be due to invalid IL or missing references) //IL_149e: Unknown result type (might be due to invalid IL or missing references) //IL_14c2: Unknown result type (might be due to invalid IL or missing references) //IL_14e6: Unknown result type (might be due to invalid IL or missing references) //IL_150a: Unknown result type (might be due to invalid IL or missing references) //IL_152e: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_1ebf: Unknown result type (might be due to invalid IL or missing references) //IL_1edf: Unknown result type (might be due to invalid IL or missing references) //IL_1eff: Unknown result type (might be due to invalid IL or missing references) //IL_1f1f: Unknown result type (might be due to invalid IL or missing references) //IL_193e: Unknown result type (might be due to invalid IL or missing references) //IL_1962: Unknown result type (might be due to invalid IL or missing references) //IL_1986: Unknown result type (might be due to invalid IL or missing references) //IL_19aa: Unknown result type (might be due to invalid IL or missing references) //IL_19ce: Unknown result type (might be due to invalid IL or missing references) //IL_19f2: Unknown result type (might be due to invalid IL or missing references) //IL_1567: Unknown result type (might be due to invalid IL or missing references) //IL_1583: Unknown result type (might be due to invalid IL or missing references) //IL_0e0a: Unknown result type (might be due to invalid IL or missing references) //IL_0e2a: Unknown result type (might be due to invalid IL or missing references) //IL_0e4a: Unknown result type (might be due to invalid IL or missing references) //IL_0e6a: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_24f3: Unknown result type (might be due to invalid IL or missing references) //IL_2513: Unknown result type (might be due to invalid IL or missing references) //IL_2533: Unknown result type (might be due to invalid IL or missing references) //IL_2553: Unknown result type (might be due to invalid IL or missing references) //IL_1f60: Unknown result type (might be due to invalid IL or missing references) //IL_1f84: Unknown result type (might be due to invalid IL or missing references) //IL_1fa8: Unknown result type (might be due to invalid IL or missing references) //IL_1fcc: Unknown result type (might be due to invalid IL or missing references) //IL_1ff0: Unknown result type (might be due to invalid IL or missing references) //IL_2014: Unknown result type (might be due to invalid IL or missing references) //IL_1a25: Unknown result type (might be due to invalid IL or missing references) //IL_1a2b: Invalid comparison between Unknown and I4 //IL_1697: Unknown result type (might be due to invalid IL or missing references) //IL_16bb: Unknown result type (might be due to invalid IL or missing references) //IL_15cf: Unknown result type (might be due to invalid IL or missing references) //IL_15d4: Unknown result type (might be due to invalid IL or missing references) //IL_15e8: Unknown result type (might be due to invalid IL or missing references) //IL_0eab: Unknown result type (might be due to invalid IL or missing references) //IL_0ecf: Unknown result type (might be due to invalid IL or missing references) //IL_0ef3: Unknown result type (might be due to invalid IL or missing references) //IL_0f17: Unknown result type (might be due to invalid IL or missing references) //IL_0f3b: Unknown result type (might be due to invalid IL or missing references) //IL_0f5f: Unknown result type (might be due to invalid IL or missing references) //IL_0952: Unknown result type (might be due to invalid IL or missing references) //IL_0978: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_51cf: Unknown result type (might be due to invalid IL or missing references) //IL_51eb: Unknown result type (might be due to invalid IL or missing references) //IL_29c1: Unknown result type (might be due to invalid IL or missing references) //IL_29e1: Unknown result type (might be due to invalid IL or missing references) //IL_2a01: Unknown result type (might be due to invalid IL or missing references) //IL_2a21: Unknown result type (might be due to invalid IL or missing references) //IL_2594: Unknown result type (might be due to invalid IL or missing references) //IL_25b8: Unknown result type (might be due to invalid IL or missing references) //IL_25dc: Unknown result type (might be due to invalid IL or missing references) //IL_2600: Unknown result type (might be due to invalid IL or missing references) //IL_2624: Unknown result type (might be due to invalid IL or missing references) //IL_2648: Unknown result type (might be due to invalid IL or missing references) //IL_2045: Unknown result type (might be due to invalid IL or missing references) //IL_204b: Invalid comparison between Unknown and I4 //IL_1b54: Unknown result type (might be due to invalid IL or missing references) //IL_1a45: Unknown result type (might be due to invalid IL or missing references) //IL_1a63: Unknown result type (might be due to invalid IL or missing references) //IL_16fd: Unknown result type (might be due to invalid IL or missing references) //IL_1721: Unknown result type (might be due to invalid IL or missing references) //IL_163a: Unknown result type (might be due to invalid IL or missing references) //IL_163f: Unknown result type (might be due to invalid IL or missing references) //IL_1653: Unknown result type (might be due to invalid IL or missing references) //IL_0f98: Unknown result type (might be due to invalid IL or missing references) //IL_0fb4: Unknown result type (might be due to invalid IL or missing references) //IL_0fc9: Unknown result type (might be due to invalid IL or missing references) //IL_0fcf: Invalid comparison between Unknown and I4 //IL_0a8a: Unknown result type (might be due to invalid IL or missing references) //IL_0ab0: Unknown result type (might be due to invalid IL or missing references) //IL_09ab: Unknown result type (might be due to invalid IL or missing references) //IL_09cc: Unknown result type (might be due to invalid IL or missing references) //IL_52c1: Unknown result type (might be due to invalid IL or missing references) //IL_52dd: Unknown result type (might be due to invalid IL or missing references) //IL_5219: Unknown result type (might be due to invalid IL or missing references) //IL_5235: Unknown result type (might be due to invalid IL or missing references) //IL_2fef: Unknown result type (might be due to invalid IL or missing references) //IL_300f: Unknown result type (might be due to invalid IL or missing references) //IL_302f: Unknown result type (might be due to invalid IL or missing references) //IL_304f: Unknown result type (might be due to invalid IL or missing references) //IL_2a62: Unknown result type (might be due to invalid IL or missing references) //IL_2a86: Unknown result type (might be due to invalid IL or missing references) //IL_2aaa: Unknown result type (might be due to invalid IL or missing references) //IL_2ace: Unknown result type (might be due to invalid IL or missing references) //IL_2af2: Unknown result type (might be due to invalid IL or missing references) //IL_2b16: Unknown result type (might be due to invalid IL or missing references) //IL_2681: Unknown result type (might be due to invalid IL or missing references) //IL_269d: Unknown result type (might be due to invalid IL or missing references) //IL_2178: Unknown result type (might be due to invalid IL or missing references) //IL_2063: Unknown result type (might be due to invalid IL or missing references) //IL_207f: Unknown result type (might be due to invalid IL or missing references) //IL_1cb9: Unknown result type (might be due to invalid IL or missing references) //IL_1cdd: Unknown result type (might be due to invalid IL or missing references) //IL_1b73: Unknown result type (might be due to invalid IL or missing references) //IL_1b91: Unknown result type (might be due to invalid IL or missing references) //IL_1abc: Unknown result type (might be due to invalid IL or missing references) //IL_11c9: Unknown result type (might be due to invalid IL or missing references) //IL_11ed: Unknown result type (might be due to invalid IL or missing references) //IL_109f: Unknown result type (might be due to invalid IL or missing references) //IL_0bc9: Unknown result type (might be due to invalid IL or missing references) //IL_0bef: Unknown result type (might be due to invalid IL or missing references) //IL_0b16: Unknown result type (might be due to invalid IL or missing references) //IL_0b3c: Unknown result type (might be due to invalid IL or missing references) //IL_53ba: Unknown result type (might be due to invalid IL or missing references) //IL_53d6: Unknown result type (might be due to invalid IL or missing references) //IL_5334: Unknown result type (might be due to invalid IL or missing references) //IL_5350: Unknown result type (might be due to invalid IL or missing references) //IL_361d: Unknown result type (might be due to invalid IL or missing references) //IL_363d: Unknown result type (might be due to invalid IL or missing references) //IL_365d: Unknown result type (might be due to invalid IL or missing references) //IL_367d: Unknown result type (might be due to invalid IL or missing references) //IL_3090: Unknown result type (might be due to invalid IL or missing references) //IL_30b4: Unknown result type (might be due to invalid IL or missing references) //IL_30d8: Unknown result type (might be due to invalid IL or missing references) //IL_30fc: Unknown result type (might be due to invalid IL or missing references) //IL_3120: Unknown result type (might be due to invalid IL or missing references) //IL_3144: Unknown result type (might be due to invalid IL or missing references) //IL_2b47: Unknown result type (might be due to invalid IL or missing references) //IL_2b4d: Invalid comparison between Unknown and I4 //IL_27b1: Unknown result type (might be due to invalid IL or missing references) //IL_27d5: Unknown result type (might be due to invalid IL or missing references) //IL_26e9: Unknown result type (might be due to invalid IL or missing references) //IL_26ee: Unknown result type (might be due to invalid IL or missing references) //IL_2702: Unknown result type (might be due to invalid IL or missing references) //IL_22ed: Unknown result type (might be due to invalid IL or missing references) //IL_2311: Unknown result type (might be due to invalid IL or missing references) //IL_2195: Unknown result type (might be due to invalid IL or missing references) //IL_21b1: Unknown result type (might be due to invalid IL or missing references) //IL_20dd: Unknown result type (might be due to invalid IL or missing references) //IL_1d1f: Unknown result type (might be due to invalid IL or missing references) //IL_1d43: Unknown result type (might be due to invalid IL or missing references) //IL_1c00: Unknown result type (might be due to invalid IL or missing references) //IL_1b1b: Unknown result type (might be due to invalid IL or missing references) //IL_1758: Unknown result type (might be due to invalid IL or missing references) //IL_176f: Unknown result type (might be due to invalid IL or missing references) //IL_122f: Unknown result type (might be due to invalid IL or missing references) //IL_1253: Unknown result type (might be due to invalid IL or missing references) //IL_1024: Unknown result type (might be due to invalid IL or missing references) //IL_0c50: Unknown result type (might be due to invalid IL or missing references) //IL_0c76: Unknown result type (might be due to invalid IL or missing references) //IL_5423: Unknown result type (might be due to invalid IL or missing references) //IL_543f: Unknown result type (might be due to invalid IL or missing references) //IL_3c4b: Unknown result type (might be due to invalid IL or missing references) //IL_3c6b: Unknown result type (might be due to invalid IL or missing references) //IL_3c8b: Unknown result type (might be due to invalid IL or missing references) //IL_3cab: Unknown result type (might be due to invalid IL or missing references) //IL_36be: Unknown result type (might be due to invalid IL or missing references) //IL_36e2: Unknown result type (might be due to invalid IL or missing references) //IL_3706: Unknown result type (might be due to invalid IL or missing references) //IL_372a: Unknown result type (might be due to invalid IL or missing references) //IL_374e: Unknown result type (might be due to invalid IL or missing references) //IL_3772: Unknown result type (might be due to invalid IL or missing references) //IL_3175: Unknown result type (might be due to invalid IL or missing references) //IL_317b: Invalid comparison between Unknown and I4 //IL_2c88: Unknown result type (might be due to invalid IL or missing references) //IL_2b65: Unknown result type (might be due to invalid IL or missing references) //IL_2b81: Unknown result type (might be due to invalid IL or missing references) //IL_2817: Unknown result type (might be due to invalid IL or missing references) //IL_283b: Unknown result type (might be due to invalid IL or missing references) //IL_2754: Unknown result type (might be due to invalid IL or missing references) //IL_2759: Unknown result type (might be due to invalid IL or missing references) //IL_276d: Unknown result type (might be due to invalid IL or missing references) //IL_2353: Unknown result type (might be due to invalid IL or missing references) //IL_2377: Unknown result type (might be due to invalid IL or missing references) //IL_222a: Unknown result type (might be due to invalid IL or missing references) //IL_2141: Unknown result type (might be due to invalid IL or missing references) //IL_1c75: Unknown result type (might be due to invalid IL or missing references) //IL_17f6: Unknown result type (might be due to invalid IL or missing references) //IL_1812: Unknown result type (might be due to invalid IL or missing references) //IL_17a6: Unknown result type (might be due to invalid IL or missing references) //IL_17b8: Unknown result type (might be due to invalid IL or missing references) //IL_110f: Unknown result type (might be due to invalid IL or missing references) //IL_1083: Unknown result type (might be due to invalid IL or missing references) //IL_4279: Unknown result type (might be due to invalid IL or missing references) //IL_4299: Unknown result type (might be due to invalid IL or missing references) //IL_42b9: Unknown result type (might be due to invalid IL or missing references) //IL_42d9: Unknown result type (might be due to invalid IL or missing references) //IL_3cec: Unknown result type (might be due to invalid IL or missing references) //IL_3d10: Unknown result type (might be due to invalid IL or missing references) //IL_3d34: Unknown result type (might be due to invalid IL or missing references) //IL_3d58: Unknown result type (might be due to invalid IL or missing references) //IL_3d7c: Unknown result type (might be due to invalid IL or missing references) //IL_3da0: Unknown result type (might be due to invalid IL or missing references) //IL_37a3: Unknown result type (might be due to invalid IL or missing references) //IL_37a9: Invalid comparison between Unknown and I4 //IL_32b6: Unknown result type (might be due to invalid IL or missing references) //IL_3193: Unknown result type (might be due to invalid IL or missing references) //IL_31af: Unknown result type (might be due to invalid IL or missing references) //IL_2de9: Unknown result type (might be due to invalid IL or missing references) //IL_2e0d: Unknown result type (might be due to invalid IL or missing references) //IL_2ca5: Unknown result type (might be due to invalid IL or missing references) //IL_2cc1: Unknown result type (might be due to invalid IL or missing references) //IL_2bcd: Unknown result type (might be due to invalid IL or missing references) //IL_2bd2: Unknown result type (might be due to invalid IL or missing references) //IL_2be6: Unknown result type (might be due to invalid IL or missing references) //IL_22a9: Unknown result type (might be due to invalid IL or missing references) //IL_1d7a: Unknown result type (might be due to invalid IL or missing references) //IL_1d91: Unknown result type (might be due to invalid IL or missing references) //IL_1835: Unknown result type (might be due to invalid IL or missing references) //IL_1847: Unknown result type (might be due to invalid IL or missing references) //IL_128a: Unknown result type (might be due to invalid IL or missing references) //IL_12a1: Unknown result type (might be due to invalid IL or missing references) //IL_1184: Unknown result type (might be due to invalid IL or missing references) //IL_4bf0: Unknown result type (might be due to invalid IL or missing references) //IL_4c14: Unknown result type (might be due to invalid IL or missing references) //IL_473d: Unknown result type (might be due to invalid IL or missing references) //IL_475d: Unknown result type (might be due to invalid IL or missing references) //IL_477d: Unknown result type (might be due to invalid IL or missing references) //IL_479d: Unknown result type (might be due to invalid IL or missing references) //IL_431a: Unknown result type (might be due to invalid IL or missing references) //IL_433e: Unknown result type (might be due to invalid IL or missing references) //IL_4362: Unknown result type (might be due to invalid IL or missing references) //IL_4386: Unknown result type (might be due to invalid IL or missing references) //IL_43aa: Unknown result type (might be due to invalid IL or missing references) //IL_43ce: Unknown result type (might be due to invalid IL or missing references) //IL_3dd1: Unknown result type (might be due to invalid IL or missing references) //IL_3dd7: Invalid comparison between Unknown and I4 //IL_38e4: Unknown result type (might be due to invalid IL or missing references) //IL_37c1: Unknown result type (might be due to invalid IL or missing references) //IL_37dd: Unknown result type (might be due to invalid IL or missing references) //IL_3417: Unknown result type (might be due to invalid IL or missing references) //IL_343b: Unknown result type (might be due to invalid IL or missing references) //IL_32d3: Unknown result type (might be due to invalid IL or missing references) //IL_32ef: Unknown result type (might be due to invalid IL or missing references) //IL_31fb: Unknown result type (might be due to invalid IL or missing references) //IL_3200: Unknown result type (might be due to invalid IL or missing references) //IL_3214: Unknown result type (might be due to invalid IL or missing references) //IL_2e4f: Unknown result type (might be due to invalid IL or missing references) //IL_2e73: Unknown result type (might be due to invalid IL or missing references) //IL_2d30: Unknown result type (might be due to invalid IL or missing references) //IL_2c38: Unknown result type (might be due to invalid IL or missing references) //IL_2c3d: Unknown result type (might be due to invalid IL or missing references) //IL_2c51: Unknown result type (might be due to invalid IL or missing references) //IL_2872: Unknown result type (might be due to invalid IL or missing references) //IL_2889: Unknown result type (might be due to invalid IL or missing references) //IL_23ae: Unknown result type (might be due to invalid IL or missing references) //IL_23c5: Unknown result type (might be due to invalid IL or missing references) //IL_1e18: Unknown result type (might be due to invalid IL or missing references) //IL_1e34: Unknown result type (might be due to invalid IL or missing references) //IL_1dc8: Unknown result type (might be due to invalid IL or missing references) //IL_1dda: Unknown result type (might be due to invalid IL or missing references) //IL_1332: Unknown result type (might be due to invalid IL or missing references) //IL_134e: Unknown result type (might be due to invalid IL or missing references) //IL_12dd: Unknown result type (might be due to invalid IL or missing references) //IL_12f4: Unknown result type (might be due to invalid IL or missing references) //IL_4c56: Unknown result type (might be due to invalid IL or missing references) //IL_4c7a: Unknown result type (might be due to invalid IL or missing references) //IL_47de: Unknown result type (might be due to invalid IL or missing references) //IL_4802: Unknown result type (might be due to invalid IL or missing references) //IL_4826: Unknown result type (might be due to invalid IL or missing references) //IL_484a: Unknown result type (might be due to invalid IL or missing references) //IL_486e: Unknown result type (might be due to invalid IL or missing references) //IL_4892: Unknown result type (might be due to invalid IL or missing references) //IL_4407: Unknown result type (might be due to invalid IL or missing references) //IL_4423: Unknown result type (might be due to invalid IL or missing references) //IL_3f12: Unknown result type (might be due to invalid IL or missing references) //IL_3def: Unknown result type (might be due to invalid IL or missing references) //IL_3e0b: Unknown result type (might be due to invalid IL or missing references) //IL_3a45: Unknown result type (might be due to invalid IL or missing references) //IL_3a69: Unknown result type (might be due to invalid IL or missing references) //IL_3901: Unknown result type (might be due to invalid IL or missing references) //IL_391d: Unknown result type (might be due to invalid IL or missing references) //IL_3829: Unknown result type (might be due to invalid IL or missing references) //IL_382e: Unknown result type (might be due to invalid IL or missing references) //IL_3842: Unknown result type (might be due to invalid IL or missing references) //IL_347d: Unknown result type (might be due to invalid IL or missing references) //IL_34a1: Unknown result type (might be due to invalid IL or missing references) //IL_335e: Unknown result type (might be due to invalid IL or missing references) //IL_3266: Unknown result type (might be due to invalid IL or missing references) //IL_326b: Unknown result type (might be due to invalid IL or missing references) //IL_327f: Unknown result type (might be due to invalid IL or missing references) //IL_2da5: Unknown result type (might be due to invalid IL or missing references) //IL_291a: Unknown result type (might be due to invalid IL or missing references) //IL_2936: Unknown result type (might be due to invalid IL or missing references) //IL_28c5: Unknown result type (might be due to invalid IL or missing references) //IL_28dc: Unknown result type (might be due to invalid IL or missing references) //IL_244c: Unknown result type (might be due to invalid IL or missing references) //IL_2468: Unknown result type (might be due to invalid IL or missing references) //IL_23fc: Unknown result type (might be due to invalid IL or missing references) //IL_240e: Unknown result type (might be due to invalid IL or missing references) //IL_1e57: Unknown result type (might be due to invalid IL or missing references) //IL_1e69: Unknown result type (might be due to invalid IL or missing references) //IL_1371: Unknown result type (might be due to invalid IL or missing references) //IL_1383: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_4cb2: Unknown result type (might be due to invalid IL or missing references) //IL_4cd2: Unknown result type (might be due to invalid IL or missing references) //IL_4cf2: Unknown result type (might be due to invalid IL or missing references) //IL_4d12: Unknown result type (might be due to invalid IL or missing references) //IL_48cb: Unknown result type (might be due to invalid IL or missing references) //IL_48e7: Unknown result type (might be due to invalid IL or missing references) //IL_4537: Unknown result type (might be due to invalid IL or missing references) //IL_455b: Unknown result type (might be due to invalid IL or missing references) //IL_446f: Unknown result type (might be due to invalid IL or missing references) //IL_4474: Unknown result type (might be due to invalid IL or missing references) //IL_4488: Unknown result type (might be due to invalid IL or missing references) //IL_4073: Unknown result type (might be due to invalid IL or missing references) //IL_4097: Unknown result type (might be due to invalid IL or missing references) //IL_3f2f: Unknown result type (might be due to invalid IL or missing references) //IL_3f4b: Unknown result type (might be due to invalid IL or missing references) //IL_3e57: Unknown result type (might be due to invalid IL or missing references) //IL_3e5c: Unknown result type (might be due to invalid IL or missing references) //IL_3e70: Unknown result type (might be due to invalid IL or missing references) //IL_3aab: Unknown result type (might be due to invalid IL or missing references) //IL_3acf: Unknown result type (might be due to invalid IL or missing references) //IL_398c: Unknown result type (might be due to invalid IL or missing references) //IL_3894: Unknown result type (might be due to invalid IL or missing references) //IL_3899: Unknown result type (might be due to invalid IL or missing references) //IL_38ad: Unknown result type (might be due to invalid IL or missing references) //IL_33d3: Unknown result type (might be due to invalid IL or missing references) //IL_2eaa: Unknown result type (might be due to invalid IL or missing references) //IL_2ec1: Unknown result type (might be due to invalid IL or missing references) //IL_2959: Unknown result type (might be due to invalid IL or missing references) //IL_296b: Unknown result type (might be due to invalid IL or missing references) //IL_248b: Unknown result type (might be due to invalid IL or missing references) //IL_249d: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_4d53: Unknown result type (might be due to invalid IL or missing references) //IL_4d77: Unknown result type (might be due to invalid IL or missing references) //IL_4d9b: Unknown result type (might be due to invalid IL or missing references) //IL_4dbf: Unknown result type (might be due to invalid IL or missing references) //IL_4de3: Unknown result type (might be due to invalid IL or missing references) //IL_4e07: Unknown result type (might be due to invalid IL or missing references) //IL_4e2b: Unknown result type (might be due to invalid IL or missing references) //IL_4e4f: Unknown result type (might be due to invalid IL or missing references) //IL_49fb: Unknown result type (might be due to invalid IL or missing references) //IL_4a1f: Unknown result type (might be due to invalid IL or missing references) //IL_4933: Unknown result type (might be due to invalid IL or missing references) //IL_4938: Unknown result type (might be due to invalid IL or missing references) //IL_494c: Unknown result type (might be due to invalid IL or missing references) //IL_459d: Unknown result type (might be due to invalid IL or missing references) //IL_45c1: Unknown result type (might be due to invalid IL or missing references) //IL_44da: Unknown result type (might be due to invalid IL or missing references) //IL_44df: Unknown result type (might be due to invalid IL or missing references) //IL_44f3: Unknown result type (might be due to invalid IL or missing references) //IL_40d9: Unknown result type (might be due to invalid IL or missing references) //IL_40fd: Unknown result type (might be due to invalid IL or missing references) //IL_3fba: Unknown result type (might be due to invalid IL or missing references) //IL_3ec2: Unknown result type (might be due to invalid IL or missing references) //IL_3ec7: Unknown result type (might be due to invalid IL or missing references) //IL_3edb: Unknown result type (might be due to invalid IL or missing references) //IL_3a01: Unknown result type (might be due to invalid IL or missing references) //IL_34d8: Unknown result type (might be due to invalid IL or missing references) //IL_34ef: Unknown result type (might be due to invalid IL or missing references) //IL_2f48: Unknown result type (might be due to invalid IL or missing references) //IL_2f64: Unknown result type (might be due to invalid IL or missing references) //IL_2ef8: Unknown result type (might be due to invalid IL or missing references) //IL_2f0a: Unknown result type (might be due to invalid IL or missing references) //IL_062e: Unknown result type (might be due to invalid IL or missing references) //IL_4a61: Unknown result type (might be due to invalid IL or missing references) //IL_4a85: Unknown result type (might be due to invalid IL or missing references) //IL_499e: Unknown result type (might be due to invalid IL or missing references) //IL_49a3: Unknown result type (might be due to invalid IL or missing references) //IL_49b7: Unknown result type (might be due to invalid IL or missing references) //IL_402f: Unknown result type (might be due to invalid IL or missing references) //IL_3b06: Unknown result type (might be due to invalid IL or missing references) //IL_3b1d: Unknown result type (might be due to invalid IL or missing references) //IL_3576: Unknown result type (might be due to invalid IL or missing references) //IL_3592: Unknown result type (might be due to invalid IL or missing references) //IL_3526: Unknown result type (might be due to invalid IL or missing references) //IL_3538: Unknown result type (might be due to invalid IL or missing references) //IL_2f87: Unknown result type (might be due to invalid IL or missing references) //IL_2f99: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_4e86: Unknown result type (might be due to invalid IL or missing references) //IL_4e9d: Unknown result type (might be due to invalid IL or missing references) //IL_45f8: Unknown result type (might be due to invalid IL or missing references) //IL_460f: Unknown result type (might be due to invalid IL or missing references) //IL_4134: Unknown result type (might be due to invalid IL or missing references) //IL_414b: Unknown result type (might be due to invalid IL or missing references) //IL_3ba4: Unknown result type (might be due to invalid IL or missing references) //IL_3bc0: Unknown result type (might be due to invalid IL or missing references) //IL_3b54: Unknown result type (might be due to invalid IL or missing references) //IL_3b66: Unknown result type (might be due to invalid IL or missing references) //IL_35b5: Unknown result type (might be due to invalid IL or missing references) //IL_35c7: Unknown result type (might be due to invalid IL or missing references) //IL_4f2e: Unknown result type (might be due to invalid IL or missing references) //IL_4f4a: Unknown result type (might be due to invalid IL or missing references) //IL_4ed9: Unknown result type (might be due to invalid IL or missing references) //IL_4ef0: Unknown result type (might be due to invalid IL or missing references) //IL_4abc: Unknown result type (might be due to invalid IL or missing references) //IL_4ad3: Unknown result type (might be due to invalid IL or missing references) //IL_4696: Unknown result type (might be due to invalid IL or missing references) //IL_46b2: Unknown result type (might be due to invalid IL or missing references) //IL_4646: Unknown result type (might be due to invalid IL or missing references) //IL_4658: Unknown result type (might be due to invalid IL or missing references) //IL_41d2: Unknown result type (might be due to invalid IL or missing references) //IL_41ee: Unknown result type (might be due to invalid IL or missing references) //IL_4182: Unknown result type (might be due to invalid IL or missing references) //IL_4194: Unknown result type (might be due to invalid IL or missing references) //IL_3be3: Unknown result type (might be due to invalid IL or missing references) //IL_3bf5: Unknown result type (might be due to invalid IL or missing references) //IL_4f6d: Unknown result type (might be due to invalid IL or missing references) //IL_4f7f: Unknown result type (might be due to invalid IL or missing references) //IL_4b5a: Unknown result type (might be due to invalid IL or missing references) //IL_4b76: Unknown result type (might be due to invalid IL or missing references) //IL_4b0a: Unknown result type (might be due to invalid IL or missing references) //IL_4b1c: Unknown result type (might be due to invalid IL or missing references) //IL_46d5: Unknown result type (might be due to invalid IL or missing references) //IL_46e7: Unknown result type (might be due to invalid IL or missing references) //IL_4211: Unknown result type (might be due to invalid IL or missing references) //IL_4223: Unknown result type (might be due to invalid IL or missing references) //IL_4b99: Unknown result type (might be due to invalid IL or missing references) //IL_4bab: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_hands.CurrentInteractable != (Object)null) { _gameObejctOnHands = ((Component)_hands.CurrentInteractable).GetComponent(); _fingerT._handGrap = true; if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch == (Object)null && _hands.m_timeGripButtonHasBeenHeld > 0f && !_Grip) { _Grip = true; } if ((Object)(object)_handAnimator != (Object)null) { HandsAnimationControll(_handAnimator, _otherHandAnim, _handTarget, _hands, _otherHand); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)gun == (Object)null) { gun = ((Component)_hands.CurrentInteractable).GetComponent(); if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride != (Object)null) { gunAngle = ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles; if (((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x >= 310f && ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x <= 360f) { if ((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } } else { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } curved = true; } else if (((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x < 310f && ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles.x >= 180f) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } curved = false; } } else if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride == (Object)null) { gunAngle = Vector3.zero; } if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch != (Object)null) { gunAngle_Touch = ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles; if (((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x >= 310f && ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x <= 360f) { if ((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null || (Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(30f, 0f, 0f); } } else { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } curved = true; } else if (((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x < 310f && ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles.x >= 180f) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } curved = false; } } else if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch == (Object)null) { gunAngle_Touch = Vector3.zero; } } if (((FVRPhysicalObject)((Component)_hands.CurrentInteractable).GetComponent()).IsAltHeld) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip != (Object)null) { if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent() != (Object)null) { if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent()).PoseOverride != (Object)null) { if (verticle) { _handPos.position = ((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent()).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } else if (!verticle) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.rotation; } } } else { if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip != (Object)null)) { return; } if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment != (Object)null) { if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).Attachment).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment).PoseOverride == (Object)null) { _handPos.position = ((Component)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } } else if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).Attachment == (Object)null) { if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.GetComponent().LastGrabbedInGrip).PoseOverride == (Object)null) { _handPos.position = ((Component)((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.gameObject.transform.rotation; } } } } else { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Foregrip.transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Foregrip == (Object)null) { _handPos.position = ((Component)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent()).PoseOverride).transform.position; _handPos.rotation = ((Component)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent()).PoseOverride).transform.rotation; } } else { if (((FVRPhysicalObject)((Component)_hands.CurrentInteractable).GetComponent()).IsAltHeld) { return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { cleared = false; } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { cleared = true; } if (cleared != laststate) { if (_gripCut) { _gripCut = false; } laststate = cleared; } if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterp == 1) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3((0f - ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat) * ((Component)_hands.CurrentInteractable).GetComponent().TriggerHeld, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3((0f - ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat) * ((Component)_hands.CurrentInteractable).GetComponent().TriggerHeld, 0f, 0f); } } else if ((int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterp == 0) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().TriggerUnheld - ((Component)_hands.CurrentInteractable).GetComponent().TriggerHeld)); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().TriggerUnheld - ((Component)_hands.CurrentInteractable).GetComponent().TriggerHeld)); } } return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Triggers[0] != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterpStyle == 1) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Triggers[0].position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Triggers[0].rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3((0f - ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat) * ((Component)_hands.CurrentInteractable).GetComponent().TriggerPulled, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3((0f - ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat) * ((Component)_hands.CurrentInteractable).GetComponent().TriggerPulled, 0f, 0f); } return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Triggers[0] != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterpStyle == 0) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Triggers[0].position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Triggers[0].rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().TriggerUnpulled - ((Component)_hands.CurrentInteractable).GetComponent().TriggerPulled)); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().TriggerUnpulled - ((Component)_hands.CurrentInteractable).GetComponent().TriggerPulled)); } return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().Trigger_InterpStyle == 1) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3((0f - ((Component)_hands.CurrentInteractable).GetComponent().triggerFloat) * ((Component)_hands.CurrentInteractable).GetComponent().Trigger_Values.y, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3((0f - ((Component)_hands.CurrentInteractable).GetComponent().triggerFloat) * ((Component)_hands.CurrentInteractable).GetComponent().Trigger_Values.y, 0f, 0f); } return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().Trigger_InterpStyle == 0) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().Trigger_Values.x - ((Component)_hands.CurrentInteractable).GetComponent().Trigger_Values.y)); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().Trigger_Values.x - ((Component)_hands.CurrentInteractable).GetComponent().Trigger_Values.y)); } return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterpStyle == 1) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterpStyle == 0) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().Trigger_ForwardValue - ((Component)_hands.CurrentInteractable).GetComponent().Trigger_RearwardValue)); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().Trigger_ForwardValue - ((Component)_hands.CurrentInteractable).GetComponent().Trigger_RearwardValue)); } return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterpStyle == 1) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterpStyle == 0) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().Trigger_ForwardValue - ((Component)_hands.CurrentInteractable).GetComponent().Trigger_RearwardValue)); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().Trigger_ForwardValue - ((Component)_hands.CurrentInteractable).GetComponent().Trigger_RearwardValue)); } return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger_Display != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterpStyle == 1) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger_Display.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger_Display.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger_Display).gameObject.transform.localEulerAngles.x, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger_Display).gameObject.transform.localEulerAngles.x, 0f, 0f); } return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger_Display != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterpStyle == 0) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger_Display.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger_Display.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().Trigger_ForwardValue - ((Component)_hands.CurrentInteractable).GetComponent().Trigger_RearwardValue)); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().Trigger_ForwardValue - ((Component)_hands.CurrentInteractable).GetComponent().Trigger_RearwardValue)); } return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterp == 1) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null && (int)((Component)_hands.CurrentInteractable).GetComponent().TriggerInterp == 0) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().TriggerUnheld - ((Component)_hands.CurrentInteractable).GetComponent().TriggerHeld)); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localPosition = new Vector3(0f, 0f, 0.05f + ((Component)_hands.CurrentInteractable).GetComponent().m_triggerFloat * (((Component)_hands.CurrentInteractable).GetComponent().TriggerUnheld - ((Component)_hands.CurrentInteractable).GetComponent().TriggerHeld)); } return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null) { if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().Trigger != (Object)null) { _handPos.position = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).GetComponent().Trigger.rotation; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(-1f * ((Component)((Component)_hands.CurrentInteractable).GetComponent().Trigger).gameObject.transform.localEulerAngles.x, 0f, 0f); } return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride.position; _handPos.rotation = _gameObejctOnHands.PoseOverride.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } else { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride_Touch.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride_Touch.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride_Touch.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride_Touch.eulerAngles; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch == (Object)null) { HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); HDMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if (HandAnimControll(_otherHand) == 2 || HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } } } else { if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() == (Object)null)) { return; } if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && !_Grip) { _handPos.position = _gameObejctOnHands.PoseOverride_Touch.position; _handPos.rotation = _gameObejctOnHands.PoseOverride_Touch.rotation; } else if ((Object)(object)_gameObejctOnHands.PoseOverride_Touch != (Object)null && _Grip) { _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } else if (HandAnimControll(_otherHand) == 2) { if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent() != (Object)null)) { return; } if ((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip == (Object)null && (Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent()).PoseOverride != (Object)null) { if (verticle) { _handPos.position = ((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent()).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else if (!verticle) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } } if (!((Object)(object)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip != (Object)null)) { return; } if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment != (Object)null) { if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else if ((Object)(object)((FVRInteractiveObject)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).PoseOverride == (Object)null) { _handPos.position = ((Component)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } } else if ((Object)(object)((FVRFireArmAttachmentInterface)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).Attachment == (Object)null) { if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).PoseOverride != (Object)null) { _handPos.position = ((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).PoseOverride.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else if ((Object)(object)((FVRInteractiveObject)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).PoseOverride == (Object)null) { _handPos.position = ((Component)((Component)_hands.CurrentInteractable).GetComponent().LastGrabbedInGrip).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } } } else if (HandAnimControll(_otherHand) == 9) { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands.CurrentInteractable).gameObject.transform.rotation; } else { _handPos.position = ((Component)_hands.CurrentInteractable).gameObject.transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } } return; } if ((Object)(object)_otherHand.CurrentInteractable != (Object)null && (Object)(object)_hands.CurrentInteractable == (Object)null && DoubleHandMasturbating(_otherHand)) { if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if ((Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; } else { HDML.transform.position = _gameObejctOnHands.PoseOverride.position; HDMR.transform.position = _gameObejctOnHands.PoseOverride.position; HDML.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; HDMR.transform.eulerAngles = _gameObejctOnHands.PoseOverride.eulerAngles; DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } _fingerT._handGrap = true; return; } cleared = false; if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[0]) { CGL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); HDMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPL.transform.localPosition = new Vector3(0f, 0f, 0f); } else if ((Object)(object)_hands == (Object)(object)GM.CurrentMovementManager.Hands[1]) { CGR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDMR.transform.localPosition = new Vector3(0f, 0f, 0f); HDML.transform.localPosition = new Vector3(0f, 0f, 0f); HDMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HDML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DML.transform.localPosition = new Vector3(0f, 0f, 0f); DML.transform.localEulerAngles = new Vector3(0f, 0f, 0f); DMR.transform.localPosition = new Vector3(0f, 0f, 0f); DMR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localEulerAngles = new Vector3(0f, 0f, 0f); HPR.transform.localPosition = new Vector3(0f, 0f, 0f); } if ((Object)(object)gun != (Object)null) { if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride != (Object)null) { ((FVRInteractiveObject)gun).PoseOverride.localEulerAngles = gunAngle; } if ((Object)(object)((FVRInteractiveObject)gun).PoseOverride_Touch != (Object)null) { ((FVRInteractiveObject)gun).PoseOverride_Touch.localEulerAngles = gunAngle_Touch; } gunAngle = Vector3.zero; gunAngle_Touch = Vector3.zero; gun = null; } _gameObejctOnHands = null; if ((Object)(object)_handAnimator != (Object)null) { _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hands).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handTarget[0]; } else { _VRIKCon.solver.rightArm.target = _handTarget[0]; } } _fingerT._handGrap = false; _Grip = false; _handPos.position = ((Component)_hands).transform.position; _handPos.rotation = ((Component)_hands).transform.rotation; } private void HandsAnimationControll(Animator _handAnimator, Animator _otherHandAnim, Transform[] _handFollowPos, FVRViveHand _hand, FVRViveHand _otherHand) { //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_1249: Unknown result type (might be due to invalid IL or missing references) //IL_124e: Unknown result type (might be due to invalid IL or missing references) //IL_1277: Unknown result type (might be due to invalid IL or missing references) //IL_127c: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_12aa: Unknown result type (might be due to invalid IL or missing references) //IL_12af: Unknown result type (might be due to invalid IL or missing references) //IL_0f1c: Unknown result type (might be due to invalid IL or missing references) //IL_0f21: Unknown result type (might be due to invalid IL or missing references) //IL_0f4a: Unknown result type (might be due to invalid IL or missing references) //IL_0f4f: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_1309: Unknown result type (might be due to invalid IL or missing references) //IL_130e: Unknown result type (might be due to invalid IL or missing references) //IL_1337: Unknown result type (might be due to invalid IL or missing references) //IL_133c: Unknown result type (might be due to invalid IL or missing references) //IL_0f7d: Unknown result type (might be due to invalid IL or missing references) //IL_0f82: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_136a: Unknown result type (might be due to invalid IL or missing references) //IL_136f: Unknown result type (might be due to invalid IL or missing references) //IL_0fdc: Unknown result type (might be due to invalid IL or missing references) //IL_0fe1: Unknown result type (might be due to invalid IL or missing references) //IL_100a: Unknown result type (might be due to invalid IL or missing references) //IL_100f: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_103d: Unknown result type (might be due to invalid IL or missing references) //IL_1042: Unknown result type (might be due to invalid IL or missing references) switch (HandAnimControll(_otherHand)) { case 1: _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_mag, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[2]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[2]; } break; case 2: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grab, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y >= 0.075f) { _VRIKCon.solver.leftArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y < 0.075f) { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 1) { _VRIKCon.solver.leftArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 2) { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip != (Object)null) { _VRIKCon.solver.leftArm.target = _handFollowPos[11]; verticle = true; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y >= 0.075f) { _VRIKCon.solver.rightArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().size.y < 0.075f) { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 1) { _VRIKCon.solver.rightArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().direction == 2) { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).GetComponent().LastGrabbedInGrip != (Object)null) { _VRIKCon.solver.rightArm.target = _handFollowPos[11]; verticle = true; } break; case 3: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); if (curved) { _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_gunCurved, true); } else if (!curved) { _handAnimator.SetBool(_gun, true); _handAnimator.SetBool(_gunCurved, false); } _handAnimator.SetBool(_trigger, HandGunFier(_hand)); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[1]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[1]; } break; case 4: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_bolt, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[4]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[4]; } break; case 5: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_slide, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[5]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[5]; } break; case 6: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, true); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[2]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[2]; } break; case 7: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_grenade, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[7]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[7]; } break; case 8: _otherHandAnim.SetBool(_ammo, false); _handAnimator.SetBool(_trigger, HandGunFier(_hand)); _otherHandAnim.SetBool(_trigger, false); _otherHandAnim.SetBool(_grab, false); _otherHandAnim.SetBool(_gun, false); _otherHandAnim.SetBool(_slide, false); _otherHandAnim.SetBool(_bolt, false); _otherHandAnim.SetBool(_mag, false); _otherHandAnim.SetBool(_grenade, false); _otherHandAnim.SetBool(_HGCB, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.rightArm.target = _handFollowPos[8]; } else { _VRIKCon.solver.leftArm.target = _handFollowPos[8]; } break; case 9: _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_mag, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[9]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[9]; } break; case 10: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_grab, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y >= 0.075f) { _VRIKCon.solver.leftArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y < 0.075f) { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 1) { _VRIKCon.solver.leftArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 2) { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else { _VRIKCon.solver.leftArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip != (Object)null) { _VRIKCon.solver.leftArm.target = _handFollowPos[11]; verticle = true; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip == (Object)null) { if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y > ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z || ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y >= 0.075f) { _VRIKCon.solver.rightArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y <= ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.z && ((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().size.y < 0.075f) { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent() != (Object)null) { if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 1) { _VRIKCon.solver.rightArm.target = _handFollowPos[10]; verticle = true; } else if (((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().direction == 2) { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else { _VRIKCon.solver.rightArm.target = _handFollowPos[3]; verticle = false; } } else if ((Object)(object)((Component)_hand.CurrentInteractable).gameObject.GetComponent().Foregrip.gameObject.GetComponent().LastGrabbedInGrip != (Object)null) { _VRIKCon.solver.rightArm.target = _handFollowPos[11]; verticle = true; } break; case 11: _handAnimator.SetBool(_mag, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_HGCB, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); if (curved) { _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_gunCurved, true); } else if (!curved) { _handAnimator.SetBool(_gun, true); _handAnimator.SetBool(_gunCurved, false); } _handAnimator.SetBool(_trigger, HandGunFier(_hand)); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[12]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[12]; } break; default: _handAnimator.SetBool(_gun, false); _handAnimator.SetBool(_trigger, false); _handAnimator.SetBool(_grenade, false); _handAnimator.SetBool(_bolt, false); _handAnimator.SetBool(_grab, false); _handAnimator.SetBool(_slide, false); _handAnimator.SetBool(_ammo, false); _handAnimator.SetBool(_gun, true); _handAnimator.SetBool(_gunCurved, false); if ((Object)(object)_VRIKCon != (Object)null && ((Object)((Component)_hand).transform).name == ((Object)((Component)leftHand).transform).name) { _VRIKCon.solver.leftArm.target = _handFollowPos[1]; } else { _VRIKCon.solver.rightArm.target = _handFollowPos[1]; } break; } } private int HandAnimControll(FVRViveHand _otherHand) { int result = 1; if (typeof(FVRFireArm).IsAssignableFrom(((object)_gameObejctOnHands).GetType())) { if (((FVRPhysicalObject)((Component)_gameObejctOnHands).GetComponent()).IsAltHeld && (Object)(object)((Component)_gameObejctOnHands).GetComponent().Foregrip != (Object)null) { result = 10; } else if (!((FVRPhysicalObject)((Component)_gameObejctOnHands).GetComponent()).IsAltHeld || (Object)(object)((Component)_gameObejctOnHands).GetComponent().Foregrip == (Object)null) { result = ((!((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null) && !((Object)(object)((Component)_gameObejctOnHands).GetComponent() != (Object)null)) ? 3 : 11); } } if (typeof(FVRFireArm).IsAssignableFrom(((object)_gameObejctOnHands).GetType()) && DoubleHandMasturbating(_otherHand) && (Object)(object)_otherHand.CurrentInteractable == (Object)null) { result = 8; } if ((object)typeof(FVRFireArmMagazine) == ((object)_gameObejctOnHands).GetType()) { result = 1; } if ((object)typeof(ClosedBoltHandle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(ClosedBolt) == ((object)_gameObejctOnHands).GetType() || (object)typeof(BoltActionRifle_Handle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(OpenBoltChargingHandle) == ((object)_gameObejctOnHands).GetType() || (object)typeof(OpenBoltReceiverBolt) == ((object)_gameObejctOnHands).GetType()) { result = 4; } if ((object)typeof(FVRAlternateGrip) == ((object)_gameObejctOnHands).GetType() || (object)typeof(TubeFedShotgunHandle) == ((object)_gameObejctOnHands).GetType()) { result = 2; } if ((object)typeof(FVRFireArmRound) == ((object)_gameObejctOnHands).GetType()) { result = 6; } if ((object)typeof(HandgunSlide) == ((object)_gameObejctOnHands).GetType()) { result = 5; } if ((object)typeof(PinnedGrenade) == ((object)_gameObejctOnHands).GetType() || (object)typeof(FVRCappedGrenade) == ((object)_gameObejctOnHands).GetType()) { result = 7; } if ((object)typeof(FVRFireArmTopCover) == ((object)_gameObejctOnHands).GetType()) { result = 9; } return result; } private bool HandGunFier(FVRViveHand _hand) { if (_hand.Input.TriggerFloat >= 0.7f) { _fier = true; } else { _fier = false; } return _fier; } private bool DoubleHandMasturbating(FVRViveHand _otherHand) { if (HandsDistance() <= 0.15f && (Object)(object)_otherHand.CurrentInteractable == (Object)null && _otherHand.Input.TriggerDown && (Object)(object)_gameObejctOnHands != (Object)null && (Object)(object)((Component)_gameObejctOnHands).gameObject.GetComponent() != (Object)null) { _gripCut = !_gripCut; } if (HandsDistance() > 0.22f) { _gripCut = false; } return _gripCut; } private float HandsDistance() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return Vector3.Distance(GM.CurrentMovementManager.LeftHand.position, GM.CurrentMovementManager.RightHand.position); } private void PlayerAnimC() { playerAnime.SetFloat(AnimatorControllerName_X, leftHand.Input.Secondary2AxisInputAxes.x); playerAnime.SetFloat(AnimatorControllerName_Y, leftHand.Input.Secondary2AxisInputAxes.y); } public new void OnDestroy() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GameManager.OnPlayerBodyInit -= new OnPlayerBodyInitDelegate(OnPlayerBodyInit); } } } namespace JerryComponent { public class HandController : MonoBehaviour { public bool isIndex; public bool isLeftHand; public Finger[] fingers; [Header("状态")] [SerializeField] private bool isGripping = false; [SerializeField] private float gripProgress = 0f; [Header("抓握参数")] public float gripSpeed = 5f; public float gripAdaptFactor = 0.8f; public float minGripAngle = 10f; [Header("碰撞检测")] public LayerMask collisionLayers; private Collider[] collidersInHand; private void FixedUpdate() { if (isIndex) { if (isLeftHand) { if (GM.CurrentMovementManager.Hands[0].Input.TriggerFloat > 0.5f && !isGripping) { ((MonoBehaviour)this).StartCoroutine(GripHand()); } if (GM.CurrentMovementManager.Hands[0].Input.TriggerFloat <= 0.5f && isGripping) { ((MonoBehaviour)this).StartCoroutine(ReleaseHand()); } } if (!isLeftHand) { if (GM.CurrentMovementManager.Hands[1].Input.TriggerFloat > 0.5f && !isGripping) { ((MonoBehaviour)this).StartCoroutine(GripHand()); } if (GM.CurrentMovementManager.Hands[1].Input.TriggerFloat <= 0.5f && isGripping) { ((MonoBehaviour)this).StartCoroutine(ReleaseHand()); } } } if (isIndex) { return; } if (isLeftHand) { if (GM.CurrentMovementManager.Hands[0].Input.GripPressed && !isGripping) { ((MonoBehaviour)this).StartCoroutine(GripHand()); } if (!GM.CurrentMovementManager.Hands[0].Input.GripPressed && isGripping) { ((MonoBehaviour)this).StartCoroutine(ReleaseHand()); } } if (!isLeftHand) { if (GM.CurrentMovementManager.Hands[1].Input.GripPressed && !isGripping) { ((MonoBehaviour)this).StartCoroutine(GripHand()); } if (!GM.CurrentMovementManager.Hands[1].Input.GripPressed && isGripping) { ((MonoBehaviour)this).StartCoroutine(ReleaseHand()); } } } private IEnumerator GripHand() { isGripping = true; gripProgress = 0f; DetectObjectsInHand(); Finger[] array = fingers; foreach (Finger finger in array) { finger.StoreInitialAngles(); } while (gripProgress < 1f) { gripProgress += Time.deltaTime * gripSpeed; Finger[] array2 = fingers; foreach (Finger finger2 in array2) { finger2.UpdateGrip(gripProgress, gripAdaptFactor, minGripAngle); } yield return null; } } private IEnumerator ReleaseHand() { isGripping = false; float releaseProgress = 0f; while (releaseProgress < 1f) { releaseProgress += Time.deltaTime * gripSpeed; Finger[] array = fingers; foreach (Finger finger in array) { finger.UpdateRelease(releaseProgress); } yield return null; } collidersInHand = null; } private void DetectObjectsInHand() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 0.15f, LayerMask.op_Implicit(collisionLayers)); collidersInHand = (Collider[])(object)new Collider[array.Length]; for (int i = 0; i < array.Length; i++) { collidersInHand[i] = array[i]; } } public bool IsObjectInHand(Collider obj) { if (collidersInHand == null) { return false; } Collider[] array = collidersInHand; foreach (Collider val in array) { if ((Object)(object)val == (Object)(object)obj) { return true; } } return false; } private void OnDrawGizmosSelected() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.green; Gizmos.DrawWireSphere(((Component)this).transform.position, 0.15f); } } [Serializable] public class Finger { public string fingerName; public Transform[] joints; public float[] closedAngles; public float[] openAngles; [HideInInspector] public float[] initialAngles; public void StoreInitialAngles() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) initialAngles = new float[joints.Length]; for (int i = 0; i < joints.Length; i++) { initialAngles[i] = joints[i].localEulerAngles.x; } } public void UpdateGrip(float progress, float adaptFactor, float minAngle) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < joints.Length; i++) { float num = Mathf.Lerp(initialAngles[i], closedAngles[i], progress); joints[i].localEulerAngles = new Vector3(num, joints[i].localEulerAngles.y, joints[i].localEulerAngles.z); } } public void UpdateRelease(float progress) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < joints.Length; i++) { float num = Mathf.Lerp(closedAngles[i], openAngles[i], progress); joints[i].localEulerAngles = new Vector3(num, joints[i].localEulerAngles.y, joints[i].localEulerAngles.z); } } } } namespace Cityrobo { public class HeatDamageArea : MonoBehaviour { [Tooltip("Thermal Damage per frame. A Flipzo lighter does 50 damage every tick.")] public float ThermalDamage = 50f; public float BluntDam = 0f; public float EnergDamage = 0f; public void OnTriggerStay(Collider other) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) IFVRDamageable component = ((Component)other).GetComponent(); if (component == null && (Object)(object)other.attachedRigidbody != (Object)null) { component = ((Component)other.attachedRigidbody).GetComponent(); } if (component != null) { IFVRDamageable obj = component; Damage val = new Damage(); val.Class = (DamageClass)2; val.Dam_Thermal = ThermalDamage; val.Dam_Blunt = BluntDam; val.Dam_TotalEnergetic = EnergDamage; obj.Damage(val); } } } } namespace JerryComponent { public class HelmetSlot : MonoBehaviour { public List headGscale; public List headgears; public MeshRenderer earphone1; public MeshRenderer earphone2; private void Start() { } private void OnTriggerEnter(Collider other) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Invalid comparison between Unknown and I4 if ((Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && ((int)((Component)other).gameObject.GetComponent().QBSlotType == 1985 || (int)((Component)other).gameObject.GetComponent().QBSlotType == 1987)) { ((Component)other).gameObject.transform.localScale = new Vector3(1.25f, 1.25f, 1.25f); headgears.Add(((Component)other).gameObject); } } private void OnTriggerExit(Collider other) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (headgears.Contains(((Component)other).gameObject)) { ((Component)other).gameObject.transform.localScale = new Vector3(1f, 1f, 1f); headgears.Remove(((Component)other).gameObject); } } private void Update() { if (headgears.Count > 0 || GM.CurrentPlayerBody.HasHeadAttachment()) { ((Renderer)earphone1).enabled = false; ((Renderer)earphone2).enabled = false; } else if (headgears.Count <= 0 && !GM.CurrentPlayerBody.HasHeadAttachment()) { ((Renderer)earphone1).enabled = true; ((Renderer)earphone2).enabled = true; } } } public class HideQBslot : MonoBehaviour { public int prevslottype; private void Update() { if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { prevslottype = GM.Options.QuickbeltOptions.QuickbeltPreset; FVRQuickBeltSlot[] componentsInChildren = ((Component)GM.CurrentPlayerBody.Torso).gameObject.GetComponentsInChildren(); foreach (FVRQuickBeltSlot val in componentsInChildren) { Object.Destroy((Object)(object)val); } ((Component)GM.CurrentPlayerBody.Torso).gameObject.SetActive(false); } } private void OnDisable() { if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { FVRQuickBeltSlot[] componentsInChildren = ((Component)GM.CurrentPlayerBody.Torso).gameObject.GetComponentsInChildren(); foreach (FVRQuickBeltSlot val in componentsInChildren) { ((Component)val).gameObject.SetActive(true); ((Behaviour)val).enabled = true; } } } private void OnDestroy() { ((Component)GM.CurrentPlayerBody.Torso).gameObject.SetActive(true); GM.CurrentPlayerBody.ConfigureQuickbelt(prevslottype); } } public class IKMoving : MonoBehaviour { public Animator _MovementIK; public GameObject LR; public GameObject LR2; public float smooth = 0.28f; public float smooth2 = 0.3f; private void Start() { } private void Update() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) if (_MovementIK.GetBool("IsMoving")) { LR.transform.localPosition = new Vector3(0f, 0f, _MovementIK.GetFloat("D_Y") * smooth); LR2.transform.localPosition = new Vector3(_MovementIK.GetFloat("D_X") * smooth, 0f, 0f); LR2.transform.localScale = new Vector3(0.3f, 1f, 1f); } else if (!_MovementIK.GetBool("IsMoving")) { LR.transform.localPosition = new Vector3(0f, 0f, 0f); LR2.transform.localPosition = new Vector3(0f, 0f, 0f); LR2.transform.localScale = new Vector3(1f, 1f, 1f); } } } } namespace JerryLegsIK { public class Jump : MonoBehaviour { public Animator animatorjump; public FOOTIK footjump; public bool isJumppin; private void Start() { animatorjump = ((Component)this).GetComponent(); } private void Update() { if (!footjump.isOnGround) { animatorjump.SetBool("IsJumping", true); animatorjump.updateMode = (AnimatorUpdateMode)0; isJumppin = true; } if (footjump.isOnGround) { animatorjump.SetBool("IsJumping", false); animatorjump.updateMode = (AnimatorUpdateMode)1; isJumppin = false; } } } public class Kick : MonoBehaviour { public GameObject RotKick; public Animator _AnimateK; public Transform _KHandL; public Transform _KHandR; private Vector3 previousposL; private Vector3 previousposR; private Vector3 nextposL; private Vector3 nextposR; public float speedL; public float speedR; private float timer = 0f; private void Start() { } private void Update() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) previousposL = _KHandL.localPosition; previousposR = _KHandR.localPosition; speedL = Vector3.Magnitude(previousposL - nextposL) / Time.deltaTime; speedR = Vector3.Magnitude(previousposR - nextposR) / Time.deltaTime; nextposL = previousposL; nextposR = previousposR; timer += Time.deltaTime; if (timer >= 3f && RotKick.transform.localEulerAngles.x >= 45f && speedL >= 4f && speedR >= 4f) { _AnimateK.SetTrigger("Kick2"); timer = 0f; Debug.Log((object)"is kicking"); } } } } namespace JerryComponent { public class Kidnapcamera : MonoBehaviour { public Transform pos; public void Start() { if ((Object)(object)((Component)GM.CurrentMovementManager.Head).gameObject.GetComponent() != (Object)null) { PostProcessLayer val = ((Component)this).gameObject.AddComponent(); val = ((Component)GM.CurrentMovementManager.Head).gameObject.GetComponent(); val.volumeTrigger = ((Component)this).gameObject.transform; val.m_Camera = ((Component)this).gameObject.GetComponent(); } } } } namespace JerryLegsIK { public class LegSwitch : MonoBehaviour { public GameObject toeL; public GameObject toeR; public VRanimatorcontroller animatorcontroller; public GameObject crouch; public GameObject crouch2; public ManipulateObject maniCrouch; public GameObject track; public MecFootPlacer _MFP; public Animator animator; public FootPlacementData _FPD1; public FootPlacementData _FPD2; public IKFootSolver _IKFS1; public IKFootSolver _IKFS2; public Transform fp1; public Transform fp2; public FOOTIK _FTIK; public PlayerCrouch _PC; public PilotJumpKitOnBody _PJKOB; private void Start() { } private void Update() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) if (_PJKOB.slidingCast) { toeL.SetActive(false); toeR.SetActive(false); ((Behaviour)_PC).enabled = false; ((Behaviour)maniCrouch).enabled = false; crouch.transform.localEulerAngles = new Vector3(350f, 0f, 0f); track.transform.localPosition = new Vector3(0f, 30f, 0f); ((Behaviour)animatorcontroller).enabled = false; } if (animator.GetBool("IsWallrunningL")) { ((Behaviour)maniCrouch).enabled = false; crouch.transform.localEulerAngles = new Vector3(30f, 0f, 0f); crouch2.transform.localEulerAngles = new Vector3(0f, 20f, 0f); _FTIK.leftFootPosWeight = 0f; _FTIK.leftFootRotWeight = 0f; _FTIK.rightFootPosWeight = 0f; _FTIK.rightFootRotWeight = 0f; ((Behaviour)_PC).enabled = false; track.transform.localPosition = new Vector3(0f, 0f, -15f); } if (animator.GetBool("IsWallrunningR")) { ((Behaviour)maniCrouch).enabled = false; crouch.transform.localEulerAngles = new Vector3(30f, 0f, 0f); crouch2.transform.localEulerAngles = new Vector3(0f, 340f, 0f); _FTIK.leftFootPosWeight = 0f; _FTIK.leftFootRotWeight = 0f; _FTIK.rightFootPosWeight = 0f; _FTIK.rightFootRotWeight = 0f; ((Behaviour)_PC).enabled = false; track.transform.localPosition = new Vector3(0f, 0f, -15f); } if (!animator.GetBool("IsWallrunningL") && !animator.GetBool("IsWallrunningR") && !_PJKOB.slidingCast) { toeL.SetActive(true); toeR.SetActive(true); ((Behaviour)animatorcontroller).enabled = true; ((Behaviour)maniCrouch).enabled = true; _FTIK.leftFootPosWeight = 0.802f; _FTIK.leftFootRotWeight = 0.5f; _FTIK.rightFootPosWeight = 0.802f; _FTIK.rightFootRotWeight = 0.7f; ((Behaviour)_PC).enabled = true; crouch.transform.localEulerAngles = new Vector3(0f, 0f, 0f); crouch2.transform.localEulerAngles = new Vector3(0f, 0f, 0f); track.transform.localPosition = new Vector3(0f, 0f, 0f); } if (animator.GetFloat("D_X") >= 1.5f || animator.GetFloat("D_X") <= -1.5f || animator.GetFloat("D_Y") >= 1.5f || animator.GetFloat("D_Y") <= -1.5f) { ((Behaviour)_MFP).enabled = true; ((Behaviour)_FPD1).enabled = true; ((Behaviour)_FPD2).enabled = true; ((Behaviour)_IKFS1).enabled = false; ((Behaviour)_IKFS2).enabled = false; _IKFS1.currentPosition = fp1.position; _IKFS2.currentPosition = fp2.position; _IKFS1.oldPosition = fp1.position; _IKFS2.oldPosition = fp2.position; _IKFS1.newPosition = fp1.position; _IKFS2.newPosition = fp2.position; } if (animator.GetFloat("D_X") < 1.5f && animator.GetFloat("D_X") > -1.5f && animator.GetFloat("D_Y") < 1.5f && animator.GetFloat("D_Y") > -1.5f) { ((Behaviour)_MFP).enabled = false; ((Behaviour)_FPD1).enabled = false; ((Behaviour)_FPD2).enabled = false; ((Behaviour)_IKFS1).enabled = true; ((Behaviour)_IKFS2).enabled = true; } } } } namespace JerryComponent { public class LockToController : MonoBehaviour { public bool isLeft; [NonSerialized] public Transform snapTo; [NonSerialized] private Rigidbody body; [NonSerialized] public float snapTime = 0f; [NonSerialized] private float dropTimer; public void Start() { body = ((Component)this).GetComponent(); if (isLeft) { snapTo = ((Component)GM.CurrentMovementManager.LeftHand).transform; } else if (!isLeft) { snapTo = ((Component)GM.CurrentMovementManager.RightHand).transform; } } public void FixedUpdate() { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) dropTimer += Time.deltaTime / (snapTime / 2f); body.isKinematic = dropTimer > 1f; if (dropTimer > 1f) { ((Component)this).transform.position = snapTo.position; ((Component)this).transform.rotation = snapTo.rotation; return; } float num = Mathf.Pow(35f, dropTimer); body.velocity = Vector3.Lerp(body.velocity, Vector3.zero, Time.fixedDeltaTime * 4f); if (body.useGravity) { body.AddForce(-Physics.gravity); } ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, snapTo.position, Time.fixedDeltaTime * num * 3f); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, snapTo.rotation, Time.fixedDeltaTime * num * 2f); } } public class MouthSyncing : MonoBehaviour { private AudioClip micRecord; private string device; public SkinnedMeshRenderer smr; public int mopen; private string microphoneName; private float mouthClosedV = 0.0011f; private float smileFrownV = 0.0701f; private float partialOpenV = 0.0201f; private float normalOpenv = 0.0301f; private int pitchSwap = 1; private float lastActiveTime; private float lastChosenMouth; private float talkDuration = 0.05f; private float silenceDuration = 0.25f; private void Awake() { lastChosenMouth = Time.deltaTime; InitializeMicrophone(); } private void Start() { } private void InitializeMicrophone() { string[] devices = Microphone.devices; foreach (string text in devices) { Debug.Log((object)("Microphone detected: " + text)); } if (Microphone.devices.Length != 0) { microphoneName = Microphone.devices[0]; micRecord = Microphone.Start(microphoneName, true, 1, 44100); } else { Debug.Log((object)"No microphones detected at all!"); } } private void Update() { if ((Object)(object)smr == (Object)null) { return; } if (Microphone.IsRecording(microphoneName)) { float[] array = new float[16]; micRecord.GetData(array, Microphone.GetPosition(microphoneName)); float num = 0f; int num2 = 0; for (int i = 1; i < array.Length; i++) { num += Mathf.Abs(array[i]); if (array[i - 1] < 0f && array[i] > 0f) { num2++; } } num /= (float)array.Length; float num3 = num2; if (num < mouthClosedV) { smr.SetBlendShapeWeight(mopen, 0f); } else if (num < partialOpenV) { smr.SetBlendShapeWeight(mopen, 20f); } else if (num < normalOpenv) { smr.SetBlendShapeWeight(mopen, 40f); } else { smr.SetBlendShapeWeight(mopen, 60f); } lastActiveTime = Time.time; if (Time.time - lastChosenMouth > talkDuration) { lastChosenMouth = Time.time; } } if (Time.time - lastActiveTime > silenceDuration) { smr.SetBlendShapeWeight(mopen, 0f); } } } public class MouthSyncingPro : MonoBehaviour { public UltimateVoiceChanger UVC; public SkinnedMeshRenderer smr; [Header("Blend Shape 索引")] public int m_A = 0; public int m_E = 1; public int m_O = 2; [Header("音频分析设置")] [Tooltip("分析窗口大小(样本数)")] public int sampleWindow = 512; [Tooltip("更新频率(Hz)")] public float updateFrequency = 30f; [Header("灵敏度设置")] [Range(0.0001f, 0.1f)] public float mouthClosedThreshold = 0.0011f; [Range(0.01f, 0.2f)] public float smileFrownThreshold = 0.0701f; [Range(0.01f, 0.1f)] public float partialOpenThreshold = 0.0201f; [Range(0.02f, 0.15f)] public float normalOpenThreshold = 0.0301f; [Header("平滑设置")] [Range(1f, 20f)] public float smoothingSpeed = 8f; [Tooltip("静音持续时间(秒)后关闭嘴型")] public float silenceDuration = 0.15f; [Header("音频特征检测")] [Range(1f, 10f)] public int pitchSwapThreshold = 3; private float currentA; private float targetA; private float currentE; private float targetE; private float currentO; private float targetO; private float[] audioBuffer; private int bufferWriteIndex = 0; private const int BUFFER_SIZE = 2048; private float lastUpdateTime; private float lastActiveTime; private bool isSmiling = false; private void Start() { audioBuffer = new float[2048]; currentA = (targetA = 0f); currentE = (targetE = 0f); currentO = (targetO = 0f); lastUpdateTime = Time.time; lastActiveTime = Time.time; } private void Update() { if (!((Object)(object)smr == (Object)null) && !((Object)(object)UVC == (Object)null) && !((Object)(object)UVC.processedClip == (Object)null) && UVC.isOn) { float num = Time.time - lastUpdateTime; float num2 = 1f / updateFrequency; if (num >= num2) { lastUpdateTime = Time.time; AnalyzeAudio(); UpdateTargetWeights(); } SmoothWeights(); ApplyWeights(); if (Time.time - lastActiveTime > silenceDuration) { targetA = (targetE = (targetO = 0f)); } } } private void AnalyzeAudio() { if (!UVC.isOn || (Object)(object)UVC.microphoneClip == (Object)null) { return; } int position = Microphone.GetPosition(UVC.selectedDevice); if (position < 0) { return; } int num = Mathf.Min(sampleWindow, UVC.microphoneClip.samples); float[] array = new float[num]; int num2 = position - num; if (num2 < 0) { num2 += UVC.microphoneClip.samples; } UVC.microphoneClip.GetData(array, num2); float num3 = CalculateLoudness(array); float num4 = CalculateZeroCrossingRate(array); UpdateAudioBuffer(array); float num5 = CalculateAverageLoudness(); if (num5 < mouthClosedThreshold) { targetA = (targetE = (targetO = 0f)); return; } if (num5 < smileFrownThreshold) { isSmiling = num4 > (float)pitchSwapThreshold; } DetermineMouthShape(num5); lastActiveTime = Time.time; } private void DetermineMouthShape(float loudness) { if (isSmiling) { targetE = 0f; if (loudness < partialOpenThreshold) { targetO = 25f; targetA = 0f; } else if (loudness < normalOpenThreshold) { targetO = 25f; targetA = 25f; } else { targetA = 75f; targetO = 0f; } } else { targetA = 0f; targetO = 0f; if (loudness < partialOpenThreshold) { targetE = 20f; } else if (loudness < normalOpenThreshold) { targetE = 40f; } else { targetE = 60f; } } } private void UpdateTargetWeights() { } private void SmoothWeights() { float num = Time.deltaTime * smoothingSpeed; currentA = Mathf.Lerp(currentA, targetA, num); currentE = Mathf.Lerp(currentE, targetE, num); currentO = Mathf.Lerp(currentO, targetO, num); currentA = Mathf.Clamp(currentA, 0f, 100f); currentE = Mathf.Clamp(currentE, 0f, 100f); currentO = Mathf.Clamp(currentO, 0f, 100f); } private void ApplyWeights() { smr.SetBlendShapeWeight(m_A, currentA); smr.SetBlendShapeWeight(m_E, currentE); smr.SetBlendShapeWeight(m_O, currentO); } private void UpdateAudioBuffer(float[] newSamples) { foreach (float num in newSamples) { audioBuffer[bufferWriteIndex] = Mathf.Abs(num); bufferWriteIndex = (bufferWriteIndex + 1) % 2048; } } private float CalculateAverageLoudness() { float num = 0f; int num2 = 0; for (int i = 0; i < 2048; i++) { if (audioBuffer[i] > 0f) { num += audioBuffer[i]; num2++; } } return (num2 <= 0) ? 0f : (num / (float)num2); } private float CalculateLoudness(float[] samples) { float num = 0f; foreach (float num2 in samples) { num += Mathf.Abs(num2); } return num / (float)samples.Length; } private float CalculateZeroCrossingRate(float[] samples) { int num = 0; for (int i = 1; i < samples.Length; i++) { if (samples[i - 1] * samples[i] < 0f) { num++; } } return num; } } } namespace JerryLegsIK { public class NeckMoveWithTarg : MonoBehaviour { public GameObject targ; public GameObject neck; private void Update() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) neck.transform.position = targ.transform.position; } } } namespace JerryComponent { public class NeckRot : MonoBehaviour { public GameObject Geo; public WaggleJoint WJ; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) if (Geo.transform.localEulerAngles.x < 10f || Geo.transform.localEulerAngles.x > 350f) { WJ.springApproachRate = 0.05f; } else if ((Geo.transform.localEulerAngles.x > 10f && Geo.transform.localEulerAngles.x < 15f) || (Geo.transform.localEulerAngles.x < 350f && Geo.transform.localEulerAngles.x > 345f)) { WJ.springApproachRate = 0.5f; } else if ((Geo.transform.localEulerAngles.x > 15f && Geo.transform.localEulerAngles.x < 180f) || (Geo.transform.localEulerAngles.x < 345f && Geo.transform.localEulerAngles.x > 180f)) { WJ.springApproachRate = 0.99f; } } } public class OffestFollowerSingle : MonoBehaviour { public Transform transformToFollow; public Vector3 offset; public Vector3 rotationAxes; public void Update() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = transformToFollow.position; Transform transform = ((Component)this).transform; transform.localPosition += offset; Quaternion rotation = transformToFollow.rotation; float num = ((Quaternion)(ref rotation)).eulerAngles.x * rotationAxes.x; Quaternion rotation2 = transformToFollow.rotation; float num2 = ((Quaternion)(ref rotation2)).eulerAngles.y * rotationAxes.y; Quaternion rotation3 = transformToFollow.rotation; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(num, num2, ((Quaternion)(ref rotation3)).eulerAngles.z * rotationAxes.z); ((Component)this).transform.rotation = Quaternion.Euler(val); } } public class OffsetFollowerSG : MonoBehaviour { public Transform transformToFollowP; public Transform transformToFollowR; public Vector3 offset; public void Update() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = transformToFollowP.position; Transform transform = ((Component)this).transform; transform.localPosition += offset; AxisLookAt(((Component)this).transform, ((Component)transformToFollowR).transform.position, Vector3.up); } private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, 0f, tr_self.localEulerAngles.z); } } } namespace Cityrobo { public class Ontriggerenterdamage : MonoBehaviour { [Tooltip("Thermal Damage per frame. A Flipzo lighter does 50 damage every tick.")] public float ThermalDamage = 50f; public float BluntDam = 0f; public float EnergDamage = 0f; private void Start() { } public void OnTriggerEnter(Collider other) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) IFVRDamageable component = ((Component)other).GetComponent(); if (component == null && (Object)(object)other.attachedRigidbody != (Object)null) { component = ((Component)other.attachedRigidbody).GetComponent(); } if (component != null) { IFVRDamageable obj = component; Damage val = new Damage(); val.Class = (DamageClass)2; val.Dam_Thermal = ThermalDamage; val.Dam_Blunt = BluntDam; val.Dam_TotalEnergetic = EnergDamage; val.point = ((Component)other).transform.TransformPoint(other.attachedRigidbody.centerOfMass); Vector3 val2 = ((Component)other).transform.TransformPoint(other.attachedRigidbody.centerOfMass) - ((Component)this).transform.position; val.hitNormal = ((Vector3)(ref val2)).normalized; Vector3 val3 = ((Component)this).transform.position - ((Component)other).transform.TransformPoint(other.attachedRigidbody.centerOfMass); val.strikeDir = ((Vector3)(ref val3)).normalized; obj.Damage(val); } FVRIgnitable component2 = ((Component)other).GetComponent(); if ((Object)(object)component2 == (Object)null && (Object)(object)other.attachedRigidbody != (Object)null) { ((Component)other.attachedRigidbody).GetComponent(); } if ((Object)(object)component2 != (Object)null) { FXM.Ignite(component2, ThermalDamage / 500f); } } private void Update() { } } } namespace JerryComponent { public class PlayerBodyTrackerSupport : MonoBehaviour { public SteamVR_TrackedObject head; public SteamVR_TrackedObject hip; public SteamVR_TrackedObject handl; public SteamVR_TrackedObject handr; public SteamVR_TrackedObject footl; public SteamVR_TrackedObject footr; public SteamVR_TrackedObject elbell; public SteamVR_TrackedObject elbelr; public SteamVR_TrackedObject kneel; public SteamVR_TrackedObject kneer; public RecenterToPlaySpace RTP; public GameObject GO1; public GameObject GO2; public GameObject GO3; public GameObject GO4; public GameObject GO5; public GameObject GO6; public GameObject GO7; public GameObject GO8; public GameObject GO9; public GameObject GO10; public GameObject Root; public GameObject Main; private void Awake() { Root.transform.SetParent((Transform)null); GO1.transform.SetParent((Transform)null); GO2.transform.SetParent((Transform)null); GO3.transform.SetParent((Transform)null); GO4.transform.SetParent((Transform)null); GO5.transform.SetParent((Transform)null); GO6.transform.SetParent((Transform)null); GO7.transform.SetParent((Transform)null); GO8.transform.SetParent((Transform)null); GO9.transform.SetParent((Transform)null); GO10.transform.SetParent((Transform)null); } private void Update() { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GO1 == (Object)null || (Object)(object)GO2 == (Object)null || (Object)(object)GO3 == (Object)null || (Object)(object)GO4 == (Object)null || (Object)(object)GO5 == (Object)null || (Object)(object)GO6 == (Object)null || (Object)(object)GO7 == (Object)null || (Object)(object)GO8 == (Object)null || (Object)(object)GO9 == (Object)null || (Object)(object)GO10 == (Object)null) { Object.Destroy((Object)(object)Main); } if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { if (Vector3.Distance(((Component)this).gameObject.transform.position, GM.CurrentPlayerBody.Head.position) < 0.1f) { ((Behaviour)head).enabled = true; ((Behaviour)hip).enabled = true; ((Behaviour)handl).enabled = true; ((Behaviour)handr).enabled = true; ((Behaviour)footl).enabled = true; ((Behaviour)footr).enabled = true; ((Behaviour)elbell).enabled = true; ((Behaviour)elbelr).enabled = true; ((Behaviour)kneel).enabled = true; ((Behaviour)kneer).enabled = true; ((Behaviour)RTP).enabled = true; } else if (Vector3.Distance(((Component)this).gameObject.transform.position, GM.CurrentPlayerBody.Head.position) >= 0.1f) { ((Behaviour)head).enabled = false; ((Behaviour)hip).enabled = false; ((Behaviour)handl).enabled = false; ((Behaviour)handr).enabled = false; ((Behaviour)footl).enabled = false; ((Behaviour)footr).enabled = false; ((Behaviour)elbell).enabled = false; ((Behaviour)elbelr).enabled = false; ((Behaviour)kneel).enabled = false; ((Behaviour)kneer).enabled = false; ((Behaviour)RTP).enabled = false; } } } private void OnDestroy() { Object.Destroy((Object)(object)GO1); Object.Destroy((Object)(object)GO2); Object.Destroy((Object)(object)GO3); Object.Destroy((Object)(object)GO4); Object.Destroy((Object)(object)GO5); Object.Destroy((Object)(object)GO6); Object.Destroy((Object)(object)GO7); Object.Destroy((Object)(object)GO8); Object.Destroy((Object)(object)GO9); Object.Destroy((Object)(object)GO10); Object.Destroy((Object)(object)Root); } } public class PlayerBodyTrackerSupport1 : MonoBehaviour { public SteamVR_TrackedObject head; public SteamVR_TrackedObject hip; public SteamVR_TrackedObject handl; public SteamVR_TrackedObject handr; public SteamVR_TrackedObject footl; public SteamVR_TrackedObject footr; public SteamVR_TrackedObject elbell; public SteamVR_TrackedObject elbelr; public SteamVR_TrackedObject kneel; public SteamVR_TrackedObject kneer; public RecenterToPlaySpace RTP; public FVRObject item1; public FVRObject item2; public FVRObject item3; public FVRObject item4; public FVRObject item5; public FVRObject item6; public FVRObject item7; public FVRObject item8; public FVRObject item9; public FVRObject item10; public GameObject GO1; public GameObject GO2; public GameObject GO3; public GameObject GO4; public GameObject GO5; public GameObject GO6; public GameObject GO7; public GameObject GO8; public GameObject GO9; public GameObject GO10; public Transform tr1; public Transform tr2; public Transform tr3; public Transform tr4; public Transform tr5; public Transform tr6; public Transform tr7; public Transform tr8; public Transform tr9; public Transform tr10; public GameObject Main; public VRIK ik; public GameObject root; public bool readytospawn = false; public bool readytocheck = false; public float cd = 2f; public GameObject headref; private void Update() { //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07c4: Unknown result type (might be due to invalid IL or missing references) //IL_07ea: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_08a3: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06b2: Unknown result type (might be due to invalid IL or missing references) if (!readytospawn && cd > 1f) { cd -= Time.deltaTime; } else if (cd > 0f && cd <= 1f) { cd -= Time.deltaTime; readytospawn = true; } else if (cd <= 0f) { readytocheck = true; cd = 0f; } if (readytospawn && !readytocheck) { if ((Object)(object)Main.GetComponent() == (Object)null) { if ((Object)(object)GO1 == (Object)null) { GO1 = Object.Instantiate(((AnvilAsset)item1).GetGameObject(), ((Component)tr1).transform.position, ((Component)tr1).transform.rotation); head = GO1.GetComponent(); head.origin = root.transform; GO1.transform.SetParent(tr1); } if ((Object)(object)GO2 == (Object)null) { GO2 = Object.Instantiate(((AnvilAsset)item2).GetGameObject(), ((Component)tr2).transform.position, ((Component)tr2).transform.rotation); hip = GO2.GetComponent(); hip.origin = root.transform; GO2.transform.SetParent(tr2); ik.solver.spine.pelvisTarget = getChildGameObject(GO2, "HIPTarg").transform; } if ((Object)(object)GO3 == (Object)null) { GO3 = Object.Instantiate(((AnvilAsset)item3).GetGameObject(), ((Component)tr3).transform.position, ((Component)tr3).transform.rotation); handl = GO3.GetComponent(); handl.origin = root.transform; GO3.transform.SetParent(tr3); } if ((Object)(object)GO4 == (Object)null) { GO4 = Object.Instantiate(((AnvilAsset)item4).GetGameObject(), ((Component)tr4).transform.position, ((Component)tr4).transform.rotation); handr = GO4.GetComponent(); handr.origin = root.transform; GO4.transform.SetParent(tr4); } if ((Object)(object)GO5 == (Object)null) { GO5 = Object.Instantiate(((AnvilAsset)item5).GetGameObject(), ((Component)tr5).transform.position, ((Component)tr5).transform.rotation); footl = GO5.GetComponent(); footl.origin = root.transform; GO5.transform.SetParent(tr5); ik.solver.leftLeg.target = getChildGameObject(GO5, "ToeTargL").transform; } if ((Object)(object)GO6 == (Object)null) { GO6 = Object.Instantiate(((AnvilAsset)item6).GetGameObject(), ((Component)tr6).transform.position, ((Component)tr6).transform.rotation); footr = GO6.GetComponent(); footr.origin = root.transform; GO6.transform.SetParent(tr6); ik.solver.rightLeg.target = getChildGameObject(GO6, "ToeTargR").transform; } if ((Object)(object)GO7 == (Object)null) { GO7 = Object.Instantiate(((AnvilAsset)item7).GetGameObject(), ((Component)tr7).transform.position, ((Component)tr7).transform.rotation); elbell = GO7.GetComponent(); elbell.origin = root.transform; GO7.transform.SetParent(tr7); ik.solver.leftArm.bendGoal = getChildGameObject(GO7, "ForeArmL").transform; } if ((Object)(object)GO8 == (Object)null) { GO8 = Object.Instantiate(((AnvilAsset)item8).GetGameObject(), ((Component)tr8).transform.position, ((Component)tr8).transform.rotation); elbelr = GO8.GetComponent(); elbelr.origin = root.transform; GO8.transform.SetParent(tr8); ik.solver.rightArm.bendGoal = getChildGameObject(GO8, "ForeArmR").transform; } if ((Object)(object)GO9 == (Object)null) { GO9 = Object.Instantiate(((AnvilAsset)item9).GetGameObject(), ((Component)tr9).transform.position, ((Component)tr9).transform.rotation); kneel = GO9.GetComponent(); kneel.origin = root.transform; GO9.transform.SetParent(tr9); ik.solver.leftLeg.bendGoal = getChildGameObject(GO9, "KneeL").transform; } if ((Object)(object)GO10 == (Object)null) { GO10 = Object.Instantiate(((AnvilAsset)item10).GetGameObject(), ((Component)tr10).transform.position, ((Component)tr10).transform.rotation); kneer = GO10.GetComponent(); kneer.origin = root.transform; GO10.transform.SetParent(tr10); ik.solver.rightLeg.bendGoal = getChildGameObject(GO10, "KneeR").transform; } } else if ((Object)(object)Main.GetComponent() != (Object)null) { Object.Destroy((Object)(object)Main); } } if ((Object)(object)Main.GetComponent() != (Object)null) { Object.Destroy((Object)(object)Main); } if (!readytocheck) { return; } ((Behaviour)ik).enabled = true; headref.transform.position = GO1.transform.position; headref.transform.eulerAngles = GO1.transform.eulerAngles; if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { if (Vector3.Distance(((Component)this).gameObject.transform.position, GM.CurrentPlayerBody.Head.position) < 0.1f) { ((Behaviour)head).enabled = true; ((Behaviour)hip).enabled = true; ((Behaviour)handl).enabled = true; ((Behaviour)handr).enabled = true; ((Behaviour)footl).enabled = true; ((Behaviour)footr).enabled = true; ((Behaviour)elbell).enabled = true; ((Behaviour)elbelr).enabled = true; ((Behaviour)kneel).enabled = true; ((Behaviour)kneer).enabled = true; ((Behaviour)RTP).enabled = true; } else if (Vector3.Distance(((Component)this).gameObject.transform.position, GM.CurrentPlayerBody.Head.position) >= 0.1f) { ((Behaviour)head).enabled = false; ((Behaviour)hip).enabled = false; ((Behaviour)handl).enabled = false; ((Behaviour)handr).enabled = false; ((Behaviour)footl).enabled = false; ((Behaviour)footr).enabled = false; ((Behaviour)elbell).enabled = false; ((Behaviour)elbelr).enabled = false; ((Behaviour)kneel).enabled = false; ((Behaviour)kneer).enabled = false; ((Behaviour)RTP).enabled = false; } } } private void OnDestroy() { Object.Destroy((Object)(object)GO1); Object.Destroy((Object)(object)GO2); Object.Destroy((Object)(object)GO3); Object.Destroy((Object)(object)GO4); Object.Destroy((Object)(object)GO5); Object.Destroy((Object)(object)GO6); Object.Destroy((Object)(object)GO7); Object.Destroy((Object)(object)GO8); Object.Destroy((Object)(object)GO9); Object.Destroy((Object)(object)GO10); } public static GameObject getChildGameObject(GameObject fromGameObject, string withName) { Transform[] componentsInChildren = ((Component)fromGameObject.transform).GetComponentsInChildren(); Transform[] array = componentsInChildren; foreach (Transform val in array) { if (((Object)((Component)val).gameObject).name == withName) { return ((Component)val).gameObject; } } return null; } } public class PlayerBodyTrackerSupport2 : MonoBehaviour { public SteamVR_TrackedObject head; public SteamVR_TrackedObject hip; public SteamVR_TrackedObject handl; public SteamVR_TrackedObject handr; public SteamVR_TrackedObject footl; public SteamVR_TrackedObject footr; public SteamVR_TrackedObject elbell; public SteamVR_TrackedObject elbelr; public SteamVR_TrackedObject kneel; public SteamVR_TrackedObject kneer; public FVRObject item1; public FVRObject item2; public FVRObject item3; public FVRObject item4; public FVRObject item5; public FVRObject item6; public FVRObject item7; public FVRObject item8; public FVRObject item9; public FVRObject item10; public GameObject GO1; public GameObject GO2; public GameObject GO3; public GameObject GO4; public GameObject GO5; public GameObject GO6; public GameObject GO7; public GameObject GO8; public GameObject GO9; public GameObject GO10; public Transform tr1; public Transform tr2; public Transform tr3; public Transform tr4; public Transform tr5; public Transform tr6; public Transform tr7; public Transform tr8; public Transform tr9; public Transform tr10; public GameObject Main; public VRIK ik; public GameObject root; public GameObject headref; private void Update() { //IL_10a7: Unknown result type (might be due to invalid IL or missing references) //IL_10c7: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0775: Unknown result type (might be due to invalid IL or missing references) //IL_0785: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_07e5: Unknown result type (might be due to invalid IL or missing references) //IL_07f5: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_087f: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0919: Unknown result type (might be due to invalid IL or missing references) //IL_0929: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_09b3: Unknown result type (might be due to invalid IL or missing references) //IL_09c3: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0a4d: Unknown result type (might be due to invalid IL or missing references) //IL_0a5d: Unknown result type (might be due to invalid IL or missing references) //IL_0ae7: Unknown result type (might be due to invalid IL or missing references) //IL_0af7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Main.GetComponent() == (Object)null) { if ((Object)(object)GO1 == (Object)null) { GO1 = Object.Instantiate(((AnvilAsset)item1).GetGameObject(), ((Component)tr1).transform.position, ((Component)tr1).transform.rotation); head = GO1.GetComponent(); head.origin = root.transform; } if ((Object)(object)GO2 == (Object)null) { GO2 = Object.Instantiate(((AnvilAsset)item2).GetGameObject(), ((Component)tr2).transform.position, ((Component)tr2).transform.rotation); hip = GO2.GetComponent(); hip.origin = root.transform; ik.solver.spine.pelvisTarget = getChildGameObject(GO2, "HIPTarg").transform; } if ((Object)(object)GO3 == (Object)null) { GO3 = Object.Instantiate(((AnvilAsset)item3).GetGameObject(), ((Component)tr3).transform.position, ((Component)tr3).transform.rotation); handl = GO3.GetComponent(); handl.origin = root.transform; } if ((Object)(object)GO4 == (Object)null) { GO4 = Object.Instantiate(((AnvilAsset)item4).GetGameObject(), ((Component)tr4).transform.position, ((Component)tr4).transform.rotation); handr = GO4.GetComponent(); handr.origin = root.transform; } if ((Object)(object)GO5 == (Object)null) { GO5 = Object.Instantiate(((AnvilAsset)item5).GetGameObject(), ((Component)tr5).transform.position, ((Component)tr5).transform.rotation); footl = GO5.GetComponent(); footl.origin = root.transform; ik.solver.leftLeg.target = getChildGameObject(GO5, "ToeTargL").transform; } if ((Object)(object)GO6 == (Object)null) { GO6 = Object.Instantiate(((AnvilAsset)item6).GetGameObject(), ((Component)tr6).transform.position, ((Component)tr6).transform.rotation); footr = GO6.GetComponent(); footr.origin = root.transform; ik.solver.rightLeg.target = getChildGameObject(GO6, "ToeTargR").transform; } if ((Object)(object)GO7 == (Object)null) { GO7 = Object.Instantiate(((AnvilAsset)item7).GetGameObject(), ((Component)tr7).transform.position, ((Component)tr7).transform.rotation); elbell = GO7.GetComponent(); elbell.origin = root.transform; ik.solver.leftArm.bendGoal = getChildGameObject(GO7, "ForeArmL").transform; } if ((Object)(object)GO8 == (Object)null) { GO8 = Object.Instantiate(((AnvilAsset)item8).GetGameObject(), ((Component)tr8).transform.position, ((Component)tr8).transform.rotation); elbelr = GO8.GetComponent(); elbelr.origin = root.transform; ik.solver.rightArm.bendGoal = getChildGameObject(GO8, "ForeArmR").transform; } if ((Object)(object)GO9 == (Object)null) { GO9 = Object.Instantiate(((AnvilAsset)item9).GetGameObject(), ((Component)tr9).transform.position, ((Component)tr9).transform.rotation); kneel = GO9.GetComponent(); kneel.origin = root.transform; ik.solver.leftLeg.bendGoal = getChildGameObject(GO9, "KneeL").transform; } if ((Object)(object)GO10 == (Object)null) { GO10 = Object.Instantiate(((AnvilAsset)item10).GetGameObject(), ((Component)tr10).transform.position, ((Component)tr10).transform.rotation); kneer = GO10.GetComponent(); kneer.origin = root.transform; ik.solver.rightLeg.bendGoal = getChildGameObject(GO10, "KneeR").transform; } } else if ((Object)(object)Main.GetComponent() != (Object)null) { if ((Object)(object)Main.GetComponent() == (Object)null) { if ((Object)(object)GO1 == (Object)null) { GO1 = Object.Instantiate(((AnvilAsset)item1).GetGameObject(), ((Component)tr1).transform.position, ((Component)tr1).transform.rotation); head = GO1.GetComponent(); head.origin = root.transform; } if ((Object)(object)GO2 == (Object)null) { GO2 = Object.Instantiate(((AnvilAsset)item2).GetGameObject(), ((Component)tr2).transform.position, ((Component)tr2).transform.rotation); hip = GO2.GetComponent(); hip.origin = root.transform; ik.solver.spine.pelvisTarget = getChildGameObject(GO2, "HIPTarg").transform; } if ((Object)(object)GO3 == (Object)null) { GO3 = Object.Instantiate(((AnvilAsset)item3).GetGameObject(), ((Component)tr3).transform.position, ((Component)tr3).transform.rotation); handl = GO3.GetComponent(); handl.origin = root.transform; } if ((Object)(object)GO4 == (Object)null) { GO4 = Object.Instantiate(((AnvilAsset)item4).GetGameObject(), ((Component)tr4).transform.position, ((Component)tr4).transform.rotation); handr = GO4.GetComponent(); handr.origin = root.transform; } if ((Object)(object)GO5 == (Object)null) { GO5 = Object.Instantiate(((AnvilAsset)item5).GetGameObject(), ((Component)tr5).transform.position, ((Component)tr5).transform.rotation); footl = GO5.GetComponent(); footl.origin = root.transform; ik.solver.leftLeg.target = getChildGameObject(GO5, "ToeTargL").transform; } if ((Object)(object)GO6 == (Object)null) { GO6 = Object.Instantiate(((AnvilAsset)item6).GetGameObject(), ((Component)tr6).transform.position, ((Component)tr6).transform.rotation); footr = GO6.GetComponent(); footr.origin = root.transform; ik.solver.rightLeg.target = getChildGameObject(GO6, "ToeTargR").transform; } if ((Object)(object)GO7 == (Object)null) { GO7 = Object.Instantiate(((AnvilAsset)item7).GetGameObject(), ((Component)tr7).transform.position, ((Component)tr7).transform.rotation); elbell = GO7.GetComponent(); elbell.origin = root.transform; ik.solver.leftArm.bendGoal = getChildGameObject(GO7, "ForeArmL").transform; } if ((Object)(object)GO8 == (Object)null) { GO8 = Object.Instantiate(((AnvilAsset)item8).GetGameObject(), ((Component)tr8).transform.position, ((Component)tr8).transform.rotation); elbelr = GO8.GetComponent(); elbelr.origin = root.transform; ik.solver.rightArm.bendGoal = getChildGameObject(GO8, "ForeArmR").transform; } if ((Object)(object)GO9 == (Object)null) { GO9 = Object.Instantiate(((AnvilAsset)item9).GetGameObject(), ((Component)tr9).transform.position, ((Component)tr9).transform.rotation); kneel = GO9.GetComponent(); kneel.origin = root.transform; ik.solver.leftLeg.bendGoal = getChildGameObject(GO9, "KneeL").transform; } if ((Object)(object)GO10 == (Object)null) { GO10 = Object.Instantiate(((AnvilAsset)item10).GetGameObject(), ((Component)tr10).transform.position, ((Component)tr10).transform.rotation); kneer = GO10.GetComponent(); kneer.origin = root.transform; ik.solver.rightLeg.bendGoal = getChildGameObject(GO10, "KneeR").transform; } } else if ((Object)(object)Main.GetComponent() != (Object)null) { if ((Object)(object)getChildGameObject(((Component)tr1).gameObject, "HEAD(Clone)") != (Object)null) { GO1 = getChildGameObject(((Component)tr1).gameObject, "HEAD(Clone)"); head = GO1.GetComponent(); head.origin = root.transform; } if ((Object)(object)getChildGameObject(((Component)tr2).gameObject, "HIP(Clone)") != (Object)null) { GO2 = getChildGameObject(((Component)tr2).gameObject, "HIP(Clone)"); hip = GO2.GetComponent(); hip.origin = root.transform; ik.solver.spine.pelvisTarget = getChildGameObject(GO2, "HIPTarg").transform; } if ((Object)(object)getChildGameObject(((Component)tr3).gameObject, "HANDL(Clone)") != (Object)null) { GO3 = getChildGameObject(((Component)tr3).gameObject, "HANDL(Clone)"); handl = GO3.GetComponent(); handl.origin = root.transform; } if ((Object)(object)getChildGameObject(((Component)tr4).gameObject, "HANDR(Clone)") != (Object)null) { GO4 = getChildGameObject(((Component)tr4).gameObject, "HANDR(Clone)"); handr = GO4.GetComponent(); handr.origin = root.transform; } if ((Object)(object)getChildGameObject(((Component)tr5).gameObject, "TOEL(Clone)") != (Object)null) { GO5 = getChildGameObject(((Component)tr5).gameObject, "TOEL(Clone)"); footl = GO5.GetComponent(); footl.origin = root.transform; ik.solver.leftLeg.target = getChildGameObject(GO5, "ToeTargL").transform; } if ((Object)(object)getChildGameObject(((Component)tr6).gameObject, "TOER(Clone)") != (Object)null) { GO6 = getChildGameObject(((Component)tr6).gameObject, "TOER(Clone)"); footr = GO6.GetComponent(); footr.origin = root.transform; ik.solver.rightLeg.target = getChildGameObject(GO6, "ToeTargR").transform; } if ((Object)(object)getChildGameObject(((Component)tr7).gameObject, "FOREARML(Clone)") != (Object)null) { GO7 = getChildGameObject(((Component)tr7).gameObject, "FOREARML(Clone)"); elbell = GO7.GetComponent(); elbell.origin = root.transform; ik.solver.leftArm.bendGoal = getChildGameObject(GO7, "ForeArmL").transform; } if ((Object)(object)getChildGameObject(((Component)tr8).gameObject, "FOREARMR(Clone)") != (Object)null) { GO8 = getChildGameObject(((Component)tr8).gameObject, "FOREARMR(Clone)"); elbelr = GO8.GetComponent(); elbelr.origin = root.transform; ik.solver.rightArm.bendGoal = getChildGameObject(GO8, "ForeArmR").transform; } if ((Object)(object)getChildGameObject(((Component)tr9).gameObject, "KNEEL(Clone)") != (Object)null) { GO9 = getChildGameObject(((Component)tr9).gameObject, "KNEEL(Clone)"); kneel = GO9.GetComponent(); kneel.origin = root.transform; ik.solver.leftLeg.bendGoal = getChildGameObject(GO9, "KneeL").transform; } if ((Object)(object)getChildGameObject(((Component)tr10).gameObject, "KNEER(Clone)") != (Object)null) { GO10 = getChildGameObject(((Component)tr10).gameObject, "KNEER(Clone)"); kneer = GO10.GetComponent(); kneer.origin = root.transform; ik.solver.rightLeg.bendGoal = getChildGameObject(GO10, "KneeR").transform; } } } ((Behaviour)ik).enabled = true; headref.transform.position = GO1.transform.position; headref.transform.eulerAngles = GO1.transform.eulerAngles; if ((Object)(object)GO1 != (Object)null) { GO1.transform.SetParent(tr1); } if ((Object)(object)GO2 != (Object)null) { GO2.transform.SetParent(tr2); } if ((Object)(object)GO3 != (Object)null) { GO3.transform.SetParent(tr3); } if ((Object)(object)GO4 != (Object)null) { GO4.transform.SetParent(tr4); } if ((Object)(object)GO5 != (Object)null) { GO5.transform.SetParent(tr5); } if ((Object)(object)GO6 != (Object)null) { GO6.transform.SetParent(tr6); } if ((Object)(object)GO7 != (Object)null) { GO7.transform.SetParent(tr7); } if ((Object)(object)GO8 != (Object)null) { GO8.transform.SetParent(tr8); } if ((Object)(object)GO9 != (Object)null) { GO9.transform.SetParent(tr9); } if ((Object)(object)GO10 != (Object)null) { GO10.transform.SetParent(tr10); } if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { if ((Object)(object)Main.GetComponent() == (Object)null) { ((Behaviour)head).enabled = true; ((Behaviour)hip).enabled = true; ((Behaviour)handl).enabled = true; ((Behaviour)handr).enabled = true; ((Behaviour)footl).enabled = true; ((Behaviour)footr).enabled = true; ((Behaviour)elbell).enabled = true; ((Behaviour)elbelr).enabled = true; ((Behaviour)kneel).enabled = true; ((Behaviour)kneer).enabled = true; } else if ((Object)(object)Main.GetComponent() != (Object)null) { ((Behaviour)head).enabled = false; ((Behaviour)hip).enabled = false; ((Behaviour)handl).enabled = false; ((Behaviour)handr).enabled = false; ((Behaviour)footl).enabled = false; ((Behaviour)footr).enabled = false; ((Behaviour)elbell).enabled = false; ((Behaviour)elbelr).enabled = false; ((Behaviour)kneel).enabled = false; ((Behaviour)kneer).enabled = false; } } } private void OnDestroy() { Object.Destroy((Object)(object)GO1); Object.Destroy((Object)(object)GO2); Object.Destroy((Object)(object)GO3); Object.Destroy((Object)(object)GO4); Object.Destroy((Object)(object)GO5); Object.Destroy((Object)(object)GO6); Object.Destroy((Object)(object)GO7); Object.Destroy((Object)(object)GO8); Object.Destroy((Object)(object)GO9); Object.Destroy((Object)(object)GO10); } public static GameObject getChildGameObject(GameObject fromGameObject, string withName) { Transform[] componentsInChildren = ((Component)fromGameObject.transform).GetComponentsInChildren(); Transform[] array = componentsInChildren; foreach (Transform val in array) { if (((Object)((Component)val).gameObject).name == withName) { return ((Component)val).gameObject; } } return null; } } public class PlayerCrouch : MonoBehaviour { public GameObject crouch; [SerializeField] private Transform body; public Ray ray; public float rayLength; [SerializeField] private LayerMask terrainLayer; public float rayStartYOffset = 0f; public float rayMul; public float dis; public RaycastHit rayhit; private void Start() { } private void Update() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) ray = new Ray(body.position + Vector3.up * rayStartYOffset, Vector3.down); Physics.Raycast(ray, ref rayhit, rayLength, ((LayerMask)(ref terrainLayer)).value); if (((RaycastHit)(ref rayhit)).distance > 0.6f) { dis = 0.6f * rayMul; crouch.transform.localEulerAngles = new Vector3(dis, 0f, 0f); } else { dis = ((RaycastHit)(ref rayhit)).distance * rayMul; crouch.transform.localEulerAngles = new Vector3(dis, 0f, 0f); } if (crouch.transform.localEulerAngles.x > 60f) { crouch.transform.localEulerAngles = new Vector3(60f, 0f, 0f); } else if (crouch.transform.localEulerAngles.x < 0f) { crouch.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } } public class RandomLook : MonoBehaviour { public GameObject EyeLMain; public GameObject EyeRMain; public float RandomedVal; public float MaxT = 1f; public float MinT = 0.5f; public float RandomLimit = 5f; public float cdRandEye = 0f; public GameObject eyetar; public GameObject eyetarrandom; public GameObject eyeref; public GameObject eyetarnogun; public bool canlookx = true; public bool canlooky = true; private void Start() { } private void FixedUpdate() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0ddd: Unknown result type (might be due to invalid IL or missing references) //IL_0de2: Unknown result type (might be due to invalid IL or missing references) //IL_0deb: Unknown result type (might be due to invalid IL or missing references) //IL_0e1d: Unknown result type (might be due to invalid IL or missing references) //IL_0e22: Unknown result type (might be due to invalid IL or missing references) //IL_0e2b: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0cc5: Unknown result type (might be due to invalid IL or missing references) //IL_0cee: Unknown result type (might be due to invalid IL or missing references) //IL_0d0e: Unknown result type (might be due to invalid IL or missing references) //IL_0d13: Unknown result type (might be due to invalid IL or missing references) //IL_0d27: Unknown result type (might be due to invalid IL or missing references) //IL_0d2c: Unknown result type (might be due to invalid IL or missing references) //IL_0d3a: Unknown result type (might be due to invalid IL or missing references) //IL_0d5b: Unknown result type (might be due to invalid IL or missing references) //IL_0d60: Unknown result type (might be due to invalid IL or missing references) //IL_0d81: Unknown result type (might be due to invalid IL or missing references) //IL_0d86: Unknown result type (might be due to invalid IL or missing references) //IL_07fb: Unknown result type (might be due to invalid IL or missing references) //IL_0800: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_0826: Unknown result type (might be due to invalid IL or missing references) //IL_0792: Unknown result type (might be due to invalid IL or missing references) //IL_0797: Unknown result type (might be due to invalid IL or missing references) //IL_07b8: Unknown result type (might be due to invalid IL or missing references) //IL_07bd: Unknown result type (might be due to invalid IL or missing references) //IL_0a9c: Unknown result type (might be due to invalid IL or missing references) //IL_0aa1: Unknown result type (might be due to invalid IL or missing references) //IL_0ac2: Unknown result type (might be due to invalid IL or missing references) //IL_0ac7: Unknown result type (might be due to invalid IL or missing references) //IL_0a33: Unknown result type (might be due to invalid IL or missing references) //IL_0a38: Unknown result type (might be due to invalid IL or missing references) //IL_0a59: Unknown result type (might be due to invalid IL or missing references) //IL_0a5e: Unknown result type (might be due to invalid IL or missing references) //IL_0872: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08bb: Unknown result type (might be due to invalid IL or missing references) //IL_08c0: Unknown result type (might be due to invalid IL or missing references) //IL_08d4: Unknown result type (might be due to invalid IL or missing references) //IL_08d9: Unknown result type (might be due to invalid IL or missing references) //IL_08e7: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0b13: Unknown result type (might be due to invalid IL or missing references) //IL_0b3c: Unknown result type (might be due to invalid IL or missing references) //IL_0b5c: Unknown result type (might be due to invalid IL or missing references) //IL_0b61: Unknown result type (might be due to invalid IL or missing references) //IL_0b75: Unknown result type (might be due to invalid IL or missing references) //IL_0b7a: Unknown result type (might be due to invalid IL or missing references) //IL_0b88: Unknown result type (might be due to invalid IL or missing references) //IL_093f: Unknown result type (might be due to invalid IL or missing references) //IL_0974: Unknown result type (might be due to invalid IL or missing references) //IL_0994: Unknown result type (might be due to invalid IL or missing references) //IL_0999: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Unknown result type (might be due to invalid IL or missing references) //IL_09b2: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_0be0: Unknown result type (might be due to invalid IL or missing references) //IL_0c15: Unknown result type (might be due to invalid IL or missing references) //IL_0c35: Unknown result type (might be due to invalid IL or missing references) //IL_0c3a: Unknown result type (might be due to invalid IL or missing references) //IL_0c4e: Unknown result type (might be due to invalid IL or missing references) //IL_0c53: Unknown result type (might be due to invalid IL or missing references) //IL_0c61: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_069e: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06f3: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_071f: Unknown result type (might be due to invalid IL or missing references) AxisLookAt(eyeref.transform, eyetarrandom.transform.position, Vector3.forward); if ((eyeref.transform.localEulerAngles.x <= 360f && eyeref.transform.localEulerAngles.x > 315f) || (eyeref.transform.localEulerAngles.x < 45f && eyeref.transform.localEulerAngles.x >= 0f)) { canlookx = true; } if ((eyeref.transform.localEulerAngles.x >= 180f && eyeref.transform.localEulerAngles.x <= 315f) || (eyeref.transform.localEulerAngles.x >= 45f && eyeref.transform.localEulerAngles.x <= 180f)) { canlookx = false; } if ((eyeref.transform.localEulerAngles.y <= 360f && eyeref.transform.localEulerAngles.y > 315f) || (eyeref.transform.localEulerAngles.y < 45f && eyeref.transform.localEulerAngles.y >= 0f)) { canlooky = true; } if ((eyeref.transform.localEulerAngles.y >= 180f && eyeref.transform.localEulerAngles.y <= 315f) || (eyeref.transform.localEulerAngles.y >= 45f && eyeref.transform.localEulerAngles.y <= 180f)) { canlooky = false; } if ((Object)(object)GM.CurrentMovementManager != (Object)null) { if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable != (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable != (Object)null) { if (canlookx && canlooky) { AxisLookAt(EyeLMain.transform, eyetarrandom.transform.position, Vector3.forward); AxisLookAt(EyeRMain.transform, eyetarrandom.transform.position, Vector3.forward); } else if (!canlookx || !canlooky) { AxisLookAt(EyeLMain.transform, eyetarnogun.transform.position, Vector3.forward); AxisLookAt(EyeRMain.transform, eyetarnogun.transform.position, Vector3.forward); } if (((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent() == (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent() == (Object)null) || ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent() != (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent() != (Object)null) || ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent() == (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent() == (Object)null) || ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent() != (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent() != (Object)null)) { eyetar.transform.position = ((Component)GM.CurrentMovementManager.Head).gameObject.transform.position; eyetar.transform.eulerAngles = ((Component)GM.CurrentMovementManager.Head).gameObject.transform.eulerAngles; eyetarrandom.transform.localPosition = new Vector3(eyetarrandom.transform.localPosition.x, eyetarrandom.transform.localPosition.y, 10f); } if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent() != (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent() == (Object)null) { eyetar.transform.position = ((Component)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent().MuzzlePos).transform.position; eyetar.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent().MuzzlePos).transform.eulerAngles; eyetarrandom.transform.localPosition = new Vector3(eyetarrandom.transform.localPosition.x, eyetarrandom.transform.localPosition.y, 50f); } if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent() == (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent() != (Object)null) { eyetar.transform.position = ((Component)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent().MuzzlePos).transform.position; eyetar.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent().MuzzlePos).transform.eulerAngles; eyetarrandom.transform.localPosition = new Vector3(eyetarrandom.transform.localPosition.x, eyetarrandom.transform.localPosition.y, 50f); } } if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable != (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null) { if (canlookx && canlooky) { AxisLookAt(EyeLMain.transform, eyetarrandom.transform.position, Vector3.forward); AxisLookAt(EyeRMain.transform, eyetarrandom.transform.position, Vector3.forward); } else if (!canlookx || !canlooky) { AxisLookAt(EyeLMain.transform, eyetarnogun.transform.position, Vector3.forward); AxisLookAt(EyeRMain.transform, eyetarnogun.transform.position, Vector3.forward); } if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent() == (Object)null) { eyetar.transform.position = ((Component)GM.CurrentMovementManager.Head).gameObject.transform.position; eyetar.transform.eulerAngles = ((Component)GM.CurrentMovementManager.Head).gameObject.transform.eulerAngles; eyetarrandom.transform.localPosition = new Vector3(eyetarrandom.transform.localPosition.x, eyetarrandom.transform.localPosition.y, 10f); } if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent() != (Object)null) { eyetar.transform.position = ((Component)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent().MuzzlePos).transform.position; eyetar.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).GetComponent().MuzzlePos).transform.eulerAngles; eyetarrandom.transform.localPosition = new Vector3(eyetarrandom.transform.localPosition.x, eyetarrandom.transform.localPosition.y, 50f); } } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable != (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null) { if (canlookx && canlooky) { AxisLookAt(EyeLMain.transform, eyetarrandom.transform.position, Vector3.forward); AxisLookAt(EyeRMain.transform, eyetarrandom.transform.position, Vector3.forward); } else if (!canlookx || !canlooky) { AxisLookAt(EyeLMain.transform, eyetarnogun.transform.position, Vector3.forward); AxisLookAt(EyeRMain.transform, eyetarnogun.transform.position, Vector3.forward); } if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent() == (Object)null) { eyetar.transform.position = ((Component)GM.CurrentMovementManager.Head).gameObject.transform.position; eyetar.transform.eulerAngles = ((Component)GM.CurrentMovementManager.Head).gameObject.transform.eulerAngles; eyetarrandom.transform.localPosition = new Vector3(eyetarrandom.transform.localPosition.x, eyetarrandom.transform.localPosition.y, 10f); } if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent() != (Object)null) { eyetar.transform.position = ((Component)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent().MuzzlePos).transform.position; eyetar.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).GetComponent().MuzzlePos).transform.eulerAngles; eyetarrandom.transform.localPosition = new Vector3(eyetarrandom.transform.localPosition.x, eyetarrandom.transform.localPosition.y, 50f); } } if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null) { eyetar.transform.position = ((Component)GM.CurrentMovementManager.Head).gameObject.transform.position; eyetar.transform.eulerAngles = ((Component)GM.CurrentMovementManager.Head).gameObject.transform.eulerAngles; eyetarrandom.transform.localPosition = new Vector3(eyetarrandom.transform.localPosition.x, eyetarrandom.transform.localPosition.y, 10f); AxisLookAt(EyeLMain.transform, eyetarnogun.transform.position, Vector3.forward); AxisLookAt(EyeRMain.transform, eyetarnogun.transform.position, Vector3.forward); } } cdRandEye -= Time.deltaTime; if (cdRandEye <= 0f) { eyetarnogun.transform.localPosition = new Vector3((float)Random.Range(-5, 5), (float)Random.Range(-5, 5), eyetarnogun.transform.localPosition.z); eyetarrandom.transform.localPosition = new Vector3((float)Random.Range(-5, 5), (float)Random.Range(-5, 5), eyetarrandom.transform.localPosition.z); cdRandEye = Random.Range(MinT, MaxT); } } private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f); } } [RequireComponent(typeof(AudioSource))] public class RealtimeMicPitchChanger : MonoBehaviour { [Header("麦克风设置")] public string selectedDevice; public bool useLoop = true; public int recordingLength = 10; public bool started = false; [Header("音色调整参数")] [Range(0.1f, 3f)] public float pitchShift = 1f; [Range(0f, 1f)] public float distortion = 0f; [Range(0f, 1f)] public float lowPassCutoff = 1f; public int micorder = 0; public AR15HandleSightFlipper mictoggle; public AR15HandleSightFlipper micpower; private AudioSource audioSource; private AudioClip microphoneClip; public AudioEvent click; private bool isMicrophoneActive; private float[] processingBuffer; private void Start() { audioSource = ((Component)this).GetComponent(); } private void StartMicrophone() { if (Microphone.devices.Length == 0) { Debug.LogError((object)"未找到麦克风设备!"); return; } if (string.IsNullOrEmpty(selectedDevice)) { selectedDevice = Microphone.devices[micorder]; } microphoneClip = Microphone.Start(selectedDevice, useLoop, recordingLength, 44100); while (Microphone.GetPosition(selectedDevice) <= 0) { } audioSource.clip = microphoneClip; audioSource.loop = true; audioSource.Play(); } private void OnAudioFilterRead(float[] data, int channels) { if (!isMicrophoneActive) { return; } int position = Microphone.GetPosition(selectedDevice); if (position <= 0) { return; } if (processingBuffer == null || processingBuffer.Length != data.Length) { processingBuffer = new float[data.Length]; } microphoneClip.GetData(processingBuffer, 0); for (int i = 0; i < data.Length; i++) { int num = (int)((float)i * pitchShift) % processingBuffer.Length; float num2 = processingBuffer[num]; if (distortion > 0.01f) { num2 = Mathf.Sign(num2) * Mathf.Lerp(Mathf.Abs(num2), 1f, distortion); } if (lowPassCutoff < 0.99f) { int num3 = (int)(10f * (1f - lowPassCutoff)); float num4 = 0f; int num5 = 0; for (int j = Mathf.Max(0, i - num3); j <= i; j++) { num4 += processingBuffer[j % processingBuffer.Length]; num5++; } num2 = Mathf.Lerp(num2, num4 / (float)num5, 1f - lowPassCutoff); } data[i] = num2; } } private void Update() { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!mictoggle.m_isLargeAperture) { if (micorder < Microphone.devices.Length - 1) { micorder++; } else if (micorder >= Microphone.devices.Length - 1) { micorder = 0; } SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).gameObject.transform.position); mictoggle.m_isLargeAperture = true; } if (!mictoggle.m_isLargeAperture) { isMicrophoneActive = !isMicrophoneActive; SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).gameObject.transform.position); mictoggle.m_isLargeAperture = true; } if (isMicrophoneActive && !started) { StartMicrophone(); started = true; } if (!isMicrophoneActive) { started = false; audioSource.Stop(); audioSource.clip = null; audioSource.loop = false; } } private void OnDestroy() { if (Microphone.IsRecording(selectedDevice)) { Microphone.End(selectedDevice); } isMicrophoneActive = false; } } public class RecenterToPlaySpace : MonoBehaviour { public GameObject obj; private void Start() { } private void Update() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) obj.transform.position = ((Component)GM.CurrentPlayerRoot).transform.position; obj.transform.eulerAngles = ((Component)GM.CurrentPlayerRoot).transform.eulerAngles; } } public class RotateAlong : MonoBehaviour { public GameObject rotGeo; public GameObject alongGeo; private void Start() { } private void Update() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) alongGeo.transform.eulerAngles = rotGeo.transform.eulerAngles; } } public class SimpleSeatBody : MonoBehaviour { public bool is_seated = false; public GameObject seatbody; public MeshRenderer Head; public MeshRenderer Helmet1; public MeshRenderer Helmet2; public MeshRenderer Torso; public MeshRenderer Shirt; public MeshRenderer Vest; public MeshRenderer LegUp; public MeshRenderer Pants; public MeshRenderer LegLow; public MeshRenderer Boot; public MeshRenderer HeadSeat; public MeshRenderer Helmet1Seat; public MeshRenderer Helmet2Seat; public MeshRenderer TorsoSeat; public MeshRenderer ShirtSeat; public MeshRenderer VestSeat; public MeshRenderer LegUpSeat; public MeshRenderer PantsSeat; public MeshRenderer LegLowSeat; public MeshRenderer BootSeat; private Collider seat; private GameObject sitpos; public GameObject head; public GameObject lowerbody; public GameObject middlefootsit; public GameObject seatswitch; public GameObject sensor; private void Start() { } private void OnTriggerStay(Collider other) { if (((Object)((Component)other).gameObject).name == "VehicleSeat") { is_seated = true; seat = other; sitpos = ((Component)seat).gameObject; } if (!(((Object)((Component)other).gameObject).name != "VehicleSeat")) { } } private void OnTriggerExit(Collider other) { if (((Object)((Component)other).gameObject).name == "VehicleSeat") { is_seated = false; } if (!(((Object)((Component)other).gameObject).name != "VehicleSeat")) { } } private void FixedUpdate() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)sitpos == (Object)null || (Object)(object)seat == (Object)null) { } seatbody.transform.position = head.transform.position; sensor.transform.position = seatbody.transform.position; if (is_seated && seatswitch.transform.localEulerAngles.x > 45f) { sitpos = ((Component)seat).gameObject; ((Renderer)Head).enabled = false; ((Renderer)Helmet1).enabled = false; ((Renderer)Helmet2).enabled = false; ((Renderer)Torso).enabled = false; ((Renderer)Shirt).enabled = false; ((Renderer)Vest).enabled = false; ((Renderer)LegUp).enabled = false; ((Renderer)Pants).enabled = false; ((Renderer)LegLow).enabled = false; ((Renderer)Boot).enabled = false; ((Renderer)HeadSeat).enabled = true; ((Renderer)Helmet1Seat).enabled = true; ((Renderer)Helmet2Seat).enabled = true; ((Renderer)TorsoSeat).enabled = true; ((Renderer)ShirtSeat).enabled = true; ((Renderer)VestSeat).enabled = true; ((Renderer)LegUpSeat).enabled = true; ((Renderer)PantsSeat).enabled = true; ((Renderer)LegLowSeat).enabled = true; ((Renderer)BootSeat).enabled = true; seatbody.transform.parent = sitpos.transform; float num = Mathf.Clamp(seatbody.transform.localPosition.x, -10f, 10f); float num2 = Mathf.Clamp(seatbody.transform.localPosition.y, 400f, 435f); float num3 = Mathf.Clamp(seatbody.transform.localPosition.z, -75f, -55f); seatbody.transform.localPosition = new Vector3(num, num2, num3); seatbody.transform.eulerAngles = new Vector3(sitpos.transform.eulerAngles.x, sitpos.transform.eulerAngles.y, sitpos.transform.eulerAngles.z); lowerbody.transform.eulerAngles = new Vector3(sitpos.transform.eulerAngles.x, sitpos.transform.eulerAngles.y, sitpos.transform.eulerAngles.z); Transform transform = middlefootsit.transform; Vector3 val = sitpos.transform.GetChild(1).position - sitpos.transform.GetChild(0).position; transform.position = ((Vector3)(ref val)).normalized * (Vector3.Distance(sitpos.transform.GetChild(1).position, sitpos.transform.GetChild(0).position) * 0.5f) + sitpos.transform.GetChild(0).position; } if (!is_seated || seatswitch.transform.localEulerAngles.x < 45f) { seat = null; sitpos = null; ((Renderer)Head).enabled = true; ((Renderer)Helmet1).enabled = true; ((Renderer)Helmet2).enabled = true; ((Renderer)Torso).enabled = true; ((Renderer)Shirt).enabled = true; ((Renderer)Vest).enabled = true; ((Renderer)LegUp).enabled = true; ((Renderer)Pants).enabled = true; ((Renderer)LegLow).enabled = true; ((Renderer)Boot).enabled = true; ((Renderer)HeadSeat).enabled = false; ((Renderer)Helmet1Seat).enabled = false; ((Renderer)Helmet2Seat).enabled = false; ((Renderer)TorsoSeat).enabled = false; ((Renderer)ShirtSeat).enabled = false; ((Renderer)VestSeat).enabled = false; ((Renderer)LegUpSeat).enabled = false; ((Renderer)PantsSeat).enabled = false; ((Renderer)LegLowSeat).enabled = false; ((Renderer)BootSeat).enabled = false; seatbody.transform.parent = head.transform; seatbody.transform.localEulerAngles = new Vector3(0f, 0f, 0f); seatbody.transform.localPosition = new Vector3(0f, 0f, 0f); } } } public class SlotParent : MonoBehaviour { public FVRPhysicalObject curobj; public FVRQuickBeltSlot slot; private void FixedUpdate() { if ((Object)(object)slot.CurObject != (Object)null) { curobj = slot.CurObject; } if ((Object)(object)curobj != (Object)null) { if ((Object)(object)curobj.m_quickbeltSlot != (Object)null && (Object)(object)((FVRInteractiveObject)curobj).m_hand == (Object)null) { ((Component)curobj).transform.SetParent(((Component)slot.PoseOverride).transform); } if ((Object)(object)curobj.m_quickbeltSlot == (Object)null) { ((Component)curobj).transform.SetParent((Transform)null); curobj = null; } if ((Object)(object)((FVRInteractiveObject)curobj).m_hand != (Object)null) { ((Component)curobj).transform.SetParent((Transform)null); } } } } public class SnapToPoint : MonoBehaviour { public Transform pointSpapTo; private void Start() { } private void Update() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pointSpapTo != (Object)null) { ((Component)this).gameObject.transform.position = ((Component)pointSpapTo).transform.position; ((Component)this).gameObject.transform.eulerAngles = ((Component)pointSpapTo).transform.eulerAngles; } else if ((Object)(object)pointSpapTo == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class SnapToPointRigidbody : MonoBehaviour { public Transform snapTo; [NonSerialized] private Rigidbody body; public float snapTime = 2f; [NonSerialized] private float dropTimer; public void Start() { body = ((Component)this).GetComponent(); } public void Update() { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)snapTo == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { if (!((Object)(object)snapTo != (Object)null)) { return; } dropTimer += Time.deltaTime / (snapTime / 2f); body.isKinematic = dropTimer > 1f; if (dropTimer > 1f) { ((Component)this).transform.position = snapTo.position; ((Component)this).transform.rotation = snapTo.rotation; return; } float num = Mathf.Pow(35f, dropTimer); body.velocity = Vector3.Lerp(body.velocity, Vector3.zero, Time.fixedDeltaTime * 4f); if (body.useGravity) { body.AddForce(-Physics.gravity); } ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, snapTo.position, Time.fixedDeltaTime * num * 3f); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, snapTo.rotation, Time.fixedDeltaTime * num * 2f); } } } public class SwitchFromFBTtoAI : MonoBehaviour { public SteamVR_TrackedObject Hip; public SteamVR_TrackedObject FootL; public SteamVR_TrackedObject FootR; public VRIK rig; public GameObject GX; public GameObject GZ; public GameObject GY; public WaggleJoint WagX; public WaggleJoint WagZ; public WaggleJoint WagY; public NeckRot NR; public Transform FBTfootLTarg; public Transform FBTfootRTarg; public Transform AIfootLTarg; public Transform AIfootRTarg; public Transform FootLTarg; public Transform FootRTarg; public Vector3 FootLRef; public Vector3 FootRRef; public float PelvisRef = 0f; public float PelvisWeight = 1f; public GameObject CrouchScript; public GameObject WalkingScript; public bool ismoving = false; public Vector3 curmove; public Vector3 lastmove; private void Start() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) curmove = ((Component)GM.CurrentPlayerRoot).transform.position; lastmove = ((Component)GM.CurrentPlayerRoot).transform.position; } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) curmove = ((Component)GM.CurrentPlayerRoot).transform.position; if (curmove != lastmove) { ismoving = true; } else if (curmove == lastmove) { ismoving = false; } lastmove = curmove; rig.solver.spine.pelvisPositionWeight = PelvisWeight; rig.solver.spine.pelvisRotationWeight = PelvisWeight; rig.solver.leftLeg.bendGoalWeight = PelvisWeight; rig.solver.rightLeg.bendGoalWeight = PelvisWeight; if (Hip.isValid && FootL.isValid && FootR.isValid && GM.CurrentMovementManager.m_isGrounded && !ismoving) { rig.solver.leftLeg.target = FootLTarg; rig.solver.rightLeg.target = FootRTarg; rig.solver.spine.bodyPosStiffness = 0.1f; ((Component)FootLTarg).transform.position = Vector3.SmoothDamp(((Component)FootLTarg).transform.position, ((Component)FBTfootLTarg).transform.position, ref FootLRef, 0.05f); ((Component)FootRTarg).transform.position = Vector3.SmoothDamp(((Component)FootRTarg).transform.position, ((Component)FBTfootRTarg).transform.position, ref FootRRef, 0.05f); PelvisWeight = Mathf.SmoothDamp(PelvisWeight, 1f, ref PelvisRef, 0.05f); ((Behaviour)NR).enabled = false; ((Behaviour)WagX).enabled = false; ((Behaviour)WagY).enabled = false; ((Behaviour)WagZ).enabled = false; GX.transform.localEulerAngles = new Vector3(-90f, 0f, 0f); GY.transform.localEulerAngles = new Vector3(0f, 0f, 0f); GZ.transform.localEulerAngles = new Vector3(-90f, 0f, 0f); CrouchScript.SetActive(false); WalkingScript.SetActive(false); } if (!Hip.isValid || !FootL.isValid || !FootR.isValid || ismoving || !GM.CurrentMovementManager.m_isGrounded) { rig.solver.leftLeg.target = AIfootLTarg; rig.solver.rightLeg.target = AIfootRTarg; PelvisWeight = Mathf.SmoothDamp(PelvisWeight, 0f, ref PelvisRef, 0.05f); rig.solver.spine.bodyPosStiffness = 1f; ((Component)FootLTarg).transform.position = Vector3.SmoothDamp(((Component)FootLTarg).transform.position, ((Component)AIfootLTarg).transform.position, ref FootLRef, 0.05f); ((Component)FootRTarg).transform.position = Vector3.SmoothDamp(((Component)FootRTarg).transform.position, ((Component)AIfootRTarg).transform.position, ref FootRRef, 0.05f); ((Behaviour)NR).enabled = true; ((Behaviour)WagX).enabled = true; ((Behaviour)WagY).enabled = true; ((Behaviour)WagZ).enabled = true; CrouchScript.SetActive(true); WalkingScript.SetActive(true); } } } public class SwitchFromFBTtoAI2Ts : MonoBehaviour { public SteamVR_TrackedObject FootL; public SteamVR_TrackedObject FootR; public VRIK rig; public GameObject GX; public GameObject GZ; public GameObject GY; public WaggleJoint WagX; public WaggleJoint WagZ; public WaggleJoint WagY; public NeckRot NR; public Transform FBTfootLTarg; public Transform FBTfootRTarg; public Transform AIfootLTarg; public Transform AIfootRTarg; public GameObject CrouchScript; public GameObject WalkingScript; private void FixedUpdate() { //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) if (FootL.isValid && FootR.isValid) { rig.solver.spine.pelvisPositionWeight = 1f; rig.solver.spine.pelvisRotationWeight = 1f; rig.solver.spine.bodyPosStiffness = 0.1f; rig.solver.leftLeg.target = FBTfootLTarg; rig.solver.rightLeg.target = FBTfootRTarg; rig.solver.leftLeg.bendGoalWeight = 1f; rig.solver.rightLeg.bendGoalWeight = 1f; ((Behaviour)NR).enabled = false; ((Behaviour)WagX).enabled = false; ((Behaviour)WagY).enabled = false; ((Behaviour)WagZ).enabled = false; GX.transform.localEulerAngles = new Vector3(-90f, 0f, 0f); GY.transform.localEulerAngles = new Vector3(0f, 0f, 0f); GZ.transform.localEulerAngles = new Vector3(-90f, 0f, 0f); CrouchScript.SetActive(false); WalkingScript.SetActive(false); } else if (!FootL.isValid || !FootR.isValid) { rig.solver.spine.pelvisPositionWeight = 0f; rig.solver.spine.pelvisRotationWeight = 0f; rig.solver.spine.bodyPosStiffness = 1f; rig.solver.leftLeg.target = AIfootLTarg; rig.solver.rightLeg.target = AIfootRTarg; rig.solver.leftLeg.bendGoalWeight = 0f; rig.solver.rightLeg.bendGoalWeight = 0f; ((Behaviour)NR).enabled = true; ((Behaviour)WagX).enabled = true; ((Behaviour)WagY).enabled = true; ((Behaviour)WagZ).enabled = true; CrouchScript.SetActive(true); WalkingScript.SetActive(true); } } } public class SwitchFromFBTtoAI3Ts : MonoBehaviour { public SteamVR_TrackedObject Hip; public SteamVR_TrackedObject FootL; public SteamVR_TrackedObject FootR; public VRIK rig; public GameObject GX; public GameObject GZ; public GameObject GY; public WaggleJoint WagX; public WaggleJoint WagZ; public WaggleJoint WagY; public NeckRot NR; public Transform FBTfootLTarg; public Transform FBTfootRTarg; public Transform AIfootLTarg; public Transform AIfootRTarg; public GameObject CrouchScript; public GameObject WalkingScript; private void FixedUpdate() { //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) if (Hip.isValid && FootL.isValid && FootR.isValid) { rig.solver.spine.pelvisPositionWeight = 1f; rig.solver.spine.pelvisRotationWeight = 1f; rig.solver.spine.bodyPosStiffness = 0.1f; rig.solver.leftLeg.target = FBTfootLTarg; rig.solver.rightLeg.target = FBTfootRTarg; rig.solver.leftLeg.bendGoalWeight = 1f; rig.solver.rightLeg.bendGoalWeight = 1f; ((Behaviour)NR).enabled = false; ((Behaviour)WagX).enabled = false; ((Behaviour)WagY).enabled = false; ((Behaviour)WagZ).enabled = false; GX.transform.localEulerAngles = new Vector3(-90f, 0f, 0f); GY.transform.localEulerAngles = new Vector3(0f, 0f, 0f); GZ.transform.localEulerAngles = new Vector3(-90f, 0f, 0f); CrouchScript.SetActive(false); WalkingScript.SetActive(false); } else if (!Hip.isValid || !FootL.isValid || !FootR.isValid) { rig.solver.spine.pelvisPositionWeight = 0f; rig.solver.spine.pelvisRotationWeight = 0f; rig.solver.spine.bodyPosStiffness = 1f; rig.solver.leftLeg.target = AIfootLTarg; rig.solver.rightLeg.target = AIfootRTarg; rig.solver.leftLeg.bendGoalWeight = 0f; rig.solver.rightLeg.bendGoalWeight = 0f; ((Behaviour)NR).enabled = true; ((Behaviour)WagX).enabled = true; ((Behaviour)WagY).enabled = true; ((Behaviour)WagZ).enabled = true; CrouchScript.SetActive(true); WalkingScript.SetActive(true); } } } public class SwitchFromFBTtoAI5Ts : MonoBehaviour { public SteamVR_TrackedObject Hip; public SteamVR_TrackedObject FootL; public SteamVR_TrackedObject FootR; public SteamVR_TrackedObject KneeL; public SteamVR_TrackedObject KneeR; public VRIK rig; public GameObject GX; public GameObject GZ; public GameObject GY; public WaggleJoint WagX; public WaggleJoint WagZ; public WaggleJoint WagY; public NeckRot NR; public Transform FBTfootLTarg; public Transform FBTfootRTarg; public Transform AIfootLTarg; public Transform AIfootRTarg; public GameObject CrouchScript; public GameObject WalkingScript; public Transform FootLTarg; public Transform FootRTarg; public Vector3 FootLRef; public Vector3 FootRRef; public float PelvisRef = 0f; public float PelvisWeight = 1f; public bool ismoving = false; public Vector3 curmove; public Vector3 lastmove; private void Start() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) curmove = ((Component)GM.CurrentPlayerRoot).transform.position; lastmove = ((Component)GM.CurrentPlayerRoot).transform.position; } private void FixedUpdate() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) curmove = ((Component)GM.CurrentPlayerRoot).transform.position; if (curmove != lastmove) { ismoving = true; } else if (curmove == lastmove) { ismoving = false; } lastmove = curmove; rig.solver.spine.pelvisPositionWeight = PelvisWeight; rig.solver.spine.pelvisRotationWeight = PelvisWeight; rig.solver.leftLeg.bendGoalWeight = PelvisWeight; rig.solver.rightLeg.bendGoalWeight = PelvisWeight; if (Hip.isValid && FootL.isValid && FootR.isValid && KneeL.isValid && KneeR.isValid && GM.CurrentMovementManager.m_isGrounded && !ismoving) { rig.solver.spine.bodyPosStiffness = 0.1f; ((Component)FootLTarg).transform.position = Vector3.SmoothDamp(((Component)FootLTarg).transform.position, ((Component)FBTfootLTarg).transform.position, ref FootLRef, 0.05f); ((Component)FootRTarg).transform.position = Vector3.SmoothDamp(((Component)FootRTarg).transform.position, ((Component)FBTfootRTarg).transform.position, ref FootRRef, 0.05f); PelvisWeight = Mathf.SmoothDamp(PelvisWeight, 1f, ref PelvisRef, 0.05f); ((Behaviour)NR).enabled = false; ((Behaviour)WagX).enabled = false; ((Behaviour)WagY).enabled = false; ((Behaviour)WagZ).enabled = false; GX.transform.localEulerAngles = new Vector3(-90f, 0f, 0f); GY.transform.localEulerAngles = new Vector3(0f, 0f, 0f); GZ.transform.localEulerAngles = new Vector3(-90f, 0f, 0f); CrouchScript.SetActive(false); WalkingScript.SetActive(false); } else if (!Hip.isValid || !FootL.isValid || !FootR.isValid || !KneeL.isValid || !KneeR.isValid || !GM.CurrentMovementManager.m_isGrounded || ismoving) { PelvisWeight = Mathf.SmoothDamp(PelvisWeight, 0f, ref PelvisRef, 0.05f); rig.solver.spine.bodyPosStiffness = 1f; ((Component)FootLTarg).transform.position = Vector3.SmoothDamp(((Component)FootLTarg).transform.position, ((Component)AIfootLTarg).transform.position, ref FootLRef, 0.05f); ((Component)FootRTarg).transform.position = Vector3.SmoothDamp(((Component)FootRTarg).transform.position, ((Component)AIfootRTarg).transform.position, ref FootRRef, 0.05f); ((Behaviour)NR).enabled = true; ((Behaviour)WagX).enabled = true; ((Behaviour)WagY).enabled = true; ((Behaviour)WagZ).enabled = true; CrouchScript.SetActive(true); WalkingScript.SetActive(true); } } } public class SwitchFromFBTtoAIInte : MonoBehaviour { public SteamVR_TrackedObject Hip; public SteamVR_TrackedObject FootL; public SteamVR_TrackedObject FootR; public VRIK rig; public GrounderVRIK gd; public GameObject GX; public GameObject GZ; public GameObject GY; public WaggleJoint WagX; public WaggleJoint WagZ; public WaggleJoint WagY; public NeckRot NR; public Transform FBTfootLTarg; public Transform FBTfootRTarg; public Transform AIfootLTarg; public Transform AIfootRTarg; public Transform FootLTarg; public Transform FootRTarg; public Vector3 FootLRef; public Vector3 FootRRef; public float PelvisRef = 0f; public float PelvisWeight = 1f; public GameObject CrouchScript; public GameObject WalkingScript; public bool ismoving = false; public Vector3 curmove; public Vector3 lastmove; public bool grounded = false; public float cd = 0.25f; private void Start() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) curmove = ((Component)GM.CurrentPlayerRoot).transform.position; lastmove = ((Component)GM.CurrentPlayerRoot).transform.position; } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) curmove = ((Component)GM.CurrentPlayerRoot).transform.position; if (curmove != lastmove) { ismoving = true; } else if (curmove == lastmove) { ismoving = false; } lastmove = curmove; rig.solver.spine.pelvisPositionWeight = PelvisWeight; rig.solver.spine.pelvisRotationWeight = PelvisWeight; rig.solver.leftLeg.bendGoalWeight = PelvisWeight; rig.solver.rightLeg.bendGoalWeight = PelvisWeight; if (Hip.isValid && FootL.isValid && FootR.isValid && GM.CurrentMovementManager.m_isGrounded && !ismoving) { rig.solver.leftLeg.target = FootLTarg; rig.solver.rightLeg.target = FootRTarg; rig.solver.spine.bodyPosStiffness = 0.1f; ((Component)FootLTarg).transform.position = Vector3.SmoothDamp(((Component)FootLTarg).transform.position, ((Component)FBTfootLTarg).transform.position, ref FootLRef, 0.05f); ((Component)FootRTarg).transform.position = Vector3.SmoothDamp(((Component)FootRTarg).transform.position, ((Component)FBTfootRTarg).transform.position, ref FootRRef, 0.05f); PelvisWeight = Mathf.SmoothDamp(PelvisWeight, 1f, ref PelvisRef, 0.05f); rig.solver.leftLeg.rotationWeight = 1f; rig.solver.rightLeg.rotationWeight = 1f; rig.solver.leftLeg.positionWeight = 1f; rig.solver.rightLeg.positionWeight = 1f; rig.solver.leftLeg.bendGoalWeight = 1f; rig.solver.rightLeg.bendGoalWeight = 1f; rig.solver.locomotion.weight = 0f; gd.weight = 0f; ((Behaviour)NR).enabled = false; ((Behaviour)WagX).enabled = false; ((Behaviour)WagY).enabled = false; ((Behaviour)WagZ).enabled = false; GX.transform.localEulerAngles = new Vector3(-90f, 0f, 0f); GY.transform.localEulerAngles = new Vector3(0f, 0f, 0f); GZ.transform.localEulerAngles = new Vector3(-90f, 0f, 0f); CrouchScript.SetActive(false); WalkingScript.SetActive(false); } if (Hip.isValid && FootL.isValid && FootR.isValid && !ismoving) { return; } if (!GM.CurrentMovementManager.m_isGrounded) { rig.solver.leftLeg.target = AIfootLTarg; rig.solver.rightLeg.target = AIfootRTarg; PelvisWeight = Mathf.SmoothDamp(PelvisWeight, 0f, ref PelvisRef, 0.05f); rig.solver.spine.bodyPosStiffness = 1f; ((Component)FootLTarg).transform.position = Vector3.SmoothDamp(((Component)FootLTarg).transform.position, ((Component)AIfootLTarg).transform.position, ref FootLRef, 0.05f); ((Component)FootRTarg).transform.position = Vector3.SmoothDamp(((Component)FootRTarg).transform.position, ((Component)AIfootRTarg).transform.position, ref FootRRef, 0.05f); rig.solver.leftLeg.rotationWeight = 0f; rig.solver.rightLeg.rotationWeight = 0f; rig.solver.leftLeg.positionWeight = 0f; rig.solver.rightLeg.positionWeight = 0f; rig.solver.leftLeg.bendGoalWeight = 0f; rig.solver.rightLeg.bendGoalWeight = 0f; rig.solver.locomotion.weight = 1f; gd.weight = 1f; ((Behaviour)NR).enabled = true; ((Behaviour)WagX).enabled = true; ((Behaviour)WagY).enabled = true; ((Behaviour)WagZ).enabled = true; CrouchScript.SetActive(true); WalkingScript.SetActive(true); } else if (GM.CurrentMovementManager.m_isGrounded) { rig.solver.leftLeg.target = AIfootLTarg; rig.solver.rightLeg.target = AIfootRTarg; PelvisWeight = Mathf.SmoothDamp(PelvisWeight, 0f, ref PelvisRef, 0.05f); rig.solver.spine.bodyPosStiffness = 1f; ((Component)FootLTarg).transform.position = Vector3.SmoothDamp(((Component)FootLTarg).transform.position, ((Component)AIfootLTarg).transform.position, ref FootLRef, 0.05f); ((Component)FootRTarg).transform.position = Vector3.SmoothDamp(((Component)FootRTarg).transform.position, ((Component)AIfootRTarg).transform.position, ref FootRRef, 0.05f); rig.solver.leftLeg.rotationWeight = 0f; rig.solver.rightLeg.rotationWeight = 0f; rig.solver.leftLeg.positionWeight = 0f; rig.solver.rightLeg.positionWeight = 0f; rig.solver.leftLeg.bendGoalWeight = 0f; rig.solver.rightLeg.bendGoalWeight = 0f; rig.solver.locomotion.weight = 1f; gd.weight = 1f; if (ismoving) { rig.solver.locomotion.footDistance = 0.1f; } else if (!ismoving) { rig.solver.locomotion.footDistance = 0.25f; } ((Behaviour)NR).enabled = true; ((Behaviour)WagX).enabled = true; ((Behaviour)WagY).enabled = true; ((Behaviour)WagZ).enabled = true; CrouchScript.SetActive(true); WalkingScript.SetActive(true); } } } public class TitanGrab : MonoBehaviour { public GameObject[] fingers; public float[] vels; public float fingerclose; public float fingeropen; public bool grabbing = false; public AutoTitan T; public bool isLeft = false; [NonSerialized] public Vector3 vel; public Transform handpos; public Collider col; [NonSerialized] public GameObject obj; public bool grav; public bool isbarehands = true; private void OnTriggerStay(Collider other) { if (((Object)(object)((Component)other).gameObject.GetComponent() != (Object)null || (Object)(object)((Component)other).gameObject.GetComponent() != (Object)null) && grabbing) { obj = ((Component)other).gameObject; } } private void Update() { //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)obj != (Object)null) { if (!isLeft && (Object)(object)obj == (Object)(object)T.T203Prop) { obj.SetActive(false); T.isWeapon = true; } else if (isLeft || (Object)(object)obj == (Object)(object)T.T203Prop) { T.isWeapon = false; } if (grabbing) { obj.transform.position = Vector3.SmoothDamp(obj.transform.position, handpos.position, ref vel, 0.15f); obj.transform.eulerAngles = handpos.eulerAngles; } if ((Object)(object)obj.GetComponent() != (Object)null && obj.GetComponent().useGravity && !grav) { obj.GetComponent().useGravity = false; grav = true; } col.enabled = false; } if ((Object)(object)obj == (Object)null) { col.enabled = true; } if (T.isAuto || (isLeft && !T.isLeftGrab) || (!isLeft && !T.isRightGrab)) { for (int i = 0; i < fingers.Length; i++) { fingers[i].transform.localEulerAngles = new Vector3(0f, 0f, fingeropen); } grabbing = false; if ((Object)(object)obj != (Object)null) { if ((Object)(object)obj == (Object)(object)T.T203Prop && !obj.activeInHierarchy) { T.isWeapon = false; obj.SetActive(true); } if ((Object)(object)obj.gameObject.GetComponent() != (Object)null && grav) { obj.GetComponent().useGravity = true; } obj = null; grav = false; } } if (!T.isAuto && ((isLeft && T.isLeftGrab) || (!isLeft && T.isRightGrab))) { grabbing = true; for (int j = 0; j < fingers.Length; j++) { fingers[j].transform.localEulerAngles = new Vector3(0f, 0f, fingerclose); } } } } [RequireComponent(typeof(AudioSource))] public class UltimateVoiceChanger : MonoBehaviour { public enum VoiceMode { Normal, YoungGirl, DeepMale, Robot, Custom } [Header("音频设备设置")] public string selectedDevice; private const int SAMPLE_RATE = 44100; private const int BUFFER_SECONDS = 2; private int totalSamples; public int micorder; public AR15HandleSightFlipper mictoggle; public AR15HandleSightFlipper micpower; public bool isOn = false; public AudioEvent click; [Header("音色预设与控制")] public VoiceMode currentMode = VoiceMode.Normal; [Header("少女音色参数")] [Range(1f, 2f)] public float girlPitch = 1.5f; [Range(0f, 0.1f)] public float girlBreath = 0.02f; [Range(0.8f, 1.2f)] public float girlBrightness = 1.05f; [Range(0f, 0.5f)] public float girlWarmth = 0.1f; [Header("基础效果参数")] [Range(0.5f, 2f)] public float pitchShift = 1f; [Range(0f, 0.5f)] public float distortion = 0f; private AudioSource audioOutput; public AudioClip microphoneClip; public AudioClip processedClip; private float[] processingBuffer; private int lastMicPosition = 0; private bool isInitialized = false; private Queue inputQueue = new Queue(); private Queue outputQueue = new Queue(); private const int QUEUE_SIZE = 44100; [Range(0f, 0.1f)] public float noiseGateThreshold = 0.005f; private float noiseFloor = 0.001f; private float girlLPF = 0f; private float girlHPF = 0f; private float vibratoPhase = 0f; private void Start() { InitializeAudioSystem(); if ((Object)(object)mictoggle != (Object)null) { mictoggle.m_isLargeAperture = false; } SetYoungGirlPreset(); } private void InitializeAudioSystem() { //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown try { audioOutput = ((Component)this).GetComponent(); totalSamples = 88200; processingBuffer = new float[totalSamples]; if (Microphone.devices.Length == 0) { Debug.LogError((object)"未找到麦克风设备"); return; } micorder = Mathf.Clamp(micorder, 0, Microphone.devices.Length - 1); selectedDevice = Microphone.devices[micorder]; Debug.Log((object)("使用麦克风设备:" + selectedDevice)); microphoneClip = Microphone.Start(selectedDevice, true, 2, 44100); if ((Object)(object)microphoneClip == (Object)null) { Debug.LogError((object)"无法创建麦克风AudioClip"); return; } processedClip = AudioClip.Create("ProcessedVoice", 44100, 1, 44100, true, new PCMReaderCallback(OnAudioRead)); audioOutput.clip = processedClip; audioOutput.loop = true; inputQueue.Clear(); outputQueue.Clear(); ((MonoBehaviour)this).StartCoroutine(WaitForMicrophone()); } catch (Exception) { Debug.LogError((object)"音频系统初始化失败"); } } private void StopMicrophone() { if (!string.IsNullOrEmpty(selectedDevice) && Microphone.IsRecording(selectedDevice)) { Microphone.End(selectedDevice); } isInitialized = false; } private IEnumerator WaitForMicrophone() { float timeout = 3f; float timer = 0f; while (Microphone.GetPosition(selectedDevice) <= 0) { timer += Time.deltaTime; if (timer > timeout) { Debug.LogError((object)"麦克风初始化超时"); yield break; } yield return null; } isInitialized = true; audioOutput.Play(); Debug.Log((object)"音频系统初始化完成"); } private void Update() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) if (!isInitialized) { return; } if ((Object)(object)mictoggle != (Object)null && !mictoggle.m_isLargeAperture) { micorder = (micorder + 1) % Microphone.devices.Length; InitializeAudioSystem(); if (click != null) { SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).transform.position); } mictoggle.m_isLargeAperture = true; } if ((Object)(object)micpower != (Object)null && !micpower.m_isLargeAperture) { isOn = !isOn; if (click != null) { SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).transform.position); } micpower.m_isLargeAperture = true; if (!isOn) { inputQueue.Clear(); outputQueue.Clear(); audioOutput.pitch = 1f; } } audioOutput.volume = ((!isOn) ? 0f : 0.75f); UpdateAudioSourcePitch(); if (isOn && isInitialized) { ReadMicrophoneData(); ProcessBufferedData(); SetYoungGirlPreset(); } } private void UpdateAudioSourcePitch() { if (!isOn) { audioOutput.pitch = 1f; return; } switch (currentMode) { case VoiceMode.YoungGirl: audioOutput.pitch = girlPitch; break; case VoiceMode.DeepMale: audioOutput.pitch = 0.7f; break; case VoiceMode.Robot: audioOutput.pitch = 1f; break; default: audioOutput.pitch = pitchShift; break; } } private void ReadMicrophoneData() { if (!isInitialized || (Object)(object)microphoneClip == (Object)null) { return; } int position = Microphone.GetPosition(selectedDevice); if (position < 0) { return; } int num = ((position >= lastMicPosition) ? (position - lastMicPosition) : (totalSamples - lastMicPosition + position)); if (num <= 0) { return; } num = Mathf.Min(num, 1024); float[] data = new float[num]; int num2 = lastMicPosition; if (num2 + num <= totalSamples) { microphoneClip.GetData(data, num2); } else { int num3 = totalSamples - num2; float[] array = new float[num3]; microphoneClip.GetData(array, num2); int num4 = num - num3; float[] array2 = new float[num4]; microphoneClip.GetData(array2, 0); Array.Copy(array, 0, data, 0, num3); Array.Copy(array2, 0, data, num3, num4); } ApplyNoiseGate(ref data); lock (inputQueue) { float[] array3 = data; foreach (float item in array3) { inputQueue.Enqueue(item); } while (inputQueue.Count > 44100) { inputQueue.Dequeue(); } } lastMicPosition = (lastMicPosition + num) % totalSamples; } private void ProcessBufferedData() { lock (inputQueue) { if (inputQueue.Count <= 0) { return; } float[] input = inputQueue.ToArray(); inputQueue.Clear(); float[] array = ProcessVoiceColor(input); lock (outputQueue) { float[] array2 = array; foreach (float item in array2) { outputQueue.Enqueue(item); } while (outputQueue.Count > 44100) { outputQueue.Dequeue(); } } } } private void OnAudioRead(float[] data) { if (!isInitialized || !isOn) { for (int i = 0; i < data.Length; i++) { data[i] = 0f; } return; } lock (outputQueue) { if (outputQueue.Count < data.Length) { int count = outputQueue.Count; for (int j = 0; j < data.Length; j++) { if (j < count) { data[j] = outputQueue.Dequeue(); } else { data[j] = 0f; } } } else { for (int k = 0; k < data.Length; k++) { data[k] = outputQueue.Dequeue(); } } } ApplyFinalSmoothing(ref data); } private void ApplyNoiseGate(ref float[] data) { float num = 0f; for (int i = 0; i < data.Length; i++) { num += data[i] * data[i]; } num = Mathf.Sqrt(num / (float)data.Length); float num2 = Mathf.Max(noiseGateThreshold, noiseFloor * 2f); if (num < num2) { float num3 = Mathf.Clamp01(num / num2); num3 *= num3; for (int j = 0; j < data.Length; j++) { data[j] *= num3; } } noiseFloor = noiseFloor * 0.999f + num * 0.001f; } private void ApplyFinalSmoothing(ref float[] data) { float num = data[0]; for (int i = 1; i < data.Length; i++) { float num2 = data[i]; data[i] = num * 0.1f + num2 * 0.9f; num = data[i]; } } private float[] ProcessVoiceColor(float[] input) { float[] data = new float[input.Length]; switch (currentMode) { case VoiceMode.YoungGirl: data = ProcessYoungGirlColor(input); break; case VoiceMode.DeepMale: data = ProcessDeepMaleColor(input); break; case VoiceMode.Robot: data = ProcessRobotColor(input); break; default: Array.Copy(input, data, input.Length); break; } ApplyDistortion(ref data, distortion); ApplyLimiter(ref data); return data; } private float[] ProcessYoungGirlColor(float[] input) { float[] array = new float[input.Length]; float num = vibratoPhase; for (int i = 0; i < array.Length; i++) { float num2 = input[i]; if (i > 2) { float num3 = num2 * 0.6f + array[i - 1] * 0.25f + array[i - 2] * 0.1f + array[i - 3] * 0.05f; num2 = Mathf.Lerp(num2, num3, 0.15f); } if (i > 0) { float num4 = num2 - array[i - 1]; num2 += num4 * (girlBrightness - 1f) * 0.05f; } girlLPF = girlLPF * 0.98f + num2 * 0.02f; num2 = num2 * 0.95f + girlLPF * girlWarmth * 0.2f; if (girlBreath > 0.001f && i % 20 == 0) { float num5 = (Random.value * 2f - 1f) * 0.002f; girlHPF = num5 - girlHPF * 0.95f; num2 += girlHPF * girlBreath * 2f; } if (i % 100 < 50) { float num6 = Mathf.Sin(num) * 0.005f; num += 0.01f; num2 += num2 * num6; } array[i] = num2; } vibratoPhase = num; return array; } private float[] ProcessDeepMaleColor(float[] input) { float[] array = new float[input.Length]; for (int i = 0; i < array.Length; i++) { array[i] = input[i] * 1.05f; if (i > 0) { array[i] = array[i] * 0.9f + array[i - 1] * 0.1f; } if (i > 1) { float num = array[i] - array[i - 1] * 0.5f - array[i - 2] * 0.5f; array[i] += num * 0.08f; } } return array; } private float[] ProcessRobotColor(float[] input) { float[] array = new float[input.Length]; for (int i = 0; i < array.Length; i++) { float num = Mathf.Round(input[i] * 8f) / 8f; array[i] = input[i] * 0.6f + num * 0.4f; if (i > 22) { array[i] = array[i] * 0.85f + array[i - 22] * 0.15f; } } return array; } private void ApplyDistortion(ref float[] data, float amount) { if (amount < 0.005f) { return; } for (int i = 0; i < data.Length; i++) { float num = data[i] * (1f + amount * 0.3f); if (num > 1f) { data[i] = 0.6667f; } else if (num < -1f) { data[i] = -0.6667f; } else { data[i] = num - num * num * num / 3f; } } } private void ApplyLimiter(ref float[] data) { for (int i = 0; i < data.Length; i++) { float num = data[i]; if (num > 0.8f) { data[i] = 0.8f + (num - 0.8f) * 0.3f; } else if (num < -0.8f) { data[i] = -0.8f + (num + 0.8f) * 0.3f; } if (data[i] > 0.95f) { data[i] = 0.95f; } if (data[i] < -0.95f) { data[i] = -0.95f; } } } private void OnDestroy() { StopMicrophone(); } public void SetVoiceMode(VoiceMode mode) { currentMode = mode; Debug.Log((object)("切换到音色模式: " + mode)); } public void SetYoungGirlPreset(string type = "default") { currentMode = VoiceMode.YoungGirl; switch (type) { case "clear": girlPitch = 1.4f; girlBreath = 0.01f; girlBrightness = 1.03f; girlWarmth = 0.05f; break; case "cute": girlPitch = 1.6f; girlBreath = 0.02f; girlBrightness = 1.02f; girlWarmth = 0.08f; break; default: girlPitch = 1.4f; girlBreath = 0.015f; girlBrightness = 1.025f; girlWarmth = 0.06f; break; } } } public class UnFreeze : MonoBehaviour { private Rigidbody rig; private void Start() { if ((Object)(object)((Component)this).gameObject.GetComponent() != (Object)null) { rig = ((Component)this).gameObject.GetComponent(); } } private void Update() { if ((Object)(object)rig != (Object)null) { rig.isKinematic = false; rig.useGravity = true; } } } } namespace JerryLegsIK { public class VRIKFullBodyController : MonoBehaviour { public VRIK vrik; public LayerMask groundLayer = LayerMask.op_Implicit(1); [Header("Foot Placement Settings")] public float footOffset = 0.1f; public float maxStepHeight = 0.3f; public float footSpeed = 5f; public float prediction = 0.05f; public float footRadius = 0.1f; [Header("Pelvis Settings")] public float pelvisSpeed = 3f; public float pelvisOffset = 0.1f; private Vector3[] footPositions = (Vector3[])(object)new Vector3[2]; private Quaternion[] footRotations = (Quaternion[])(object)new Quaternion[2]; private float lastPelvisOffset; private void Start() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)vrik == (Object)null) { vrik = ((Component)this).GetComponent(); } for (int i = 0; i < 2; i++) { ref Vector3 reference = ref footPositions[i]; reference = Vector3.zero; ref Quaternion reference2 = ref footRotations[i]; reference2 = Quaternion.identity; } } private void Update() { UpdateFootPlacement(); } private void UpdateFootPlacement() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) RaycastHit val3 = default(RaycastHit); for (int i = 0; i < 2; i++) { Transform val = ((i != 0) ? vrik.references.rightFoot : vrik.references.leftFoot); Vector3 val2 = val.position + Vector3.up * maxStepHeight; if (Physics.SphereCast(val2, footRadius, Vector3.down, ref val3, maxStepHeight * 2f, LayerMask.op_Implicit(groundLayer))) { Debug.DrawLine(val2, ((RaycastHit)(ref val3)).point, Color.green); Vector3 val4 = ((RaycastHit)(ref val3)).point + Vector3.up * footOffset; Quaternion val5 = Quaternion.FromToRotation(Vector3.up, ((RaycastHit)(ref val3)).normal) * val.rotation; ref Vector3 reference = ref footPositions[i]; reference = Vector3.Lerp(footPositions[i], val4, footSpeed * Time.deltaTime); ref Quaternion reference2 = ref footRotations[i]; reference2 = Quaternion.Slerp(footRotations[i], val5, footSpeed * Time.deltaTime); if (i == 0) { vrik.solver.leftLeg.target.position = footPositions[i]; vrik.solver.leftLeg.target.rotation = footRotations[i]; } else { vrik.solver.rightLeg.target.position = footPositions[i]; vrik.solver.rightLeg.target.rotation = footRotations[i]; } } } AdjustPelvisHeight(); } private void AdjustPelvisHeight() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) float y = vrik.solver.leftLeg.target.position.y; float y2 = vrik.solver.rightLeg.target.position.y; float num = (y + y2) / 2f; float num2 = Mathf.Clamp(num - ((Component)this).transform.position.y, 0f - pelvisOffset, pelvisOffset); lastPelvisOffset = Mathf.Lerp(lastPelvisOffset, num2, pelvisSpeed * Time.deltaTime); Vector3 position = vrik.references.pelvis.position; position.y += lastPelvisOffset; vrik.references.pelvis.position = position; } private void OnDrawGizmos() { if ((Object)(object)vrik != (Object)null && vrik.references != null) { DrawFootGizmos(vrik.references.leftFoot); DrawFootGizmos(vrik.references.rightFoot); } } private void DrawFootGizmos(Transform foot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.blue; Vector3 val = foot.position + Vector3.up * maxStepHeight; Gizmos.DrawWireSphere(val, footRadius); Gizmos.DrawLine(val, val + Vector3.down * maxStepHeight * 2f); } } public class VRMAP : MonoBehaviour { public Transform vrTarget; public Transform rigTarget; public Vector3 trackingPositionOffset; public Vector3 trackingRotationOffset; public void Map() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) rigTarget.position = vrTarget.TransformPoint(trackingPositionOffset); rigTarget.rotation = vrTarget.rotation * Quaternion.Euler(trackingRotationOffset); } private void Start() { } private void Update() { } } public class VRRIG : MonoBehaviour { public VRMAP head; public Transform headConstraint; public Vector3 headBodyOffset; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) headBodyOffset = ((Component)this).transform.position - headConstraint.position; } private void Update() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = headConstraint.position + headBodyOffset; Transform transform = ((Component)this).transform; Vector3 val = Vector3.ProjectOnPlane(headConstraint.up, Vector3.up); transform.forward = ((Vector3)(ref val)).normalized; head.Map(); } } public class VRanimatorcontroller : MonoBehaviour { public float speedTreshold = 0.1f; [Range(0f, 1f)] public float smoothing = 1f; private Animator animator; private Vector3 previouspos; private VRRIG vrRig; public Jump jumppin; private void Start() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) animator = ((Component)this).GetComponent(); vrRig = ((Component)this).GetComponent(); previouspos = vrRig.head.vrTarget.position; } private void Update() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (vrRig.head.vrTarget.position - previouspos) / Time.deltaTime; val.y = 0f; Vector3 val2 = ((Component)this).transform.InverseTransformDirection(val); previouspos = vrRig.head.vrTarget.position; float num = animator.GetFloat("D_X"); float num2 = animator.GetFloat("D_Y"); animator.SetBool("IsMoving", ((Vector3)(ref val2)).magnitude > speedTreshold); animator.SetFloat("D_X", Mathf.Lerp(num, Mathf.Clamp(val2.x, -99f, 99f), smoothing)); animator.SetFloat("D_Y", Mathf.Lerp(num2, Mathf.Clamp(val2.z, -99f, 99f), smoothing)); } } } namespace JerryComponent { public class Wallrunningcollider : MonoBehaviour { public PilotJumpKitOnBody _PJKOB; public LayerMask mask; private void Update() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) if (_PJKOB.isWallrunning) { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical")); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 position = ((Component)GM.CurrentPlayerBody).gameObject.transform.position + normalized; if (Physics.Raycast(((Component)GM.CurrentPlayerBody).gameObject.transform.position, -((Component)GM.CurrentPlayerBody).gameObject.transform.right, 0.5f, LayerMask.op_Implicit(mask))) { position.x = ((Component)GM.CurrentPlayerBody).gameObject.transform.position.x; } if (Physics.Raycast(((Component)GM.CurrentPlayerBody).gameObject.transform.position, ((Component)GM.CurrentPlayerBody).gameObject.transform.right, 0.5f, LayerMask.op_Implicit(mask))) { position.x = ((Component)GM.CurrentPlayerBody).gameObject.transform.position.x; } ((Component)GM.CurrentPlayerBody).gameObject.transform.position = position; } } } public class Watch : MonoBehaviour { public GameObject hour; public GameObject minute; public GameObject second; private void Start() { } private void FixedUpdate() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) second.transform.localEulerAngles = new Vector3(0f, (float)DateTime.Now.Second * 6f, 0f); minute.transform.localEulerAngles = new Vector3(0f, (float)DateTime.Now.Minute * 6f, 0f); hour.transform.localEulerAngles = new Vector3(0f, (float)DateTime.Now.Hour * 30f, 0f); } } public class XandZlimit : MonoBehaviour { public GameObject Main; public GameObject GO1; public GameObject GO2; public GameObject GO3; public GameObject GO4; public GameObject GO5; public GameObject GO6; public GameObject GO7; public GameObject GO8; public GameObject GO9; public GameObject GO10; public GameObject Root; public GameObject headref; private void Start() { GO1.transform.SetParent((Transform)null); GO2.transform.SetParent((Transform)null); GO3.transform.SetParent((Transform)null); GO4.transform.SetParent((Transform)null); GO5.transform.SetParent((Transform)null); GO6.transform.SetParent((Transform)null); GO7.transform.SetParent((Transform)null); GO8.transform.SetParent((Transform)null); GO9.transform.SetParent((Transform)null); GO10.transform.SetParent((Transform)null); Root.transform.SetParent((Transform)null); headref.transform.SetParent((Transform)null); } private void Update() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) headref.transform.position = GO1.transform.position; headref.transform.eulerAngles = GO1.transform.eulerAngles; if ((Object)(object)Main.GetComponent() != (Object)null || (Object)(object)Main.GetComponent() != (Object)null) { Object.Destroy((Object)(object)Main); } if ((Object)(object)GO1 == (Object)null || (Object)(object)GO2 == (Object)null || (Object)(object)GO3 == (Object)null || (Object)(object)GO4 == (Object)null || (Object)(object)GO5 == (Object)null || (Object)(object)GO6 == (Object)null || (Object)(object)GO7 == (Object)null || (Object)(object)GO8 == (Object)null || (Object)(object)GO9 == (Object)null || (Object)(object)GO10 == (Object)null || (Object)(object)Root == (Object)null || (Object)(object)headref == (Object)null) { Object.Destroy((Object)(object)Main); } } private void OnDestroy() { Object.Destroy((Object)(object)GO1); Object.Destroy((Object)(object)GO2); Object.Destroy((Object)(object)GO3); Object.Destroy((Object)(object)GO4); Object.Destroy((Object)(object)GO5); Object.Destroy((Object)(object)GO6); Object.Destroy((Object)(object)GO7); Object.Destroy((Object)(object)GO8); Object.Destroy((Object)(object)GO9); Object.Destroy((Object)(object)GO10); Object.Destroy((Object)(object)Root); Object.Destroy((Object)(object)headref); } } public class control_component : MonoBehaviour { public GameObject Comp; public GameObject Comp2; public GameObject Rot; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (Rot.transform.localEulerAngles.x >= 45f) { Comp.SetActive(false); Comp2.SetActive(true); } else { Comp.SetActive(true); Comp2.SetActive(false); } } } } namespace JerryFBT2 { public class trackerorder : MonoBehaviour { public SteamVR_TrackedObject tracker; public EIndex order; public bool started = false; private void Start() { if (((Behaviour)tracker).enabled) { started = true; } } private void FixedUpdate() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (started) { tracker.index = order; } } } } public class Portal : MonoBehaviour { private void Start() { } private void Update() { } } public class SceneLoader : MonoBehaviour { private void OnGUI() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) GUI.Box(new Rect(10f, (float)(Screen.height - 100), 100f, 90f), "Change Scene"); if (GUI.Button(new Rect(20f, (float)(Screen.height - 70), 80f, 20f), "Next")) { LoadNextScene(); } if (GUI.Button(new Rect(20f, (float)(Screen.height - 40), 80f, 20f), "Back")) { LoadPreScene(); } } private void LoadPreScene() { int num = Application.loadedLevel + 1; if (num <= 1) { num = Application.levelCount; } Application.LoadLevel(num); } private void LoadNextScene() { int num = Application.loadedLevel + 1; if (num >= Application.levelCount) { num = 1; } Application.LoadLevel(num); } } namespace JerryComponent { public class AIdie : MonoBehaviour { public GameObject sosig; public GameObject body; public Sosig gosig; public GameObject deathbody; public GameObject explosion; public GameObject explode; public Transform bodypos; public Transform exppos; private void Start() { } private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if ((int)gosig.BodyState == 3) { Object.Instantiate(deathbody, bodypos.position, bodypos.rotation); Object.Instantiate(explode, exppos.position, exppos.rotation); Object.Instantiate(explosion, exppos.position, exppos.rotation); Object.Destroy((Object)(object)body); Object.Destroy((Object)(object)sosig); } } } public class colliderDestroy : MonoBehaviour { public Collider col1; public Collider col2; public Collider col3; public Collider col4; public Collider col5; public Collider col6; public Collider col7; public Collider col8; public Collider col9; public Collider col10; public float timer; private float time = 0f; private void Start() { } private void Update() { time += Time.deltaTime; if ((Object)(object)col1 == (Object)null || (Object)(object)col2 == (Object)null || (Object)(object)col3 == (Object)null || (Object)(object)col4 == (Object)null || (Object)(object)col5 == (Object)null || (Object)(object)col6 == (Object)null || (Object)(object)col7 == (Object)null || (Object)(object)col8 == (Object)null || (Object)(object)col9 == (Object)null || (Object)(object)col10 == (Object)null) { } if (time >= timer) { Object.Destroy((Object)(object)col1); Object.Destroy((Object)(object)col2); Object.Destroy((Object)(object)col3); Object.Destroy((Object)(object)col4); Object.Destroy((Object)(object)col5); Object.Destroy((Object)(object)col6); Object.Destroy((Object)(object)col7); Object.Destroy((Object)(object)col8); Object.Destroy((Object)(object)col9); Object.Destroy((Object)(object)col10); } } } public class RoninSkill : MonoBehaviour { public Kick kick; public GameObject _FWaudio; public GameObject Rot; public GameObject _EMPWave; public Transform _Wavepos; private bool waveed = true; private bool waverdy = false; private float timeW = 0f; private float timeWt = 7.5f; private void Start() { } private void Update() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) if (waveed) { if (timeWt < 15f) { timeWt += Time.deltaTime; _FWaudio.SetActive(false); } if (timeWt >= 15f) { waverdy = true; _FWaudio.SetActive(true); } } if (!(Rot.transform.localEulerAngles.x >= 45f) || !waverdy || !GM.CurrentMovementManager.Hands[0].Input.GripPressed || !GM.CurrentMovementManager.Hands[0].Input.TriggerPressed || !((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null)) { return; } if (((Component)kick._KHandL).transform.localPosition.y < 0.1f) { timeW += Time.deltaTime; if (timeW >= 0.5f) { waveed = false; } } if (kick.speedL >= 2f && !waveed) { Object.Instantiate(_EMPWave, _Wavepos.position, _Wavepos.rotation); timeW = 0f; timeWt = 0f; waveed = true; waverdy = false; } } } } namespace RootMotion { public class TQ { public Vector3 t; public Quaternion q; public TQ(Vector3 translation, Quaternion rotation) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) t = translation; q = rotation; } } public class AvatarUtility { public static Quaternion GetPostRotation(Avatar avatar, AvatarIKGoal avatarIKGoal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected I4, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) int num = (int)HumanIDFromAvatarIKGoal(avatarIKGoal); if (num == 55) { throw new InvalidOperationException("Invalid human id."); } MethodInfo method = typeof(Avatar).GetMethod("GetPostRotation", BindingFlags.Instance | BindingFlags.NonPublic); if ((object)method == null) { throw new InvalidOperationException("Cannot find GetPostRotation method."); } return (Quaternion)method.Invoke(avatar, new object[1] { num }); } public static TQ GetIKGoalTQ(Avatar avatar, float humanScale, AvatarIKGoal avatarIKGoal, TQ bodyPositionRotation, TQ boneTQ) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected I4, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Invalid comparison between Unknown and I4 //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) int num = (int)HumanIDFromAvatarIKGoal(avatarIKGoal); if (num == 55) { throw new InvalidOperationException("Invalid human id."); } MethodInfo method = typeof(Avatar).GetMethod("GetAxisLength", BindingFlags.Instance | BindingFlags.NonPublic); if ((object)method == null) { throw new InvalidOperationException("Cannot find GetAxisLength method."); } MethodInfo method2 = typeof(Avatar).GetMethod("GetPostRotation", BindingFlags.Instance | BindingFlags.NonPublic); if ((object)method2 == null) { throw new InvalidOperationException("Cannot find GetPostRotation method."); } Quaternion val = (Quaternion)method2.Invoke(avatar, new object[1] { num }); TQ tQ = new TQ(boneTQ.t, boneTQ.q * val); if ((int)avatarIKGoal == 0 || (int)avatarIKGoal == 1) { float num2 = (float)method.Invoke(avatar, new object[1] { num }); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(num2, 0f, 0f); tQ.t += tQ.q * val2; } Quaternion val3 = Quaternion.Inverse(bodyPositionRotation.q); tQ.t = val3 * (tQ.t - bodyPositionRotation.t); tQ.q = val3 * tQ.q; tQ.t /= humanScale; tQ.q = Quaternion.LookRotation(tQ.q * Vector3.forward, tQ.q * Vector3.up); return tQ; } public static HumanBodyBones HumanIDFromAvatarIKGoal(AvatarIKGoal avatarIKGoal) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected I4, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) HumanBodyBones result = (HumanBodyBones)55; switch ((int)avatarIKGoal) { case 0: result = (HumanBodyBones)5; break; case 1: result = (HumanBodyBones)6; break; case 2: result = (HumanBodyBones)17; break; case 3: result = (HumanBodyBones)18; break; } return result; } } public static class BakerUtilities { public static void ReduceKeyframes(AnimationCurve curve, float maxError) { if (!(maxError <= 0f)) { curve.keys = GetReducedKeyframes(curve, maxError); } } public static Keyframe[] GetReducedKeyframes(AnimationCurve curve, float maxError) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) Keyframe[] array = curve.keys; int num = 1; while (num < array.Length - 1 && array.Length > 2) { Keyframe[] array2 = (Keyframe[])(object)new Keyframe[array.Length - 1]; int num2 = 0; for (int i = 0; i < array.Length; i++) { if (num != i) { ref Keyframe reference = ref array2[num2]; reference = new Keyframe(((Keyframe)(ref array[i])).time, ((Keyframe)(ref array[i])).value, ((Keyframe)(ref array[i])).inTangent, ((Keyframe)(ref array[i])).outTangent); num2++; } } AnimationCurve val = new AnimationCurve(); val.keys = array2; float num3 = Mathf.Abs(val.Evaluate(((Keyframe)(ref array[num])).time) - ((Keyframe)(ref array[num])).value); float num4 = ((Keyframe)(ref array[num])).time + (((Keyframe)(ref array[num - 1])).time - ((Keyframe)(ref array[num])).time) * 0.5f; float num5 = ((Keyframe)(ref array[num])).time + (((Keyframe)(ref array[num + 1])).time - ((Keyframe)(ref array[num])).time) * 0.5f; float num6 = Mathf.Abs(val.Evaluate(num4) - curve.Evaluate(num4)); float num7 = Mathf.Abs(val.Evaluate(num5) - curve.Evaluate(num5)); if (num3 < maxError && num6 < maxError && num7 < maxError) { array = array2; } else { num++; } } return array; } public static void SetLoopFrame(float time, AnimationCurve curve) { Keyframe[] keys = curve.keys; ((Keyframe)(ref keys[^1])).value = ((Keyframe)(ref keys[0])).value; float inTangent = Mathf.Lerp(((Keyframe)(ref keys[0])).inTangent, ((Keyframe)(ref keys[^1])).inTangent, 0.5f); ((Keyframe)(ref keys[0])).inTangent = inTangent; ((Keyframe)(ref keys[^1])).inTangent = inTangent; float outTangent = Mathf.Lerp(((Keyframe)(ref keys[0])).outTangent, ((Keyframe)(ref keys[^1])).outTangent, 0.5f); ((Keyframe)(ref keys[0])).outTangent = outTangent; ((Keyframe)(ref keys[^1])).outTangent = outTangent; ((Keyframe)(ref keys[^1])).time = time; curve.keys = keys; } public static void SetTangentMode(AnimationCurve curve) { } public static Quaternion EnsureQuaternionContinuity(Quaternion lastQ, Quaternion q) { //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) Quaternion val = default(Quaternion); ((Quaternion)(ref val))..ctor(0f - q.x, 0f - q.y, 0f - q.z, 0f - q.w); Quaternion val2 = default(Quaternion); ((Quaternion)(ref val2))..ctor(Mathf.Lerp(lastQ.x, q.x, 0.5f), Mathf.Lerp(lastQ.y, q.y, 0.5f), Mathf.Lerp(lastQ.z, q.z, 0.5f), Mathf.Lerp(lastQ.w, q.w, 0.5f)); Quaternion val3 = default(Quaternion); ((Quaternion)(ref val3))..ctor(Mathf.Lerp(lastQ.x, val.x, 0.5f), Mathf.Lerp(lastQ.y, val.y, 0.5f), Mathf.Lerp(lastQ.z, val.z, 0.5f), Mathf.Lerp(lastQ.w, val.w, 0.5f)); float num = Quaternion.Angle(lastQ, val2); float num2 = Quaternion.Angle(lastQ, val3); return (!(num2 < num)) ? q : val; } } [Serializable] public class BakerHumanoidQT { private Transform transform; private string Qx; private string Qy; private string Qz; private string Qw; private string Tx; private string Ty; private string Tz; public AnimationCurve rotX; public AnimationCurve rotY; public AnimationCurve rotZ; public AnimationCurve rotW; public AnimationCurve posX; public AnimationCurve posY; public AnimationCurve posZ; private AvatarIKGoal goal; private Quaternion lastQ; private bool lastQSet; public BakerHumanoidQT(string name) { Qx = name + "Q.x"; Qy = name + "Q.y"; Qz = name + "Q.z"; Qw = name + "Q.w"; Tx = name + "T.x"; Ty = name + "T.y"; Tz = name + "T.z"; Reset(); } public BakerHumanoidQT(Transform transform, AvatarIKGoal goal, string name) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) this.transform = transform; this.goal = goal; Qx = name + "Q.x"; Qy = name + "Q.y"; Qz = name + "Q.z"; Qw = name + "Q.w"; Tx = name + "T.x"; Ty = name + "T.y"; Tz = name + "T.z"; Reset(); } public void Reset() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) rotX = new AnimationCurve(); rotY = new AnimationCurve(); rotZ = new AnimationCurve(); rotW = new AnimationCurve(); posX = new AnimationCurve(); posY = new AnimationCurve(); posZ = new AnimationCurve(); lastQ = Quaternion.identity; lastQSet = false; } public void SetIKKeyframes(float time, Avatar avatar, Transform root, float humanScale, Vector3 bodyPosition, Quaternion bodyRotation) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) Vector3 val = transform.position; Quaternion val2 = transform.rotation; if ((Object)(object)root.parent != (Object)null) { val = root.parent.InverseTransformPoint(val); val2 = Quaternion.Inverse(root.parent.rotation) * val2; } TQ iKGoalTQ = AvatarUtility.GetIKGoalTQ(avatar, humanScale, goal, new TQ(bodyPosition, bodyRotation), new TQ(val, val2)); Quaternion val3 = iKGoalTQ.q; if (lastQSet) { val3 = BakerUtilities.EnsureQuaternionContinuity(lastQ, iKGoalTQ.q); } lastQ = val3; lastQSet = true; rotX.AddKey(time, val3.x); rotY.AddKey(time, val3.y); rotZ.AddKey(time, val3.z); rotW.AddKey(time, val3.w); Vector3 t = iKGoalTQ.t; posX.AddKey(time, t.x); posY.AddKey(time, t.y); posZ.AddKey(time, t.z); } public void SetKeyframes(float time, Vector3 pos, Quaternion rot) { rotX.AddKey(time, rot.x); rotY.AddKey(time, rot.y); rotZ.AddKey(time, rot.z); rotW.AddKey(time, rot.w); posX.AddKey(time, pos.x); posY.AddKey(time, pos.y); posZ.AddKey(time, pos.z); } public void MoveLastKeyframes(float time) { MoveLastKeyframe(time, rotX); MoveLastKeyframe(time, rotY); MoveLastKeyframe(time, rotZ); MoveLastKeyframe(time, rotW); MoveLastKeyframe(time, posX); MoveLastKeyframe(time, posY); MoveLastKeyframe(time, posZ); } public void SetLoopFrame(float time) { BakerUtilities.SetLoopFrame(time, rotX); BakerUtilities.SetLoopFrame(time, rotY); BakerUtilities.SetLoopFrame(time, rotZ); BakerUtilities.SetLoopFrame(time, rotW); BakerUtilities.SetLoopFrame(time, posX); BakerUtilities.SetLoopFrame(time, posY); BakerUtilities.SetLoopFrame(time, posZ); } private void MoveLastKeyframe(float time, AnimationCurve curve) { Keyframe[] keys = curve.keys; ((Keyframe)(ref keys[^1])).time = time; curve.keys = keys; } public void MultiplyLength(AnimationCurve curve, float mlp) { Keyframe[] keys = curve.keys; for (int i = 0; i < keys.Length; i++) { ref Keyframe reference = ref keys[i]; ((Keyframe)(ref reference)).time = ((Keyframe)(ref reference)).time * mlp; } curve.keys = keys; } public void SetCurves(ref AnimationClip clip, float maxError, float lengthMlp) { MultiplyLength(rotX, lengthMlp); MultiplyLength(rotY, lengthMlp); MultiplyLength(rotZ, lengthMlp); MultiplyLength(rotW, lengthMlp); MultiplyLength(posX, lengthMlp); MultiplyLength(posY, lengthMlp); MultiplyLength(posZ, lengthMlp); BakerUtilities.ReduceKeyframes(rotX, maxError); BakerUtilities.ReduceKeyframes(rotY, maxError); BakerUtilities.ReduceKeyframes(rotZ, maxError); BakerUtilities.ReduceKeyframes(rotW, maxError); BakerUtilities.ReduceKeyframes(posX, maxError); BakerUtilities.ReduceKeyframes(posY, maxError); BakerUtilities.ReduceKeyframes(posZ, maxError); BakerUtilities.SetTangentMode(rotX); BakerUtilities.SetTangentMode(rotY); BakerUtilities.SetTangentMode(rotZ); BakerUtilities.SetTangentMode(rotW); clip.SetCurve(string.Empty, typeof(Animator), Qx, rotX); clip.SetCurve(string.Empty, typeof(Animator), Qy, rotY); clip.SetCurve(string.Empty, typeof(Animator), Qz, rotZ); clip.SetCurve(string.Empty, typeof(Animator), Qw, rotW); clip.SetCurve(string.Empty, typeof(Animator), Tx, posX); clip.SetCurve(string.Empty, typeof(Animator), Ty, posY); clip.SetCurve(string.Empty, typeof(Animator), Tz, posZ); } } [Serializable] public class BakerMuscle { public AnimationCurve curve; private int muscleIndex = -1; private string propertyName; public BakerMuscle(int muscleIndex) { this.muscleIndex = muscleIndex; propertyName = MuscleNameToPropertyName(HumanTrait.MuscleName[muscleIndex]); Reset(); } private string MuscleNameToPropertyName(string n) { return n switch { "Left Index 1 Stretched" => "LeftHand.Index.1 Stretched", "Left Index 2 Stretched" => "LeftHand.Index.2 Stretched", "Left Index 3 Stretched" => "LeftHand.Index.3 Stretched", "Left Middle 1 Stretched" => "LeftHand.Middle.1 Stretched", "Left Middle 2 Stretched" => "LeftHand.Middle.2 Stretched", "Left Middle 3 Stretched" => "LeftHand.Middle.3 Stretched", "Left Ring 1 Stretched" => "LeftHand.Ring.1 Stretched", "Left Ring 2 Stretched" => "LeftHand.Ring.2 Stretched", "Left Ring 3 Stretched" => "LeftHand.Ring.3 Stretched", "Left Little 1 Stretched" => "LeftHand.Little.1 Stretched", "Left Little 2 Stretched" => "LeftHand.Little.2 Stretched", "Left Little 3 Stretched" => "LeftHand.Little.3 Stretched", "Left Thumb 1 Stretched" => "LeftHand.Thumb.1 Stretched", "Left Thumb 2 Stretched" => "LeftHand.Thumb.2 Stretched", "Left Thumb 3 Stretched" => "LeftHand.Thumb.3 Stretched", "Left Index Spread" => "LeftHand.Index.Spread", "Left Middle Spread" => "LeftHand.Middle.Spread", "Left Ring Spread" => "LeftHand.Ring.Spread", "Left Little Spread" => "LeftHand.Little.Spread", "Left Thumb Spread" => "LeftHand.Thumb.Spread", "Right Index 1 Stretched" => "RightHand.Index.1 Stretched", "Right Index 2 Stretched" => "RightHand.Index.2 Stretched", "Right Index 3 Stretched" => "RightHand.Index.3 Stretched", "Right Middle 1 Stretched" => "RightHand.Middle.1 Stretched", "Right Middle 2 Stretched" => "RightHand.Middle.2 Stretched", "Right Middle 3 Stretched" => "RightHand.Middle.3 Stretched", "Right Ring 1 Stretched" => "RightHand.Ring.1 Stretched", "Right Ring 2 Stretched" => "RightHand.Ring.2 Stretched", "Right Ring 3 Stretched" => "RightHand.Ring.3 Stretched", "Right Little 1 Stretched" => "RightHand.Little.1 Stretched", "Right Little 2 Stretched" => "RightHand.Little.2 Stretched", "Right Little 3 Stretched" => "RightHand.Little.3 Stretched", "Right Thumb 1 Stretched" => "RightHand.Thumb.1 Stretched", "Right Thumb 2 Stretched" => "RightHand.Thumb.2 Stretched", "Right Thumb 3 Stretched" => "RightHand.Thumb.3 Stretched", "Right Index Spread" => "RightHand.Index.Spread", "Right Middle Spread" => "RightHand.Middle.Spread", "Right Ring Spread" => "RightHand.Ring.Spread", "Right Little Spread" => "RightHand.Little.Spread", "Right Thumb Spread" => "RightHand.Thumb.Spread", _ => n, }; } public void MultiplyLength(AnimationCurve curve, float mlp) { Keyframe[] keys = curve.keys; for (int i = 0; i < keys.Length; i++) { ref Keyframe reference = ref keys[i]; ((Keyframe)(ref reference)).time = ((Keyframe)(ref reference)).time * mlp; } curve.keys = keys; } public void SetCurves(ref AnimationClip clip, float maxError, float lengthMlp) { MultiplyLength(curve, lengthMlp); BakerUtilities.ReduceKeyframes(curve, maxError); clip.SetCurve(string.Empty, typeof(Animator), propertyName, curve); } public void Reset() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown curve = new AnimationCurve(); } public void SetKeyframe(float time, float[] muscles) { curve.AddKey(time, muscles[muscleIndex]); } public void SetLoopFrame(float time) { BakerUtilities.SetLoopFrame(time, curve); } } [Serializable] public class BakerTransform { public Transform transform; public AnimationCurve posX; public AnimationCurve posY; public AnimationCurve posZ; public AnimationCurve rotX; public AnimationCurve rotY; public AnimationCurve rotZ; public AnimationCurve rotW; private string relativePath; private bool recordPosition; private Vector3 relativePosition; private bool isRootNode; private Quaternion relativeRotation; public BakerTransform(Transform transform, Transform root, bool recordPosition, bool isRootNode) { this.transform = transform; this.recordPosition = recordPosition || isRootNode; this.isRootNode = isRootNode; relativePath = string.Empty; Reset(); } public void SetRelativeSpace(Vector3 position, Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) relativePosition = position; relativeRotation = rotation; } public void SetCurves(ref AnimationClip clip) { if (recordPosition) { clip.SetCurve(relativePath, typeof(Transform), "localPosition.x", posX); clip.SetCurve(relativePath, typeof(Transform), "localPosition.y", posY); clip.SetCurve(relativePath, typeof(Transform), "localPosition.z", posZ); } clip.SetCurve(relativePath, typeof(Transform), "localRotation.x", rotX); clip.SetCurve(relativePath, typeof(Transform), "localRotation.y", rotY); clip.SetCurve(relativePath, typeof(Transform), "localRotation.z", rotZ); clip.SetCurve(relativePath, typeof(Transform), "localRotation.w", rotW); if (isRootNode) { AddRootMotionCurves(ref clip); } clip.EnsureQuaternionContinuity(); } private void AddRootMotionCurves(ref AnimationClip clip) { if (recordPosition) { clip.SetCurve("", typeof(Animator), "MotionT.x", posX); clip.SetCurve("", typeof(Animator), "MotionT.y", posY); clip.SetCurve("", typeof(Animator), "MotionT.z", posZ); } clip.SetCurve("", typeof(Animator), "MotionQ.x", rotX); clip.SetCurve("", typeof(Animator), "MotionQ.y", rotY); clip.SetCurve("", typeof(Animator), "MotionQ.z", rotZ); clip.SetCurve("", typeof(Animator), "MotionQ.w", rotW); } public void Reset() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown posX = new AnimationCurve(); posY = new AnimationCurve(); posZ = new AnimationCurve(); rotX = new AnimationCurve(); rotY = new AnimationCurve(); rotZ = new AnimationCurve(); rotW = new AnimationCurve(); } public void ReduceKeyframes(float maxError) { BakerUtilities.ReduceKeyframes(rotX, maxError); BakerUtilities.ReduceKeyframes(rotY, maxError); BakerUtilities.ReduceKeyframes(rotZ, maxError); BakerUtilities.ReduceKeyframes(rotW, maxError); BakerUtilities.ReduceKeyframes(posX, maxError); BakerUtilities.ReduceKeyframes(posY, maxError); BakerUtilities.ReduceKeyframes(posZ, maxError); } public void SetKeyframes(float time) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (recordPosition) { Vector3 val = transform.localPosition; if (isRootNode) { val = transform.position - relativePosition; } posX.AddKey(time, val.x); posY.AddKey(time, val.y); posZ.AddKey(time, val.z); } Quaternion val2 = transform.localRotation; if (isRootNode) { val2 = Quaternion.Inverse(relativeRotation) * transform.rotation; } rotX.AddKey(time, val2.x); rotY.AddKey(time, val2.y); rotZ.AddKey(time, val2.z); rotW.AddKey(time, val2.w); } public void AddLoopFrame(float time) { if (recordPosition && !isRootNode) { posX.AddKey(time, ((Keyframe)(ref posX.keys[0])).value); posY.AddKey(time, ((Keyframe)(ref posY.keys[0])).value); posZ.AddKey(time, ((Keyframe)(ref posZ.keys[0])).value); } rotX.AddKey(time, ((Keyframe)(ref rotX.keys[0])).value); rotY.AddKey(time, ((Keyframe)(ref rotY.keys[0])).value); rotZ.AddKey(time, ((Keyframe)(ref rotZ.keys[0])).value); rotW.AddKey(time, ((Keyframe)(ref rotW.keys[0])).value); } } } namespace RootMotion.Demos { public class FKOffset : MonoBehaviour { [Serializable] public class Offset { [HideInInspector] public string name; public HumanBodyBones bone; public Vector3 rotationOffset; private Transform t; public void Apply(Animator animator) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)t == (Object)null) { t = animator.GetBoneTransform(bone); } if (!((Object)(object)t == (Object)null)) { Transform obj = t; obj.localRotation *= Quaternion.Euler(rotationOffset); } } } public Offset[] offsets; private Animator animator; private void Start() { animator = ((Component)this).GetComponent(); } private void LateUpdate() { Offset[] array = offsets; foreach (Offset offset in array) { offset.Apply(animator); } } private void OnDrawGizmosSelected() { Offset[] array = offsets; foreach (Offset offset in array) { offset.name = ((object)Unsafe.As(ref offset.bone)/*cast due to .constrained prefix*/).ToString(); } } } } namespace RootMotion1.FinalIK { [HelpURL("http://www.root-motion.com/finalikdox/html/page4.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Biped IK")] public class BipedIK : SolverManager { public BipedReferences references = new BipedReferences(); public BipedIKSolvers solvers = new BipedIKSolvers(); [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page4.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_biped_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public float GetIKPositionWeight(AvatarIKGoal goal) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return GetGoalIK(goal).GetIKPositionWeight(); } public float GetIKRotationWeight(AvatarIKGoal goal) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return GetGoalIK(goal).GetIKRotationWeight(); } public void SetIKPositionWeight(AvatarIKGoal goal, float weight) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) GetGoalIK(goal).SetIKPositionWeight(weight); } public void SetIKRotationWeight(AvatarIKGoal goal, float weight) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) GetGoalIK(goal).SetIKRotationWeight(weight); } public void SetIKPosition(AvatarIKGoal goal, Vector3 IKPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) GetGoalIK(goal).SetIKPosition(IKPosition); } public void SetIKRotation(AvatarIKGoal goal, Quaternion IKRotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) GetGoalIK(goal).SetIKRotation(IKRotation); } public Vector3 GetIKPosition(AvatarIKGoal goal) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return GetGoalIK(goal).GetIKPosition(); } public Quaternion GetIKRotation(AvatarIKGoal goal) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return GetGoalIK(goal).GetIKRotation(); } public void SetLookAtWeight(float weight, float bodyWeight, float headWeight, float eyesWeight, float clampWeight, float clampWeightHead, float clampWeightEyes) { solvers.lookAt.SetLookAtWeight(weight, bodyWeight, headWeight, eyesWeight, clampWeight, clampWeightHead, clampWeightEyes); } public void SetLookAtPosition(Vector3 lookAtPosition) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) solvers.lookAt.SetIKPosition(lookAtPosition); } public void SetSpinePosition(Vector3 spinePosition) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) solvers.spine.SetIKPosition(spinePosition); } public void SetSpineWeight(float weight) { solvers.spine.SetIKPositionWeight(weight); } public IKSolverLimb GetGoalIK(AvatarIKGoal goal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected I4, but got Unknown return (int)goal switch { 0 => solvers.leftFoot, 1 => solvers.rightFoot, 2 => solvers.leftHand, 3 => solvers.rightHand, _ => null, }; } public void InitiateBipedIK() { InitiateSolver(); } public void UpdateBipedIK() { UpdateSolver(); } public void SetToDefaults() { IKSolverLimb[] limbs = solvers.limbs; foreach (IKSolverLimb iKSolverLimb in limbs) { iKSolverLimb.SetIKPositionWeight(0f); iKSolverLimb.SetIKRotationWeight(0f); iKSolverLimb.bendModifier = IKSolverLimb.BendModifier.Animation; iKSolverLimb.bendModifierWeight = 1f; } solvers.leftHand.maintainRotationWeight = 0f; solvers.rightHand.maintainRotationWeight = 0f; solvers.spine.SetIKPositionWeight(0f); solvers.spine.tolerance = 0f; solvers.spine.maxIterations = 2; solvers.spine.useRotationLimits = false; solvers.aim.SetIKPositionWeight(0f); solvers.aim.tolerance = 0f; solvers.aim.maxIterations = 2; SetLookAtWeight(0f, 0.5f, 1f, 1f, 0.5f, 0.7f, 0.5f); } protected override void FixTransforms() { solvers.lookAt.FixTransforms(); for (int i = 0; i < solvers.limbs.Length; i++) { solvers.limbs[i].FixTransforms(); } } protected override void InitiateSolver() { string errorMessage = ""; if (BipedReferences.SetupError(references, ref errorMessage)) { Warning.Log(errorMessage, references.root); return; } solvers.AssignReferences(references); if (solvers.spine.bones.Length > 1) { solvers.spine.Initiate(((Component)this).transform); } solvers.lookAt.Initiate(((Component)this).transform); solvers.aim.Initiate(((Component)this).transform); IKSolverLimb[] limbs = solvers.limbs; foreach (IKSolverLimb iKSolverLimb in limbs) { iKSolverLimb.Initiate(((Component)this).transform); } solvers.pelvis.Initiate(references.pelvis); } protected override void UpdateSolver() { for (int i = 0; i < solvers.limbs.Length; i++) { solvers.limbs[i].MaintainBend(); solvers.limbs[i].MaintainRotation(); } solvers.pelvis.Update(); if (solvers.spine.bones.Length > 1) { solvers.spine.Update(); } solvers.aim.Update(); solvers.lookAt.Update(); for (int j = 0; j < solvers.limbs.Length; j++) { solvers.limbs[j].Update(); } } public void LogWarning(string message) { Warning.Log(message, ((Component)this).transform); } } [Serializable] public class BipedIKSolvers { public IKSolverLimb leftFoot = new IKSolverLimb((AvatarIKGoal)0); public IKSolverLimb rightFoot = new IKSolverLimb((AvatarIKGoal)1); public IKSolverLimb leftHand = new IKSolverLimb((AvatarIKGoal)2); public IKSolverLimb rightHand = new IKSolverLimb((AvatarIKGoal)3); public IKSolverFABRIK spine = new IKSolverFABRIK(); public IKSolverLookAt lookAt = new IKSolverLookAt(); public IKSolverAim aim = new IKSolverAim(); public Constraints pelvis = new Constraints(); private IKSolverLimb[] _limbs; private IKSolver[] _ikSolvers; public IKSolverLimb[] limbs { get { if (_limbs == null || (_limbs != null && _limbs.Length != 4)) { _limbs = new IKSolverLimb[4] { leftFoot, rightFoot, leftHand, rightHand }; } return _limbs; } } public IKSolver[] ikSolvers { get { if (_ikSolvers == null || (_ikSolvers != null && _ikSolvers.Length != 7)) { _ikSolvers = new IKSolver[7] { leftFoot, rightFoot, leftHand, rightHand, spine, lookAt, aim }; } return _ikSolvers; } } public void AssignReferences(BipedReferences references) { //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) leftHand.SetChain(references.leftUpperArm, references.leftForearm, references.leftHand, references.root); rightHand.SetChain(references.rightUpperArm, references.rightForearm, references.rightHand, references.root); leftFoot.SetChain(references.leftThigh, references.leftCalf, references.leftFoot, references.root); rightFoot.SetChain(references.rightThigh, references.rightCalf, references.rightFoot, references.root); spine.SetChain(references.spine, references.root); lookAt.SetChain(references.spine, references.head, references.eyes, references.root); aim.SetChain(references.spine, references.root); leftFoot.goal = (AvatarIKGoal)0; rightFoot.goal = (AvatarIKGoal)1; leftHand.goal = (AvatarIKGoal)2; rightHand.goal = (AvatarIKGoal)3; } } [Serializable] public abstract class Constraint { public Transform transform; public float weight; public bool isValid => (Object)(object)transform != (Object)null; public abstract void UpdateConstraint(); } [Serializable] public class ConstraintPosition : Constraint { public Vector3 position; public ConstraintPosition() { } public ConstraintPosition(Transform transform) { base.transform = transform; } public override void UpdateConstraint() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f) && base.isValid) { transform.position = Vector3.Lerp(transform.position, position, weight); } } } [Serializable] public class ConstraintPositionOffset : Constraint { public Vector3 offset; private Vector3 defaultLocalPosition; private Vector3 lastLocalPosition; private bool initiated; private bool positionChanged => transform.localPosition != lastLocalPosition; public ConstraintPositionOffset() { } public ConstraintPositionOffset(Transform transform) { base.transform = transform; } public override void UpdateConstraint() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f) && base.isValid) { if (!initiated) { defaultLocalPosition = transform.localPosition; lastLocalPosition = transform.localPosition; initiated = true; } if (positionChanged) { defaultLocalPosition = transform.localPosition; } transform.localPosition = defaultLocalPosition; Transform obj = transform; obj.position += offset * weight; lastLocalPosition = transform.localPosition; } } } [Serializable] public class ConstraintRotation : Constraint { public Quaternion rotation; public ConstraintRotation() { } public ConstraintRotation(Transform transform) { base.transform = transform; } public override void UpdateConstraint() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f) && base.isValid) { transform.rotation = Quaternion.Slerp(transform.rotation, rotation, weight); } } } [Serializable] public class ConstraintRotationOffset : Constraint { public Quaternion offset; private Quaternion defaultRotation; private Quaternion defaultLocalRotation; private Quaternion lastLocalRotation; private Quaternion defaultTargetLocalRotation; private bool initiated; private bool rotationChanged => transform.localRotation != lastLocalRotation; public ConstraintRotationOffset() { } public ConstraintRotationOffset(Transform transform) { base.transform = transform; } public override void UpdateConstraint() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f) && base.isValid) { if (!initiated) { defaultLocalRotation = transform.localRotation; lastLocalRotation = transform.localRotation; initiated = true; } if (rotationChanged) { defaultLocalRotation = transform.localRotation; } transform.localRotation = defaultLocalRotation; transform.rotation = Quaternion.Slerp(transform.rotation, offset, weight); lastLocalRotation = transform.localRotation; } } } [Serializable] public class Constraints { public Transform transform; public Transform target; public Vector3 positionOffset; public Vector3 position; [Range(0f, 1f)] public float positionWeight; public Vector3 rotationOffset; public Vector3 rotation; [Range(0f, 1f)] public float rotationWeight; public bool IsValid() { return (Object)(object)transform != (Object)null; } public void Initiate(Transform transform) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) this.transform = transform; position = transform.position; rotation = transform.eulerAngles; } public void Update() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) if (IsValid()) { if ((Object)(object)target != (Object)null) { position = target.position; } Transform obj = transform; obj.position += positionOffset; if (positionWeight > 0f) { transform.position = Vector3.Lerp(transform.position, position, positionWeight); } if ((Object)(object)target != (Object)null) { rotation = target.eulerAngles; } transform.rotation = Quaternion.Euler(rotationOffset) * transform.rotation; if (rotationWeight > 0f) { transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.Euler(rotation), rotationWeight); } } } } [Serializable] public class Finger { [Serializable] public enum DOF { One, Three } [Tooltip("Master Weight for the finger.")] [Range(0f, 1f)] public float weight = 1f; [Tooltip("The weight of rotating the finger tip and bending the finger to the target.")] [Range(0f, 1f)] public float rotationWeight = 1f; [Tooltip("Rotational degrees of freedom. When set to 'One' the fingers will be able to be rotated only around a single axis. When 3, all 3 axes are free to rotate around.")] public DOF rotationDOF; [Tooltip("If enabled, keeps bone1 twist angle fixed relative to bone2.")] public bool fixBone1Twist; [Tooltip("The first bone of the finger.")] public Transform bone1; [Tooltip("The second bone of the finger.")] public Transform bone2; [Tooltip("The (optional) third bone of the finger. This can be ignored for thumbs.")] public Transform bone3; [Tooltip("The fingertip object. If your character doesn't have tip bones, you can create an empty GameObject and parent it to the last bone in the finger. Place it to the tip of the finger.")] public Transform tip; [Tooltip("The IK target (optional, can use IKPosition and IKRotation directly).")] public Transform target; private IKSolverLimb solver; private Quaternion bone3RelativeToTarget; private Vector3 bone3DefaultLocalPosition; private Quaternion bone3DefaultLocalRotation; private Vector3 bone1Axis; private Vector3 tipAxis; private Vector3 bone1TwistAxis; private Vector3 defaultBendNormal; public bool initiated { get; private set; } public Vector3 IKPosition { get { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return solver.IKPosition; } set { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) solver.IKPosition = value; } } public Quaternion IKRotation { get { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return solver.IKRotation; } set { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) solver.IKRotation = value; } } public bool IsValid(ref string errorMessage) { if ((Object)(object)bone1 == (Object)null || (Object)(object)bone2 == (Object)null || (Object)(object)tip == (Object)null) { errorMessage = "One of the bones in the Finger Rig is null, can not initiate solvers."; return false; } return true; } public void Initiate(Transform hand, int index) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) initiated = false; string errorMessage = string.Empty; if (!IsValid(ref errorMessage)) { Warning.Log(errorMessage, hand); return; } solver = new IKSolverLimb(); solver.IKPositionWeight = weight; solver.bendModifier = IKSolverLimb.BendModifier.Target; solver.bendModifierWeight = 1f; Vector3 val = Vector3.Cross(tip.position - bone1.position, bone2.position - bone1.position); defaultBendNormal = -((Vector3)(ref val)).normalized; solver.bendNormal = defaultBendNormal; Vector3 val2 = Vector3.Cross(bone2.position - bone1.position, tip.position - bone1.position); bone1Axis = Quaternion.Inverse(bone1.rotation) * val2; tipAxis = Quaternion.Inverse(tip.rotation) * val2; Vector3 val3 = bone2.position - bone1.position; Vector3 val4 = -Vector3.Cross(tip.position - bone1.position, bone2.position - bone1.position); Vector3.OrthoNormalize(ref val3, ref val4); bone1TwistAxis = Quaternion.Inverse(bone1.rotation) * val4; IKPosition = tip.position; IKRotation = tip.rotation; if ((Object)(object)bone3 != (Object)null) { bone3RelativeToTarget = Quaternion.Inverse(IKRotation) * bone3.rotation; bone3DefaultLocalPosition = bone3.localPosition; bone3DefaultLocalRotation = bone3.localRotation; } solver.SetChain(bone1, bone2, tip, hand); solver.Initiate(hand); initiated = true; } public void FixTransforms() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (initiated && !(weight <= 0f)) { solver.FixTransforms(); if ((Object)(object)bone3 != (Object)null) { bone3.localPosition = bone3DefaultLocalPosition; bone3.localRotation = bone3DefaultLocalRotation; } } } public void StoreDefaultLocalState() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (initiated) { solver.StoreDefaultLocalState(); if ((Object)(object)bone3 != (Object)null) { bone3DefaultLocalPosition = bone3.localPosition; bone3DefaultLocalRotation = bone3.localRotation; } } } public void Update(float masterWeight) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } float num = weight * masterWeight; if (num <= 0f) { return; } solver.target = target; if ((Object)(object)target != (Object)null) { IKPosition = target.position; IKRotation = target.rotation; } if (rotationDOF == DOF.One) { Quaternion val = Quaternion.FromToRotation(IKRotation * tipAxis, bone1.rotation * bone1Axis); IKRotation = val * IKRotation; } if ((Object)(object)bone3 != (Object)null) { if (num * rotationWeight >= 1f) { bone3.rotation = IKRotation * bone3RelativeToTarget; } else { bone3.rotation = Quaternion.Lerp(bone3.rotation, IKRotation * bone3RelativeToTarget, num * rotationWeight); } } solver.IKPositionWeight = num; solver.IKRotationWeight = rotationWeight; solver.Update(); if (fixBone1Twist) { Quaternion rotation = bone2.rotation; Quaternion val2 = Quaternion.LookRotation(bone1.rotation * bone1TwistAxis, bone2.position - bone1.position); Vector3 val3 = Quaternion.Inverse(val2) * solver.bendNormal; float num2 = Mathf.Atan2(val3.x, val3.z) * 57.29578f; bone1.rotation = Quaternion.AngleAxis(num2, bone2.position - bone1.position) * bone1.rotation; bone2.rotation = rotation; } } } public class FingerRig : SolverManager { [Tooltip("The master weight for all fingers.")] [Range(0f, 1f)] public float weight = 1f; public Finger[] fingers = new Finger[0]; public bool initiated { get; private set; } public bool IsValid(ref string errorMessage) { Finger[] array = fingers; foreach (Finger finger in array) { if (!finger.IsValid(ref errorMessage)) { return false; } } return true; } [ContextMenu("Auto-detect")] public void AutoDetect() { fingers = new Finger[0]; for (int i = 0; i < ((Component)this).transform.childCount; i++) { Transform[] array = (Transform[])(object)new Transform[0]; AddChildrenRecursive(((Component)this).transform.GetChild(i), ref array); if (array.Length == 3 || array.Length == 4) { Finger finger = new Finger(); finger.bone1 = array[0]; finger.bone2 = array[1]; if (array.Length == 3) { finger.tip = array[2]; } else { finger.bone3 = array[2]; finger.tip = array[3]; } finger.weight = 1f; Array.Resize(ref fingers, fingers.Length + 1); fingers[fingers.Length - 1] = finger; } } } public void AddFinger(Transform bone1, Transform bone2, Transform bone3, Transform tip, Transform target = null) { Finger finger = new Finger(); finger.bone1 = bone1; finger.bone2 = bone2; finger.bone3 = bone3; finger.tip = tip; finger.target = target; Array.Resize(ref fingers, fingers.Length + 1); fingers[fingers.Length - 1] = finger; initiated = false; finger.Initiate(((Component)this).transform, fingers.Length - 1); if (fingers[fingers.Length - 1].initiated) { initiated = true; } } public void RemoveFinger(int index) { if ((float)index < 0f || index >= fingers.Length) { Warning.Log("RemoveFinger index out of bounds.", ((Component)this).transform); return; } if (fingers.Length == 1) { fingers = new Finger[0]; return; } Finger[] array = new Finger[fingers.Length - 1]; int num = 0; for (int i = 0; i < fingers.Length; i++) { if (i != index) { array[num] = fingers[i]; num++; } } fingers = array; } private void AddChildrenRecursive(Transform parent, ref Transform[] array) { Array.Resize(ref array, array.Length + 1); array[array.Length - 1] = parent; if (parent.childCount == 1) { AddChildrenRecursive(parent.GetChild(0), ref array); } } protected override void InitiateSolver() { initiated = true; for (int i = 0; i < fingers.Length; i++) { fingers[i].Initiate(((Component)this).transform, i); if (!fingers[i].initiated) { initiated = false; } } } public void UpdateFingerSolvers() { Finger[] array = fingers; foreach (Finger finger in array) { finger.Update(weight); } } public void FixFingerTransforms() { if (!(weight <= 0f)) { Finger[] array = fingers; foreach (Finger finger in array) { finger.FixTransforms(); } } } public void StoreDefaultLocalState() { Finger[] array = fingers; foreach (Finger finger in array) { finger.StoreDefaultLocalState(); } } protected override void UpdateSolver() { UpdateFingerSolvers(); } protected override void FixTransforms() { if (!(weight <= 0f)) { FixFingerTransforms(); } } } public abstract class Grounder : MonoBehaviour { public delegate void GrounderDelegate(); [Tooltip("The master weight. Use this to fade in/out the grounding effect.")] [Range(0f, 1f)] public float weight = 1f; [Tooltip("The Grounding solver. Not to confuse with IK solvers.")] public Grounding solver = new Grounding(); public GrounderDelegate OnPreGrounder; public GrounderDelegate OnPostGrounder; public bool initiated { get; protected set; } public abstract void ResetPosition(); protected Vector3 GetSpineOffsetTarget() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; for (int i = 0; i < solver.legs.Length; i++) { val += GetLegSpineBendVector(solver.legs[i]); } return val; } protected void LogWarning(string message) { Warning.Log(message, ((Component)this).transform); } private Vector3 GetLegSpineBendVector(Grounding.Leg leg) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) Vector3 legSpineTangent = GetLegSpineTangent(leg); float num = (Vector3.Dot(solver.root.forward, ((Vector3)(ref legSpineTangent)).normalized) + 1f) * 0.5f; Vector3 val = leg.IKPosition - leg.transform.position; float magnitude = ((Vector3)(ref val)).magnitude; return legSpineTangent * magnitude * num; } private Vector3 GetLegSpineTangent(Grounding.Leg leg) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) Vector3 result = leg.transform.position - solver.root.position; if (!solver.rotateSolver || solver.root.up == Vector3.up) { return new Vector3(result.x, 0f, result.z); } Vector3 up = solver.root.up; Vector3.OrthoNormalize(ref up, ref result); return result; } protected abstract void OpenUserManual(); protected abstract void OpenScriptReference(); } [HelpURL("http://www.root-motion.com/finalikdox/html/page9.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Grounder/Grounder Biped")] public class GrounderBipedIK : Grounder { [Tooltip("The BipedIK componet.")] public BipedIK ik; [Tooltip("The amount of spine bending towards upward slopes.")] public float spineBend = 7f; [Tooltip("The interpolation speed of spine bending.")] public float spineSpeed = 3f; private Transform[] feet = (Transform[])(object)new Transform[2]; private Quaternion[] footRotations = (Quaternion[])(object)new Quaternion[2]; private Vector3 animatedPelvisLocalPosition; private Vector3 solvedPelvisLocalPosition; private Vector3 spineOffset; private float lastWeight; [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page9.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_grounder_biped_i_k.html"); } public override void ResetPosition() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) solver.Reset(); spineOffset = Vector3.zero; } private bool IsReadyToInitiate() { if ((Object)(object)ik == (Object)null) { return false; } if (!ik.solvers.leftFoot.initiated) { return false; } if (!ik.solvers.rightFoot.initiated) { return false; } return true; } private void Update() { weight = Mathf.Clamp(weight, 0f, 1f); if (!(weight <= 0f) && !base.initiated && IsReadyToInitiate()) { Initiate(); } } private void Initiate() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) feet = (Transform[])(object)new Transform[2]; footRotations = (Quaternion[])(object)new Quaternion[2]; feet[0] = ik.references.leftFoot; feet[1] = ik.references.rightFoot; ref Quaternion reference = ref footRotations[0]; reference = Quaternion.identity; ref Quaternion reference2 = ref footRotations[1]; reference2 = Quaternion.identity; IKSolverFABRIK spine = ik.solvers.spine; spine.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(spine.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolverLimb rightFoot = ik.solvers.rightFoot; rightFoot.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(rightFoot.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); animatedPelvisLocalPosition = ik.references.pelvis.localPosition; solver.Initiate(ik.references.root, feet); base.initiated = true; } private void OnDisable() { if (base.initiated) { ik.solvers.leftFoot.IKPositionWeight = 0f; ik.solvers.rightFoot.IKPositionWeight = 0f; } } private void OnSolverUpdate() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } if (weight <= 0f) { if (lastWeight <= 0f) { return; } OnDisable(); } lastWeight = weight; if (OnPreGrounder != null) { OnPreGrounder(); } if (ik.references.pelvis.localPosition != solvedPelvisLocalPosition) { animatedPelvisLocalPosition = ik.references.pelvis.localPosition; } else { ik.references.pelvis.localPosition = animatedPelvisLocalPosition; } solver.Update(); Transform pelvis = ik.references.pelvis; pelvis.position += solver.pelvis.IKOffset * weight; SetLegIK(ik.solvers.leftFoot, 0); SetLegIK(ik.solvers.rightFoot, 1); if (spineBend != 0f && ik.references.spine.Length > 0) { spineSpeed = Mathf.Clamp(spineSpeed, 0f, spineSpeed); Vector3 val = GetSpineOffsetTarget() * weight; spineOffset = Vector3.Lerp(spineOffset, val * spineBend, Time.deltaTime * spineSpeed); Quaternion rotation = ik.references.leftUpperArm.rotation; Quaternion rotation2 = ik.references.rightUpperArm.rotation; Vector3 up = solver.up; Quaternion val2 = Quaternion.FromToRotation(up, up + spineOffset); ik.references.spine[0].rotation = val2 * ik.references.spine[0].rotation; ik.references.leftUpperArm.rotation = rotation; ik.references.rightUpperArm.rotation = rotation2; ik.solvers.lookAt.SetDirty(); } if (OnPostGrounder != null) { OnPostGrounder(); } } private void SetLegIK(IKSolverLimb limb, int index) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) ref Quaternion reference = ref footRotations[index]; reference = feet[index].rotation; limb.IKPosition = solver.legs[index].IKPosition; limb.IKPositionWeight = weight; } private void OnPostSolverUpdate() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f) && ((Behaviour)this).enabled) { for (int i = 0; i < feet.Length; i++) { feet[i].rotation = Quaternion.Slerp(Quaternion.identity, solver.legs[i].rotationOffset, weight) * footRotations[i]; } solvedPelvisLocalPosition = ik.references.pelvis.localPosition; } } private void OnDestroy() { if (base.initiated && (Object)(object)ik != (Object)null) { IKSolverFABRIK spine = ik.solvers.spine; spine.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(spine.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolverLimb rightFoot = ik.solvers.rightFoot; rightFoot.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(rightFoot.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } } } [HelpURL("https://www.youtube.com/watch?v=9MiZiaJorws&index=6&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Grounder/Grounder Full Body Biped")] public class GrounderFBBIK : Grounder { [Serializable] public class SpineEffector { [Tooltip("The type of the effector.")] public FullBodyBipedEffector effectorType; [Tooltip("The weight of horizontal bend offset towards the slope.")] public float horizontalWeight = 1f; [Tooltip("The vertical bend offset weight.")] public float verticalWeight; public SpineEffector() { } public SpineEffector(FullBodyBipedEffector effectorType, float horizontalWeight, float verticalWeight) { this.effectorType = effectorType; this.horizontalWeight = horizontalWeight; this.verticalWeight = verticalWeight; } } [Tooltip("Reference to the FBBIK componet.")] public FullBodyBipedIK ik; [Tooltip("The amount of spine bending towards upward slopes.")] public float spineBend = 2f; [Tooltip("The interpolation speed of spine bending.")] public float spineSpeed = 3f; public SpineEffector[] spine = new SpineEffector[0]; private Transform[] feet = (Transform[])(object)new Transform[2]; private Vector3 spineOffset; private bool firstSolve; [ContextMenu("TUTORIAL VIDEO")] private void OpenTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=9MiZiaJorws&index=6&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page9.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_grounder_f_b_b_i_k.html"); } public override void ResetPosition() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) solver.Reset(); spineOffset = Vector3.zero; } private bool IsReadyToInitiate() { if ((Object)(object)ik == (Object)null) { return false; } if (!ik.solver.initiated) { return false; } return true; } private void Update() { firstSolve = true; weight = Mathf.Clamp(weight, 0f, 1f); if (!(weight <= 0f) && !base.initiated && IsReadyToInitiate()) { Initiate(); } } private void FixedUpdate() { firstSolve = true; } private void LateUpdate() { firstSolve = true; } private void Initiate() { ik.solver.leftLegMapping.maintainRotationWeight = 1f; ik.solver.rightLegMapping.maintainRotationWeight = 1f; feet = (Transform[])(object)new Transform[2]; feet[0] = ik.solver.leftFootEffector.bone; feet[1] = ik.solver.rightFootEffector.bone; IKSolverFullBodyBiped iKSolverFullBodyBiped = ik.solver; iKSolverFullBodyBiped.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolverFullBodyBiped.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); solver.Initiate(ik.references.root, feet); base.initiated = true; } private void OnSolverUpdate() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) if (!firstSolve) { return; } firstSolve = false; if (!((Behaviour)this).enabled || weight <= 0f) { return; } if (OnPreGrounder != null) { OnPreGrounder(); } solver.Update(); Transform pelvis = ik.references.pelvis; pelvis.position += solver.pelvis.IKOffset * weight; SetLegIK(ik.solver.leftFootEffector, solver.legs[0]); SetLegIK(ik.solver.rightFootEffector, solver.legs[1]); if (spineBend != 0f) { spineSpeed = Mathf.Clamp(spineSpeed, 0f, spineSpeed); Vector3 val = GetSpineOffsetTarget() * weight; spineOffset = Vector3.Lerp(spineOffset, val * spineBend, Time.deltaTime * spineSpeed); Vector3 val2 = ik.references.root.up * ((Vector3)(ref spineOffset)).magnitude; for (int i = 0; i < spine.Length; i++) { IKEffector effector = ik.solver.GetEffector(spine[i].effectorType); effector.positionOffset += spineOffset * spine[i].horizontalWeight + val2 * spine[i].verticalWeight; } } if (OnPostGrounder != null) { OnPostGrounder(); } } private void SetLegIK(IKEffector effector, Grounding.Leg leg) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) effector.positionOffset += (leg.IKPosition - effector.bone.position) * weight; effector.bone.rotation = Quaternion.Slerp(Quaternion.identity, leg.rotationOffset, weight) * effector.bone.rotation; } private void OnDrawGizmosSelected() { if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponent(); } if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponentInParent(); } if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponentInChildren(); } } private void OnDestroy() { if (base.initiated && (Object)(object)ik != (Object)null) { IKSolverFullBodyBiped iKSolverFullBodyBiped = ik.solver; iKSolverFullBodyBiped.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolverFullBodyBiped.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); } } } [HelpURL("http://www.root-motion.com/finalikdox/html/page9.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Grounder/Grounder IK")] public class GrounderIK : Grounder { public IK[] legs; [Tooltip("The pelvis transform. Common ancestor of all the legs.")] public Transform pelvis; [Tooltip("The root Transform of the character, with the rigidbody and the collider.")] public Transform characterRoot; [Tooltip("The weight of rotating the character root to the ground normal (range: 0 - 1).")] [Range(0f, 1f)] public float rootRotationWeight; [Tooltip("The speed of rotating the character root to the ground normal (range: 0 - inf).")] public float rootRotationSpeed = 5f; [Tooltip("The maximum angle of root rotation (range: 0 - 90).")] public float maxRootRotationAngle = 45f; private Transform[] feet = (Transform[])(object)new Transform[0]; private Quaternion[] footRotations = (Quaternion[])(object)new Quaternion[0]; private Vector3 animatedPelvisLocalPosition; private Vector3 solvedPelvisLocalPosition; private int solvedFeet; private bool solved; private float lastWeight; private Rigidbody characterRootRigidbody; [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page9.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_grounder_i_k.html"); } public override void ResetPosition() { solver.Reset(); } private bool IsReadyToInitiate() { if ((Object)(object)pelvis == (Object)null) { return false; } if (legs.Length == 0) { return false; } IK[] array = legs; foreach (IK iK in array) { if ((Object)(object)iK == (Object)null) { return false; } if (iK is FullBodyBipedIK) { LogWarning("GrounderIK does not support FullBodyBipedIK, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead. If you want to use FullBodyBipedIK, use the GrounderFBBIK component."); return false; } if (iK is FABRIKRoot) { LogWarning("GrounderIK does not support FABRIKRoot, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead."); return false; } if (iK is AimIK) { LogWarning("GrounderIK does not support AimIK, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead."); return false; } } return true; } private void OnDisable() { if (!base.initiated) { return; } for (int i = 0; i < legs.Length; i++) { if ((Object)(object)legs[i] != (Object)null) { legs[i].GetIKSolver().IKPositionWeight = 0f; } } } private void Update() { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) weight = Mathf.Clamp(weight, 0f, 1f); if (weight <= 0f) { return; } solved = false; if (base.initiated) { rootRotationWeight = Mathf.Clamp(rootRotationWeight, 0f, 1f); rootRotationSpeed = Mathf.Clamp(rootRotationSpeed, 0f, rootRotationSpeed); if ((Object)(object)characterRoot != (Object)null && rootRotationSpeed > 0f && rootRotationWeight > 0f && solver.isGrounded) { Vector3 val = solver.GetLegsPlaneNormal(); if (rootRotationWeight < 1f) { val = Vector3.Slerp(Vector3.up, val, rootRotationWeight); } Quaternion val2 = Quaternion.FromToRotation(((Component)this).transform.up, Vector3.up) * characterRoot.rotation; Quaternion val3 = Quaternion.RotateTowards(val2, Quaternion.FromToRotation(((Component)this).transform.up, val) * characterRoot.rotation, maxRootRotationAngle); if ((Object)(object)characterRootRigidbody == (Object)null) { characterRoot.rotation = Quaternion.Lerp(characterRoot.rotation, val3, Time.deltaTime * rootRotationSpeed); } else { characterRootRigidbody.MoveRotation(Quaternion.Lerp(characterRoot.rotation, val3, Time.deltaTime * rootRotationSpeed)); } } } else if (IsReadyToInitiate()) { Initiate(); } } private void Initiate() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) feet = (Transform[])(object)new Transform[legs.Length]; footRotations = (Quaternion[])(object)new Quaternion[legs.Length]; for (int i = 0; i < feet.Length; i++) { ref Quaternion reference = ref footRotations[i]; reference = Quaternion.identity; } for (int j = 0; j < legs.Length; j++) { IKSolver.Point[] points = legs[j].GetIKSolver().GetPoints(); feet[j] = points[^1].transform; IKSolver iKSolver = legs[j].GetIKSolver(); iKSolver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolver iKSolver2 = legs[j].GetIKSolver(); iKSolver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } animatedPelvisLocalPosition = pelvis.localPosition; solver.Initiate(((Component)this).transform, feet); for (int k = 0; k < legs.Length; k++) { if (legs[k] is LegIK) { solver.legs[k].invertFootCenter = true; } } characterRootRigidbody = ((Component)characterRoot).GetComponent(); base.initiated = true; } private void OnSolverUpdate() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } if (weight <= 0f) { if (lastWeight <= 0f) { return; } OnDisable(); } lastWeight = weight; if (!solved) { if (OnPreGrounder != null) { OnPreGrounder(); } if (pelvis.localPosition != solvedPelvisLocalPosition) { animatedPelvisLocalPosition = pelvis.localPosition; } else { pelvis.localPosition = animatedPelvisLocalPosition; } solver.Update(); for (int i = 0; i < legs.Length; i++) { SetLegIK(i); } Transform obj = pelvis; obj.position += solver.pelvis.IKOffset * weight; solved = true; solvedFeet = 0; if (OnPostGrounder != null) { OnPostGrounder(); } } } private void SetLegIK(int index) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) ref Quaternion reference = ref footRotations[index]; reference = feet[index].rotation; if (legs[index] is LegIK) { (legs[index].GetIKSolver() as IKSolverLeg).IKRotation = Quaternion.Slerp(Quaternion.identity, solver.legs[index].rotationOffset, weight) * footRotations[index]; (legs[index].GetIKSolver() as IKSolverLeg).IKRotationWeight = 1f; } legs[index].GetIKSolver().IKPosition = solver.legs[index].IKPosition; legs[index].GetIKSolver().IKPositionWeight = weight; } private void OnPostSolverUpdate() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f || !((Behaviour)this).enabled) { return; } solvedFeet++; if (solvedFeet >= feet.Length) { solved = false; for (int i = 0; i < feet.Length; i++) { feet[i].rotation = Quaternion.Slerp(Quaternion.identity, solver.legs[i].rotationOffset, weight) * footRotations[i]; } solvedPelvisLocalPosition = pelvis.localPosition; } } private void OnDestroy() { if (!base.initiated) { return; } IK[] array = legs; foreach (IK iK in array) { if ((Object)(object)iK != (Object)null) { IKSolver iKSolver = iK.GetIKSolver(); iKSolver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolver iKSolver2 = iK.GetIKSolver(); iKSolver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } } } } [HelpURL("http://www.root-motion.com/finalikdox/html/page9.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Grounder/Grounder Quadruped")] public class GrounderQuadruped : Grounder { public struct Foot { public IKSolver solver; public Transform transform; public Quaternion rotation; public Grounding.Leg leg; public Foot(IKSolver solver, Transform transform) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) this.solver = solver; this.transform = transform; leg = null; rotation = transform.rotation; } } [Tooltip("The Grounding solver for the forelegs.")] public Grounding forelegSolver = new Grounding(); [Tooltip("The weight of rotating the character root to the ground angle (range: 0 - 1).")] [Range(0f, 1f)] public float rootRotationWeight = 0.5f; [Tooltip("The maximum angle of rotating the quadruped downwards (going downhill, range: -90 - 0).")] [Range(-90f, 0f)] public float minRootRotation = -25f; [Tooltip("The maximum angle of rotating the quadruped upwards (going uphill, range: 0 - 90).")] [Range(0f, 90f)] public float maxRootRotation = 45f; [Tooltip("The speed of interpolating the character root rotation (range: 0 - inf).")] public float rootRotationSpeed = 5f; [Tooltip("The maximum IK offset for the legs (range: 0 - inf).")] public float maxLegOffset = 0.5f; [Tooltip("The maximum IK offset for the forelegs (range: 0 - inf).")] public float maxForeLegOffset = 0.5f; [Tooltip("The weight of maintaining the head's rotation as it was before solving the Grounding (range: 0 - 1).")] [Range(0f, 1f)] public float maintainHeadRotationWeight = 0.5f; [Tooltip("The root Transform of the character, with the rigidbody and the collider.")] public Transform characterRoot; [Tooltip("The pelvis transform. Common ancestor of both legs and the spine.")] public Transform pelvis; [Tooltip("The last bone in the spine that is the common parent for both forelegs.")] public Transform lastSpineBone; [Tooltip("The head (optional, if you intend to maintain it's rotation).")] public Transform head; public IK[] legs; public IK[] forelegs; [HideInInspector] public Vector3 gravity = Vector3.down; private Foot[] feet = new Foot[0]; private Vector3 animatedPelvisLocalPosition; private Quaternion animatedPelvisLocalRotation; private Quaternion animatedHeadLocalRotation; private Vector3 solvedPelvisLocalPosition; private Quaternion solvedPelvisLocalRotation; private Quaternion solvedHeadLocalRotation; private int solvedFeet; private bool solved; private float angle; private Transform forefeetRoot; private Quaternion headRotation; private float lastWeight; private Rigidbody characterRootRigidbody; [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page9.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_grounder_quadruped.html"); } public override void ResetPosition() { solver.Reset(); forelegSolver.Reset(); } private bool IsReadyToInitiate() { if ((Object)(object)pelvis == (Object)null) { return false; } if ((Object)(object)lastSpineBone == (Object)null) { return false; } if (legs.Length == 0) { return false; } if (forelegs.Length == 0) { return false; } if ((Object)(object)characterRoot == (Object)null) { return false; } if (!IsReadyToInitiateLegs(legs)) { return false; } if (!IsReadyToInitiateLegs(forelegs)) { return false; } return true; } private bool IsReadyToInitiateLegs(IK[] ikComponents) { foreach (IK iK in ikComponents) { if ((Object)(object)iK == (Object)null) { return false; } if (iK is FullBodyBipedIK) { LogWarning("GrounderIK does not support FullBodyBipedIK, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead. If you want to use FullBodyBipedIK, use the GrounderFBBIK component."); return false; } if (iK is FABRIKRoot) { LogWarning("GrounderIK does not support FABRIKRoot, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead."); return false; } if (iK is AimIK) { LogWarning("GrounderIK does not support AimIK, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead."); return false; } } return true; } private void OnDisable() { if (!base.initiated) { return; } for (int i = 0; i < feet.Length; i++) { if (feet[i].solver != null) { feet[i].solver.IKPositionWeight = 0f; } } } private void Update() { weight = Mathf.Clamp(weight, 0f, 1f); if (!(weight <= 0f)) { solved = false; if (!base.initiated && IsReadyToInitiate()) { Initiate(); } } } private void Initiate() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) feet = new Foot[legs.Length + forelegs.Length]; Transform[] array = InitiateFeet(legs, ref feet, 0); Transform[] array2 = InitiateFeet(forelegs, ref feet, legs.Length); animatedPelvisLocalPosition = pelvis.localPosition; animatedPelvisLocalRotation = pelvis.localRotation; if ((Object)(object)head != (Object)null) { animatedHeadLocalRotation = head.localRotation; } forefeetRoot = new GameObject().transform; forefeetRoot.parent = ((Component)this).transform; ((Object)forefeetRoot).name = "Forefeet Root"; solver.Initiate(((Component)this).transform, array); forelegSolver.Initiate(forefeetRoot, array2); for (int i = 0; i < array.Length; i++) { feet[i].leg = solver.legs[i]; } for (int j = 0; j < array2.Length; j++) { feet[j + legs.Length].leg = forelegSolver.legs[j]; } characterRootRigidbody = ((Component)characterRoot).GetComponent(); base.initiated = true; } private Transform[] InitiateFeet(IK[] ikComponents, ref Foot[] f, int indexOffset) { Transform[] array = (Transform[])(object)new Transform[ikComponents.Length]; for (int i = 0; i < ikComponents.Length; i++) { IKSolver.Point[] points = ikComponents[i].GetIKSolver().GetPoints(); ref Foot reference = ref f[i + indexOffset]; reference = new Foot(ikComponents[i].GetIKSolver(), points[^1].transform); array[i] = f[i + indexOffset].transform; IKSolver iKSolver = f[i + indexOffset].solver; iKSolver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolver iKSolver2 = f[i + indexOffset].solver; iKSolver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } return array; } private void LateUpdate() { if (!(weight <= 0f)) { rootRotationWeight = Mathf.Clamp(rootRotationWeight, 0f, 1f); minRootRotation = Mathf.Clamp(minRootRotation, -90f, maxRootRotation); maxRootRotation = Mathf.Clamp(maxRootRotation, minRootRotation, 90f); rootRotationSpeed = Mathf.Clamp(rootRotationSpeed, 0f, rootRotationSpeed); maxLegOffset = Mathf.Clamp(maxLegOffset, 0f, maxLegOffset); maxForeLegOffset = Mathf.Clamp(maxForeLegOffset, 0f, maxForeLegOffset); maintainHeadRotationWeight = Mathf.Clamp(maintainHeadRotationWeight, 0f, 1f); RootRotation(); } } private void RootRotation() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) if (!(rootRotationWeight <= 0f) && !(rootRotationSpeed <= 0f)) { solver.rotateSolver = true; forelegSolver.rotateSolver = true; Vector3 forward = characterRoot.forward; Vector3 val = -gravity; Vector3.OrthoNormalize(ref val, ref forward); Quaternion val2 = Quaternion.LookRotation(forward, -gravity); RaycastHit rootHit = forelegSolver.rootHit; Vector3 point = ((RaycastHit)(ref rootHit)).point; RaycastHit rootHit2 = solver.rootHit; Vector3 val3 = point - ((RaycastHit)(ref rootHit2)).point; Vector3 val4 = Quaternion.Inverse(val2) * val3; float num = Mathf.Atan2(val4.y, val4.z) * 57.29578f; num = Mathf.Clamp(num * rootRotationWeight, minRootRotation, maxRootRotation); angle = Mathf.Lerp(angle, num, Time.deltaTime * rootRotationSpeed); if ((Object)(object)characterRootRigidbody == (Object)null) { characterRoot.rotation = Quaternion.Slerp(characterRoot.rotation, Quaternion.AngleAxis(0f - angle, characterRoot.right) * val2, weight); } else { characterRootRigidbody.MoveRotation(Quaternion.Slerp(characterRoot.rotation, Quaternion.AngleAxis(0f - angle, characterRoot.right) * val2, weight)); } } } private void OnSolverUpdate() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } if (weight <= 0f) { if (lastWeight <= 0f) { return; } OnDisable(); } lastWeight = weight; if (solved) { return; } if (OnPreGrounder != null) { OnPreGrounder(); } if (pelvis.localPosition != solvedPelvisLocalPosition) { animatedPelvisLocalPosition = pelvis.localPosition; } else { pelvis.localPosition = animatedPelvisLocalPosition; } if (pelvis.localRotation != solvedPelvisLocalRotation) { animatedPelvisLocalRotation = pelvis.localRotation; } else { pelvis.localRotation = animatedPelvisLocalRotation; } if ((Object)(object)head != (Object)null) { if (head.localRotation != solvedHeadLocalRotation) { animatedHeadLocalRotation = head.localRotation; } else { head.localRotation = animatedHeadLocalRotation; } } for (int i = 0; i < feet.Length; i++) { feet[i].rotation = feet[i].transform.rotation; } if ((Object)(object)head != (Object)null) { headRotation = head.rotation; } UpdateForefeetRoot(); solver.Update(); forelegSolver.Update(); Transform obj = pelvis; obj.position += solver.pelvis.IKOffset * weight; Vector3 val = lastSpineBone.position - pelvis.position; Vector3 val2 = lastSpineBone.position + forelegSolver.root.up * Mathf.Clamp(forelegSolver.pelvis.heightOffset, float.NegativeInfinity, 0f) - solver.root.up * solver.pelvis.heightOffset; Vector3 val3 = val2 - pelvis.position; Quaternion val4 = Quaternion.FromToRotation(val, val3); pelvis.rotation = Quaternion.Slerp(Quaternion.identity, val4, weight) * pelvis.rotation; for (int j = 0; j < feet.Length; j++) { SetFootIK(feet[j], (j >= 2) ? maxForeLegOffset : maxLegOffset); } solved = true; solvedFeet = 0; if (OnPostGrounder != null) { OnPostGrounder(); } } private void UpdateForefeetRoot() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; for (int i = 0; i < forelegSolver.legs.Length; i++) { val += forelegSolver.legs[i].transform.position; } val /= (float)forelegs.Length; Vector3 val2 = val - ((Component)this).transform.position; Vector3 up = ((Component)this).transform.up; Vector3 val3 = val2; Vector3.OrthoNormalize(ref up, ref val3); forefeetRoot.position = ((Component)this).transform.position + ((Vector3)(ref val3)).normalized * ((Vector3)(ref val2)).magnitude; } private void SetFootIK(Foot foot, float maxOffset) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = foot.leg.IKPosition - foot.transform.position; foot.solver.IKPosition = foot.transform.position + Vector3.ClampMagnitude(val, maxOffset); foot.solver.IKPositionWeight = weight; } private void OnPostSolverUpdate() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f || !((Behaviour)this).enabled) { return; } solvedFeet++; if (solvedFeet >= feet.Length) { for (int i = 0; i < feet.Length; i++) { feet[i].transform.rotation = Quaternion.Slerp(Quaternion.identity, feet[i].leg.rotationOffset, weight) * feet[i].rotation; } if ((Object)(object)head != (Object)null) { head.rotation = Quaternion.Lerp(head.rotation, headRotation, maintainHeadRotationWeight * weight); } solvedPelvisLocalPosition = pelvis.localPosition; solvedPelvisLocalRotation = pelvis.localRotation; if ((Object)(object)head != (Object)null) { solvedHeadLocalRotation = head.localRotation; } } } private void OnDestroy() { if (base.initiated) { DestroyLegs(legs); DestroyLegs(forelegs); } } private void DestroyLegs(IK[] ikComponents) { foreach (IK iK in ikComponents) { if ((Object)(object)iK != (Object)null) { IKSolver iKSolver = iK.GetIKSolver(); iKSolver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolver iKSolver2 = iK.GetIKSolver(); iKSolver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } } } } [HelpURL("https://www.youtube.com/watch?v=9MiZiaJorws&index=6&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Grounder/Grounder VRIK")] public class GrounderVRIK : Grounder { [Tooltip("Reference to the VRIK componet.")] public VRIK ik; private Transform[] feet = (Transform[])(object)new Transform[2]; [ContextMenu("TUTORIAL VIDEO")] private void OpenTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=9MiZiaJorws&index=6&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page9.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_grounder_v_r_i_k.html"); } public override void ResetPosition() { solver.Reset(); } private bool IsReadyToInitiate() { if ((Object)(object)ik == (Object)null) { return false; } if (!ik.solver.initiated) { return false; } return true; } private void Update() { weight = Mathf.Clamp(weight, 0f, 1f); if (!(weight <= 0f) && !base.initiated && IsReadyToInitiate()) { Initiate(); } } private void Initiate() { feet = (Transform[])(object)new Transform[2]; feet[0] = ik.references.leftFoot; feet[1] = ik.references.rightFoot; IKSolverVR iKSolverVR = ik.solver; iKSolverVR.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolverVR.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolverVR iKSolverVR2 = ik.solver; iKSolverVR2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolverVR2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); solver.Initiate(ik.references.root, feet); base.initiated = true; } private void OnSolverUpdate() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled && !(weight <= 0f)) { if (OnPreGrounder != null) { OnPreGrounder(); } solver.Update(); Transform pelvis = ik.references.pelvis; pelvis.position += solver.pelvis.IKOffset * weight; ik.solver.AddPositionOffset(IKSolverVR.PositionOffset.LeftFoot, (solver.legs[0].IKPosition - ik.references.leftFoot.position) * weight); ik.solver.AddPositionOffset(IKSolverVR.PositionOffset.RightFoot, (solver.legs[1].IKPosition - ik.references.rightFoot.position) * weight); if (OnPostGrounder != null) { OnPostGrounder(); } } } private void SetLegIK(IKSolverVR.PositionOffset positionOffset, Transform bone, Grounding.Leg leg) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) ik.solver.AddPositionOffset(positionOffset, (leg.IKPosition - bone.position) * weight); } private void OnPostSolverUpdate() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) ik.references.leftFoot.rotation = Quaternion.Slerp(Quaternion.identity, solver.legs[0].rotationOffset, weight) * ik.references.leftFoot.rotation; ik.references.rightFoot.rotation = Quaternion.Slerp(Quaternion.identity, solver.legs[1].rotationOffset, weight) * ik.references.rightFoot.rotation; } private void OnDrawGizmosSelected() { if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponent(); } if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponentInParent(); } if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponentInChildren(); } } private void OnDestroy() { if (base.initiated && (Object)(object)ik != (Object)null) { IKSolverVR iKSolverVR = ik.solver; iKSolverVR.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolverVR.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolverVR iKSolverVR2 = ik.solver; iKSolverVR2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolverVR2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } } } [Serializable] public class Grounding { [Serializable] public enum Quality { Fastest, Simple, Best } public class Leg { public Quaternion rotationOffset = Quaternion.identity; public bool invertFootCenter; private Grounding grounding; private float lastTime; private float deltaTime; private Vector3 lastPosition; private Quaternion toHitNormal; private Quaternion r; private Vector3 up = Vector3.up; private bool doOverrideFootPosition; private Vector3 overrideFootPosition; private Vector3 transformPosition; public bool isGrounded { get; private set; } public Vector3 IKPosition { get; private set; } public bool initiated { get; private set; } public float heightFromGround { get; private set; } public Vector3 velocity { get; private set; } public Transform transform { get; private set; } public float IKOffset { get; private set; } public RaycastHit heelHit { get; private set; } public RaycastHit capsuleHit { get; private set; } public RaycastHit GetHitPoint { get { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (grounding.quality == Quality.Best) { return capsuleHit; } return heelHit; } } public float stepHeightFromGround => Mathf.Clamp(heightFromGround, 0f - grounding.maxStep, grounding.maxStep); private float rootYOffset => grounding.GetVerticalOffset(transformPosition, grounding.root.position - up * grounding.heightOffset); public void SetFootPosition(Vector3 position) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) doOverrideFootPosition = true; overrideFootPosition = position; } public void Initiate(Grounding grounding, Transform transform) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) initiated = false; this.grounding = grounding; this.transform = transform; up = Vector3.up; IKPosition = transform.position; rotationOffset = Quaternion.identity; initiated = true; OnEnable(); } public void OnEnable() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (initiated) { lastPosition = transform.position; lastTime = Time.deltaTime; } } public void Reset() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) lastPosition = transform.position; lastTime = Time.deltaTime; IKOffset = 0f; IKPosition = transform.position; rotationOffset = Quaternion.identity; } public void Process() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) if (!initiated || grounding.maxStep <= 0f) { return; } transformPosition = ((!doOverrideFootPosition) ? transform.position : overrideFootPosition); doOverrideFootPosition = false; deltaTime = Time.time - lastTime; lastTime = Time.time; if (deltaTime == 0f) { return; } up = grounding.up; heightFromGround = float.PositiveInfinity; velocity = (transformPosition - lastPosition) / deltaTime; lastPosition = transformPosition; Vector3 val = velocity * grounding.prediction; if (grounding.footRadius <= 0f) { grounding.quality = Quality.Fastest; } isGrounded = false; RaycastHit val13; Vector3 normal; RaycastHit val14; Vector3 point4; RaycastHit val15; switch (grounding.quality) { case Quality.Fastest: { RaycastHit raycastHit3 = GetRaycastHit(val); SetFootToPoint(((RaycastHit)(ref raycastHit3)).normal, ((RaycastHit)(ref raycastHit3)).point); if ((Object)(object)((RaycastHit)(ref raycastHit3)).collider != (Object)null) { isGrounded = true; } break; } case Quality.Simple: { heelHit = GetRaycastHit(Vector3.zero); Vector3 val4 = grounding.GetFootCenterOffset(); if (invertFootCenter) { val4 = -val4; } RaycastHit raycastHit = GetRaycastHit(val4 + val); RaycastHit raycastHit2 = GetRaycastHit(grounding.root.right * grounding.footRadius * 0.5f); RaycastHit val5 = heelHit; if ((Object)(object)((RaycastHit)(ref val5)).collider != (Object)null || (Object)(object)((RaycastHit)(ref raycastHit)).collider != (Object)null || (Object)(object)((RaycastHit)(ref raycastHit2)).collider != (Object)null) { isGrounded = true; } Vector3 point = ((RaycastHit)(ref raycastHit)).point; RaycastHit val6 = heelHit; Vector3 val7 = point - ((RaycastHit)(ref val6)).point; Vector3 point2 = ((RaycastHit)(ref raycastHit2)).point; RaycastHit val8 = heelHit; Vector3 val9 = Vector3.Cross(val7, point2 - ((RaycastHit)(ref val8)).point); Vector3 val10 = ((Vector3)(ref val9)).normalized; if (Vector3.Dot(val10, up) < 0f) { val10 = -val10; } Vector3 planeNormal = val10; RaycastHit val11 = heelHit; Vector3 point3 = ((RaycastHit)(ref val11)).point; RaycastHit val12 = heelHit; SetFootToPlane(planeNormal, point3, ((RaycastHit)(ref val12)).point); break; } case Quality.Best: { heelHit = GetRaycastHit((!invertFootCenter) ? Vector3.zero : (-grounding.GetFootCenterOffset())); capsuleHit = GetCapsuleHit(val); RaycastHit val2 = heelHit; if (!((Object)(object)((RaycastHit)(ref val2)).collider != (Object)null)) { RaycastHit val3 = capsuleHit; if (!((Object)(object)((RaycastHit)(ref val3)).collider != (Object)null)) { goto IL_0332; } } isGrounded = true; goto IL_0332; } IL_0332: val13 = capsuleHit; normal = ((RaycastHit)(ref val13)).normal; val14 = capsuleHit; point4 = ((RaycastHit)(ref val14)).point; val15 = heelHit; SetFootToPlane(normal, point4, ((RaycastHit)(ref val15)).point); break; } float num = stepHeightFromGround; if (!grounding.rootGrounded) { num = 0f; } IKOffset = Interp.LerpValue(IKOffset, num, grounding.footSpeed, grounding.footSpeed); IKOffset = Mathf.Lerp(IKOffset, num, deltaTime * grounding.footSpeed); float verticalOffset = grounding.GetVerticalOffset(transformPosition, grounding.root.position); float num2 = Mathf.Clamp(grounding.maxStep - verticalOffset, 0f, grounding.maxStep); IKOffset = Mathf.Clamp(IKOffset, 0f - num2, IKOffset); RotateFoot(); IKPosition = transformPosition - up * IKOffset; float footRotationWeight = grounding.footRotationWeight; rotationOffset = ((!(footRotationWeight >= 1f)) ? Quaternion.Slerp(Quaternion.identity, r, footRotationWeight) : r); } private RaycastHit GetCapsuleHit(Vector3 offsetFromHeel) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) RaycastHit result = default(RaycastHit); Vector3 val = grounding.GetFootCenterOffset(); if (invertFootCenter) { val = -val; } Vector3 val2 = transformPosition + val; if (grounding.overstepFallsDown) { ((RaycastHit)(ref result)).point = val2 - up * grounding.maxStep; } else { ((RaycastHit)(ref result)).point = new Vector3(val2.x, grounding.root.position.y, val2.z); } ((RaycastHit)(ref result)).normal = up; Vector3 val3 = val2 + grounding.maxStep * up; Vector3 val4 = val3 + offsetFromHeel; if (Physics.CapsuleCast(val3, val4, grounding.footRadius, -up, ref result, grounding.maxStep * 2f, LayerMask.op_Implicit(grounding.layers), (QueryTriggerInteraction)1) && float.IsNaN(((RaycastHit)(ref result)).point.x)) { ((RaycastHit)(ref result)).point = val2 - up * grounding.maxStep * 2f; ((RaycastHit)(ref result)).normal = up; } if (((RaycastHit)(ref result)).point == Vector3.zero && ((RaycastHit)(ref result)).normal == Vector3.zero) { if (grounding.overstepFallsDown) { ((RaycastHit)(ref result)).point = val2 - up * grounding.maxStep; } else { ((RaycastHit)(ref result)).point = new Vector3(val2.x, grounding.root.position.y, val2.z); } } return result; } private RaycastHit GetRaycastHit(Vector3 offsetFromHeel) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) RaycastHit result = default(RaycastHit); Vector3 val = transformPosition + offsetFromHeel; if (grounding.overstepFallsDown) { ((RaycastHit)(ref result)).point = val - up * grounding.maxStep; } else { ((RaycastHit)(ref result)).point = new Vector3(val.x, grounding.root.position.y, val.z); } ((RaycastHit)(ref result)).normal = up; if (grounding.maxStep <= 0f) { return result; } Physics.Raycast(val + grounding.maxStep * up, -up, ref result, grounding.maxStep * 2f, LayerMask.op_Implicit(grounding.layers), (QueryTriggerInteraction)1); if (((RaycastHit)(ref result)).point == Vector3.zero && ((RaycastHit)(ref result)).normal == Vector3.zero) { if (grounding.overstepFallsDown) { ((RaycastHit)(ref result)).point = val - up * grounding.maxStep; } else { ((RaycastHit)(ref result)).point = new Vector3(val.x, grounding.root.position.y, val.z); } } return result; } private Vector3 RotateNormal(Vector3 normal) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (grounding.quality == Quality.Best) { return normal; } return Vector3.RotateTowards(up, normal, grounding.maxFootRotationAngle * ((float)Math.PI / 180f), deltaTime); } private void SetFootToPoint(Vector3 normal, Vector3 point) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) toHitNormal = Quaternion.FromToRotation(up, RotateNormal(normal)); heightFromGround = GetHeightFromGround(point); } private void SetFootToPlane(Vector3 planeNormal, Vector3 planePoint, Vector3 heelHitPoint) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) planeNormal = RotateNormal(planeNormal); toHitNormal = Quaternion.FromToRotation(up, planeNormal); Vector3 hitPoint = V3Tools.LineToPlane(transformPosition + up * grounding.maxStep, -up, planeNormal, planePoint); heightFromGround = GetHeightFromGround(hitPoint); float num = GetHeightFromGround(heelHitPoint); heightFromGround = Mathf.Clamp(heightFromGround, float.NegativeInfinity, num); } private float GetHeightFromGround(Vector3 hitPoint) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return grounding.GetVerticalOffset(transformPosition, hitPoint) - rootYOffset; } private void RotateFoot() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) Quaternion rotationOffsetTarget = GetRotationOffsetTarget(); r = Quaternion.Slerp(r, rotationOffsetTarget, deltaTime * grounding.footRotationSpeed); } private Quaternion GetRotationOffsetTarget() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (grounding.maxFootRotationAngle <= 0f) { return Quaternion.identity; } if (grounding.maxFootRotationAngle >= 180f) { return toHitNormal; } return Quaternion.RotateTowards(Quaternion.identity, toHitNormal, grounding.maxFootRotationAngle); } } public class Pelvis { private Grounding grounding; private Vector3 lastRootPosition; private float damperF; private bool initiated; private float lastTime; public Vector3 IKOffset { get; private set; } public float heightOffset { get; private set; } public void Initiate(Grounding grounding) { this.grounding = grounding; initiated = true; OnEnable(); } public void Reset() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) lastRootPosition = ((Component)grounding.root).transform.position; lastTime = Time.deltaTime; IKOffset = Vector3.zero; heightOffset = 0f; } public void OnEnable() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (initiated) { lastRootPosition = ((Component)grounding.root).transform.position; lastTime = Time.time; } } public void Process(float lowestOffset, float highestOffset, bool isGrounded) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } float num = Time.time - lastTime; lastTime = Time.time; if (!(num <= 0f)) { float num2 = lowestOffset + highestOffset; if (!grounding.rootGrounded) { num2 = 0f; } heightOffset = Mathf.Lerp(heightOffset, num2, num * grounding.pelvisSpeed); Vector3 p = grounding.root.position - lastRootPosition; lastRootPosition = grounding.root.position; damperF = Interp.LerpValue(damperF, (!isGrounded) ? 0f : 1f, 1f, 10f); heightOffset -= grounding.GetVerticalOffset(p, Vector3.zero) * grounding.pelvisDamper * damperF; IKOffset = grounding.up * heightOffset; } } } [Tooltip("Layers to ground the character to. Make sure to exclude the layer of the character controller.")] public LayerMask layers; [Tooltip("Max step height. Maximum vertical distance of Grounding from the root of the character.")] public float maxStep = 0.5f; [Tooltip("The height offset of the root.")] public float heightOffset; [Tooltip("The speed of moving the feet up/down.")] public float footSpeed = 2.5f; [Tooltip("CapsuleCast radius. Should match approximately with the size of the feet.")] public float footRadius = 0.15f; [Tooltip("Offset of the foot center along character forward axis.")] [HideInInspector] public float footCenterOffset; [Tooltip("Amount of velocity based prediction of the foot positions.")] public float prediction = 0.05f; [Tooltip("Weight of rotating the feet to the ground normal offset.")] [Range(0f, 1f)] public float footRotationWeight = 1f; [Tooltip("Speed of slerping the feet to their grounded rotations.")] public float footRotationSpeed = 7f; [Tooltip("Max Foot Rotation Angle. Max angular offset from the foot's rotation.")] [Range(0f, 90f)] public float maxFootRotationAngle = 45f; [Tooltip("If true, solver will rotate with the character root so the character can be grounded for example to spherical planets. For performance reasons leave this off unless needed.")] public bool rotateSolver; [Tooltip("The speed of moving the character up/down.")] public float pelvisSpeed = 5f; [Tooltip("Used for smoothing out vertical pelvis movement (range 0 - 1).")] [Range(0f, 1f)] public float pelvisDamper; [Tooltip("The weight of lowering the pelvis to the lowest foot.")] public float lowerPelvisWeight = 1f; [Tooltip("The weight of lifting the pelvis to the highest foot. This is useful when you don't want the feet to go too high relative to the body when crouching.")] public float liftPelvisWeight; [Tooltip("The radius of the spherecast from the root that determines whether the character root is grounded.")] public float rootSphereCastRadius = 0.1f; [Tooltip("If false, keeps the foot that is over a ledge at the root level. If true, lowers the overstepping foot and body by the 'Max Step' value.")] public bool overstepFallsDown = true; [Tooltip("The raycasting quality. Fastest is a single raycast per foot, Simple is three raycasts, Best is one raycast and a capsule cast per foot.")] public Quality quality = Quality.Best; private bool initiated; public Leg[] legs { get; private set; } public Pelvis pelvis { get; private set; } public bool isGrounded { get; private set; } public Transform root { get; private set; } public RaycastHit rootHit { get; private set; } public bool rootGrounded { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = rootHit; return ((RaycastHit)(ref val)).distance < maxStep * 2f; } } public Vector3 up => (!useRootRotation) ? Vector3.up : root.up; private bool useRootRotation { get { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!rotateSolver) { return false; } if (root.up == Vector3.up) { return false; } return true; } } public RaycastHit GetRootHit(float maxDistanceMlp = 10f) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) RaycastHit result = default(RaycastHit); Vector3 val = up; Vector3 val2 = Vector3.zero; Leg[] array = legs; foreach (Leg leg in array) { val2 += leg.transform.position; } val2 /= (float)legs.Length; ((RaycastHit)(ref result)).point = val2 - val * maxStep * 10f; float num = maxDistanceMlp + 1f; ((RaycastHit)(ref result)).distance = maxStep * num; if (maxStep <= 0f) { return result; } if (quality != Quality.Best) { Physics.Raycast(val2 + val * maxStep, -val, ref result, maxStep * num, LayerMask.op_Implicit(layers), (QueryTriggerInteraction)1); } else { Physics.SphereCast(val2 + val * maxStep, rootSphereCastRadius, -up, ref result, maxStep * num, LayerMask.op_Implicit(layers), (QueryTriggerInteraction)1); } return result; } public bool IsValid(ref string errorMessage) { if ((Object)(object)root == (Object)null) { errorMessage = "Root transform is null. Can't initiate Grounding."; return false; } if (legs == null) { errorMessage = "Grounding legs is null. Can't initiate Grounding."; return false; } if (pelvis == null) { errorMessage = "Grounding pelvis is null. Can't initiate Grounding."; return false; } if (legs.Length == 0) { errorMessage = "Grounding has 0 legs. Can't initiate Grounding."; return false; } return true; } public void Initiate(Transform root, Transform[] feet) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) this.root = root; initiated = false; rootHit = default(RaycastHit); if (legs == null) { legs = new Leg[feet.Length]; } if (legs.Length != feet.Length) { legs = new Leg[feet.Length]; } for (int i = 0; i < feet.Length; i++) { if (legs[i] == null) { legs[i] = new Leg(); } } if (pelvis == null) { pelvis = new Pelvis(); } string errorMessage = string.Empty; if (!IsValid(ref errorMessage)) { Warning.Log(errorMessage, root); } else if (Application.isPlaying) { for (int j = 0; j < feet.Length; j++) { legs[j].Initiate(this, feet[j]); } pelvis.Initiate(this); initiated = true; } } public void Update() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } if (LayerMask.op_Implicit(layers) == 0) { LogWarning("Grounding layers are set to nothing. Please add a ground layer."); } maxStep = Mathf.Clamp(maxStep, 0f, maxStep); footRadius = Mathf.Clamp(footRadius, 0.0001f, maxStep); pelvisDamper = Mathf.Clamp(pelvisDamper, 0f, 1f); rootSphereCastRadius = Mathf.Clamp(rootSphereCastRadius, 0.0001f, rootSphereCastRadius); maxFootRotationAngle = Mathf.Clamp(maxFootRotationAngle, 0f, 90f); prediction = Mathf.Clamp(prediction, 0f, prediction); footSpeed = Mathf.Clamp(footSpeed, 0f, footSpeed); rootHit = GetRootHit(); float num = float.NegativeInfinity; float num2 = float.PositiveInfinity; isGrounded = false; Leg[] array = legs; foreach (Leg leg in array) { leg.Process(); if (leg.IKOffset > num) { num = leg.IKOffset; } if (leg.IKOffset < num2) { num2 = leg.IKOffset; } if (leg.isGrounded) { isGrounded = true; } } num = Mathf.Max(num, 0f); num2 = Mathf.Min(num2, 0f); pelvis.Process((0f - num) * lowerPelvisWeight, (0f - num2) * liftPelvisWeight, isGrounded); } public Vector3 GetLegsPlaneNormal() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return Vector3.up; } Vector3 val = up; Vector3 val2 = val; for (int i = 0; i < legs.Length; i++) { Vector3 val3 = legs[i].IKPosition - root.position; Vector3 val4 = val; Vector3 val5 = val3; Vector3.OrthoNormalize(ref val4, ref val5); Quaternion val6 = Quaternion.FromToRotation(val5, val3); val2 = val6 * val2; } return val2; } public void Reset() { if (Application.isPlaying) { pelvis.Reset(); Leg[] array = legs; foreach (Leg leg in array) { leg.Reset(); } } } public void LogWarning(string message) { Warning.Log(message, root); } public float GetVerticalOffset(Vector3 p1, Vector3 p2) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (useRootRotation) { return (Quaternion.Inverse(root.rotation) * (p1 - p2)).y; } return p1.y - p2.y; } public Vector3 Flatten(Vector3 v) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (useRootRotation) { Vector3 val = v; Vector3 val2 = root.up; Vector3.OrthoNormalize(ref val2, ref val); return Vector3.Project(v, val); } v.y = 0f; return v; } public Vector3 GetFootCenterOffset() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) return root.forward * footRadius + root.forward * footCenterOffset; } } [HelpURL("https://www.youtube.com/watch?v=wT8fViZpLmQ&index=3&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Aim IK")] public class AimIK : IK { public IKSolverAim solver = new IKSolverAim(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page1.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_aim_i_k.html"); } [ContextMenu("TUTORIAL VIDEO")] private void OpenSetupTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=wT8fViZpLmQ"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page2.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Arm IK")] public class ArmIK : IK { public IKSolverArm solver = new IKSolverArm(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page2.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_arm_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page5.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/CCD IK")] public class CCDIK : IK { public IKSolverCCD solver = new IKSolverCCD(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page5.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_c_c_d_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page6.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/FABRIK")] public class FABRIK : IK { public IKSolverFABRIK solver = new IKSolverFABRIK(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page6.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_f_a_b_r_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page7.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/FABRIK Root")] public class FABRIKRoot : IK { public IKSolverFABRIKRoot solver = new IKSolverFABRIKRoot(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page7.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_f_a_b_r_i_k_root.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("https://www.youtube.com/watch?v=7__IafZGwvI&index=1&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Full Body Biped IK")] public class FullBodyBipedIK : IK { public BipedReferences references = new BipedReferences(); public IKSolverFullBodyBiped solver = new IKSolverFullBodyBiped(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page8.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_full_body_biped_i_k.html"); } [ContextMenu("TUTORIAL VIDEO (SETUP)")] private void OpenSetupTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=7__IafZGwvI"); } [ContextMenu("TUTORIAL VIDEO (INSPECTOR)")] private void OpenInspectorTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=tgRMsTphjJo"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public void SetReferences(BipedReferences references, Transform rootNode) { this.references = references; solver.SetToReferences(this.references, rootNode); } public override IKSolver GetIKSolver() { return solver; } public bool ReferencesError(ref string errorMessage) { if (BipedReferences.SetupError(references, ref errorMessage)) { return true; } if (references.spine.Length == 0) { errorMessage = "References has no spine bones assigned, can not initiate the solver."; return true; } if ((Object)(object)solver.rootNode == (Object)null) { errorMessage = "Root Node bone is null, can not initiate the solver."; return true; } if ((Object)(object)solver.rootNode != (Object)(object)references.pelvis) { bool flag = false; for (int i = 0; i < references.spine.Length; i++) { if ((Object)(object)solver.rootNode == (Object)(object)references.spine[i]) { flag = true; break; } } if (!flag) { errorMessage = "The Root Node has to be one of the bones in the Spine or the Pelvis, can not initiate the solver."; return true; } } return false; } public bool ReferencesWarning(ref string warningMessage) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) if (BipedReferences.SetupWarning(references, ref warningMessage)) { return true; } Vector3 val = references.rightUpperArm.position - references.leftUpperArm.position; Vector3 val2 = solver.rootNode.position - references.leftUpperArm.position; float num = Vector3.Dot(((Vector3)(ref val)).normalized, ((Vector3)(ref val2)).normalized); if (num > 0.95f) { warningMessage = "The root node, the left upper arm and the right upper arm bones should ideally form a triangle that is as close to equilateral as possible. Currently the root node bone seems to be very close to the line between the left upper arm and the right upper arm bones. This might cause unwanted behaviour like the spine turning upside down when pulled by a hand effector.Please set the root node bone to be one of the lower bones in the spine."; return true; } Vector3 val3 = references.rightThigh.position - references.leftThigh.position; Vector3 val4 = solver.rootNode.position - references.leftThigh.position; num = Vector3.Dot(((Vector3)(ref val3)).normalized, ((Vector3)(ref val4)).normalized); if (num > 0.95f) { warningMessage = "The root node, the left thigh and the right thigh bones should ideally form a triangle that is as close to equilateral as possible. Currently the root node bone seems to be very close to the line between the left thigh and the right thigh bones. This might cause unwanted behaviour like the hip turning upside down when pulled by an effector.Please set the root node bone to be one of the higher bones in the spine."; return true; } return false; } [ContextMenu("Reinitiate")] private void Reinitiate() { SetReferences(references, solver.rootNode); } [ContextMenu("Auto-detect References")] private void AutoDetectReferences() { references = new BipedReferences(); BipedReferences.AutoDetectReferences(ref references, ((Component)this).transform, new BipedReferences.AutoDetectParams(legsParentInSpine: true, includeEyes: false)); solver.rootNode = IKSolverFullBodyBiped.DetectRootNodeBone(references); solver.SetToReferences(references, solver.rootNode); } } public abstract class IK : SolverManager { public abstract IKSolver GetIKSolver(); protected override void UpdateSolver() { if (!GetIKSolver().initiated) { InitiateSolver(); } if (GetIKSolver().initiated) { GetIKSolver().Update(); } } protected override void InitiateSolver() { if (!GetIKSolver().initiated) { GetIKSolver().Initiate(((Component)this).transform); } } protected override void FixTransforms() { if (GetIKSolver().initiated) { GetIKSolver().FixTransforms(); } } protected abstract void OpenUserManual(); protected abstract void OpenScriptReference(); } public class IKExecutionOrder : MonoBehaviour { [Tooltip("The IK components, assign in the order in which you wish to update them.")] public IK[] IKComponents; [Tooltip("Optional. Assign it if you are using 'Animate Physics' as the Update Mode.")] public Animator animator; private bool fixedFrame; private bool animatePhysics { get { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Invalid comparison between Unknown and I4 if ((Object)(object)animator == (Object)null) { return false; } return (int)animator.updateMode == 1; } } private void Start() { for (int i = 0; i < IKComponents.Length; i++) { ((Behaviour)IKComponents[i]).enabled = false; } } private void Update() { if (!animatePhysics) { FixTransforms(); } } private void FixedUpdate() { fixedFrame = true; if (animatePhysics) { FixTransforms(); } } private void LateUpdate() { if (!animatePhysics || fixedFrame) { for (int i = 0; i < IKComponents.Length; i++) { IKComponents[i].GetIKSolver().Update(); } fixedFrame = false; } } private void FixTransforms() { for (int i = 0; i < IKComponents.Length; i++) { if (IKComponents[i].fixTransforms) { IKComponents[i].GetIKSolver().FixTransforms(); } } } } [HelpURL("http://www.root-motion.com/finalikdox/html/page11.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Leg IK")] public class LegIK : IK { public IKSolverLeg solver = new IKSolverLeg(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page11.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_leg_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page12.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Limb IK")] public class LimbIK : IK { public IKSolverLimb solver = new IKSolverLimb(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page12.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_limb_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page13.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Look At IK")] public class LookAtIK : IK { public IKSolverLookAt solver = new IKSolverLookAt(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page13.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_look_at_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page15.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Trigonometric IK")] public class TrigonometricIK : IK { public IKSolverTrigonometric solver = new IKSolverTrigonometric(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page15.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_trigonometric_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/VR IK")] public class VRIK : IK { [Serializable] public class References { public Transform root; public Transform pelvis; public Transform spine; [Tooltip("Optional")] public Transform chest; [Tooltip("Optional")] public Transform neck; public Transform head; [Tooltip("Optional")] public Transform leftShoulder; public Transform leftUpperArm; public Transform leftForearm; public Transform leftHand; [Tooltip("Optional")] public Transform rightShoulder; public Transform rightUpperArm; public Transform rightForearm; public Transform rightHand; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform leftThigh; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform leftCalf; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform leftFoot; [Tooltip("Optional")] public Transform leftToes; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform rightThigh; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform rightCalf; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform rightFoot; [Tooltip("Optional")] public Transform rightToes; public bool isFilled { get { if ((Object)(object)root == (Object)null || (Object)(object)pelvis == (Object)null || (Object)(object)spine == (Object)null || (Object)(object)head == (Object)null || (Object)(object)leftUpperArm == (Object)null || (Object)(object)leftForearm == (Object)null || (Object)(object)leftHand == (Object)null || (Object)(object)rightUpperArm == (Object)null || (Object)(object)rightForearm == (Object)null || (Object)(object)rightHand == (Object)null) { return false; } if ((Object)(object)leftThigh == (Object)null && (Object)(object)leftCalf == (Object)null && (Object)(object)leftFoot == (Object)null && (Object)(object)rightThigh == (Object)null && (Object)(object)rightCalf == (Object)null && (Object)(object)rightFoot == (Object)null) { return true; } if ((Object)(object)leftThigh == (Object)null || (Object)(object)leftCalf == (Object)null || (Object)(object)leftFoot == (Object)null || (Object)(object)rightThigh == (Object)null || (Object)(object)rightCalf == (Object)null || (Object)(object)rightFoot == (Object)null) { return false; } return true; } } public bool isEmpty { get { if ((Object)(object)root != (Object)null || (Object)(object)pelvis != (Object)null || (Object)(object)spine != (Object)null || (Object)(object)chest != (Object)null || (Object)(object)neck != (Object)null || (Object)(object)head != (Object)null || (Object)(object)leftShoulder != (Object)null || (Object)(object)leftUpperArm != (Object)null || (Object)(object)leftForearm != (Object)null || (Object)(object)leftHand != (Object)null || (Object)(object)rightShoulder != (Object)null || (Object)(object)rightUpperArm != (Object)null || (Object)(object)rightForearm != (Object)null || (Object)(object)rightHand != (Object)null || (Object)(object)leftThigh != (Object)null || (Object)(object)leftCalf != (Object)null || (Object)(object)leftFoot != (Object)null || (Object)(object)leftToes != (Object)null || (Object)(object)rightThigh != (Object)null || (Object)(object)rightCalf != (Object)null || (Object)(object)rightFoot != (Object)null || (Object)(object)rightToes != (Object)null) { return false; } return true; } } public Transform[] GetTransforms() { return (Transform[])(object)new Transform[22] { root, pelvis, spine, chest, neck, head, leftShoulder, leftUpperArm, leftForearm, leftHand, rightShoulder, rightUpperArm, rightForearm, rightHand, leftThigh, leftCalf, leftFoot, leftToes, rightThigh, rightCalf, rightFoot, rightToes }; } public static bool AutoDetectReferences(Transform root, out References references) { references = new References(); Animator componentInChildren = ((Component)root).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null || !componentInChildren.isHuman) { Debug.LogWarning((object)"VRIK needs a Humanoid Animator to auto-detect biped references. Please assign references manually."); return false; } references.root = root; references.pelvis = componentInChildren.GetBoneTransform((HumanBodyBones)0); references.spine = componentInChildren.GetBoneTransform((HumanBodyBones)7); references.chest = componentInChildren.GetBoneTransform((HumanBodyBones)8); references.neck = componentInChildren.GetBoneTransform((HumanBodyBones)9); references.head = componentInChildren.GetBoneTransform((HumanBodyBones)10); references.leftShoulder = componentInChildren.GetBoneTransform((HumanBodyBones)11); references.leftUpperArm = componentInChildren.GetBoneTransform((HumanBodyBones)13); references.leftForearm = componentInChildren.GetBoneTransform((HumanBodyBones)15); references.leftHand = componentInChildren.GetBoneTransform((HumanBodyBones)17); references.rightShoulder = componentInChildren.GetBoneTransform((HumanBodyBones)12); references.rightUpperArm = componentInChildren.GetBoneTransform((HumanBodyBones)14); references.rightForearm = componentInChildren.GetBoneTransform((HumanBodyBones)16); references.rightHand = componentInChildren.GetBoneTransform((HumanBodyBones)18); references.leftThigh = componentInChildren.GetBoneTransform((HumanBodyBones)1); references.leftCalf = componentInChildren.GetBoneTransform((HumanBodyBones)3); references.leftFoot = componentInChildren.GetBoneTransform((HumanBodyBones)5); references.leftToes = componentInChildren.GetBoneTransform((HumanBodyBones)19); references.rightThigh = componentInChildren.GetBoneTransform((HumanBodyBones)2); references.rightCalf = componentInChildren.GetBoneTransform((HumanBodyBones)4); references.rightFoot = componentInChildren.GetBoneTransform((HumanBodyBones)6); references.rightToes = componentInChildren.GetBoneTransform((HumanBodyBones)20); return true; } } [ContextMenuItem("Auto-detect References", "AutoDetectReferences")] [Tooltip("Bone mapping. Right-click on the component header and select 'Auto-detect References' of fill in manually if not a Humanoid character. Chest, neck, shoulder and toe bones are optional. VRIK also supports legless characters. If you do not wish to use legs, leave all leg references empty.")] public References references = new References(); [Tooltip("The VRIK solver.")] public IKSolverVR solver = new IKSolverVR(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page16.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_v_r_i_k.html"); } [ContextMenu("TUTORIAL VIDEO (STEAMVR SETUP)")] private void OpenSetupTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=6Pfx7lYQiIA&feature=youtu.be"); } [ContextMenu("Auto-detect References")] public void AutoDetectReferences() { References.AutoDetectReferences(((Component)this).transform, out references); } [ContextMenu("Guess Hand Orientations")] public void GuessHandOrientations() { solver.GuessHandOrientations(references, onlyIfZero: false); } public override IKSolver GetIKSolver() { return solver; } protected override void InitiateSolver() { if (references.isEmpty) { AutoDetectReferences(); } if (references.isFilled) { solver.SetToReferences(references); } base.InitiateSolver(); } protected override void UpdateSolver() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)references.root != (Object)null && references.root.localScale == Vector3.zero) { Debug.LogError((object)"VRIK Root Transform's scale is zero, can not update VRIK. Make sure you have not calibrated the character to a zero scale.", (Object)(object)((Component)this).transform); ((Behaviour)this).enabled = false; } else { base.UpdateSolver(); } } } [Serializable] public class FABRIKChain { public FABRIK ik; [Range(0f, 1f)] public float pull = 1f; [Range(0f, 1f)] public float pin = 1f; public int[] children = new int[0]; public bool IsValid(ref string message) { if ((Object)(object)ik == (Object)null) { message = "IK unassigned in FABRIKChain."; return false; } if (!ik.solver.IsValid(ref message)) { return false; } return true; } public void Initiate() { ((Behaviour)ik).enabled = false; } public void Stage1(FABRIKChain[] chain) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < children.Length; i++) { chain[children[i]].Stage1(chain); } if (children.Length == 0) { ik.solver.SolveForward(ik.solver.GetIKPosition()); } else { ik.solver.SolveForward(GetCentroid(chain)); } } public void Stage2(Vector3 rootPosition, FABRIKChain[] chain) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) ik.solver.SolveBackward(rootPosition); for (int i = 0; i < children.Length; i++) { chain[children[i]].Stage2(ik.solver.bones[ik.solver.bones.Length - 1].transform.position, chain); } } private Vector3 GetCentroid(FABRIKChain[] chain) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) Vector3 iKPosition = ik.solver.GetIKPosition(); if (pin >= 1f) { return iKPosition; } float num = 0f; for (int i = 0; i < children.Length; i++) { num += chain[children[i]].pull; } if (num <= 0f) { return iKPosition; } if (num < 1f) { num = 1f; } Vector3 val = iKPosition; for (int j = 0; j < children.Length; j++) { Vector3 val2 = chain[children[j]].ik.solver.bones[0].solverPosition - iKPosition; float num2 = chain[children[j]].pull / num; val += val2 * num2; } if (pin <= 0f) { return val; } return val + (iKPosition - val) * pin; } } public class FBBIKArmBending : MonoBehaviour { public FullBodyBipedIK ik; public Vector3 bendDirectionOffsetLeft; public Vector3 bendDirectionOffsetRight; public Vector3 characterSpaceBendOffsetLeft; public Vector3 characterSpaceBendOffsetRight; private Quaternion leftHandTargetRotation; private Quaternion rightHandTargetRotation; private bool initiated; private void LateUpdate() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ik == (Object)null)) { if (!initiated) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostFBBIK)); initiated = true; } if ((Object)(object)ik.solver.leftHandEffector.target != (Object)null) { Vector3 left = Vector3.left; ik.solver.leftArmChain.bendConstraint.direction = ik.solver.leftHandEffector.target.rotation * left + ik.solver.leftHandEffector.target.rotation * bendDirectionOffsetLeft + ((Component)ik).transform.rotation * characterSpaceBendOffsetLeft; ik.solver.leftArmChain.bendConstraint.weight = 1f; } if ((Object)(object)ik.solver.rightHandEffector.target != (Object)null) { Vector3 right = Vector3.right; ik.solver.rightArmChain.bendConstraint.direction = ik.solver.rightHandEffector.target.rotation * right + ik.solver.rightHandEffector.target.rotation * bendDirectionOffsetRight + ((Component)ik).transform.rotation * characterSpaceBendOffsetRight; ik.solver.rightArmChain.bendConstraint.weight = 1f; } } } private void OnPostFBBIK() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ik == (Object)null)) { if ((Object)(object)ik.solver.leftHandEffector.target != (Object)null) { ik.references.leftHand.rotation = ik.solver.leftHandEffector.target.rotation; } if ((Object)(object)ik.solver.rightHandEffector.target != (Object)null) { ik.references.rightHand.rotation = ik.solver.rightHandEffector.target.rotation; } } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostFBBIK)); } } } public class FBBIKHeadEffector : MonoBehaviour { [Serializable] public class BendBone { [Tooltip("Assign spine and/or neck bones.")] public Transform transform; [Tooltip("The weight of rotating this bone.")] [Range(0f, 1f)] public float weight = 0.5f; private Quaternion defaultLocalRotation = Quaternion.identity; public BendBone() { }//IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) public BendBone(Transform transform, float weight) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) this.transform = transform; this.weight = weight; } public void StoreDefaultLocalState() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) defaultLocalRotation = transform.localRotation; } public void FixTransforms() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) transform.localRotation = defaultLocalRotation; } } [Tooltip("Reference to the FBBIK component.")] public FullBodyBipedIK ik; [LargeHeader("Position")] [Tooltip("Master weight for positioning the head.")] [Range(0f, 1f)] public float positionWeight = 1f; [Tooltip("The weight of moving the body along with the head")] [Range(0f, 1f)] public float bodyWeight = 0.8f; [Tooltip("The weight of moving the thighs along with the head")] [Range(0f, 1f)] public float thighWeight = 0.8f; [Tooltip("If false, hands will not pull the head away if they are too far. Disabling this will improve performance significantly.")] public bool handsPullBody = true; [LargeHeader("Rotation")] [Tooltip("The weight of rotating the head bone after solving")] [Range(0f, 1f)] public float rotationWeight = 0f; [Tooltip("Clamping the rotation of the body")] [Range(0f, 1f)] public float bodyClampWeight = 0.5f; [Tooltip("Clamping the rotation of the head")] [Range(0f, 1f)] public float headClampWeight = 0.5f; [Tooltip("The master weight of bending/twisting the spine to the rotation of the head effector. This is similar to CCD, but uses the rotation of the head effector not the position.")] [Range(0f, 1f)] public float bendWeight = 1f; [Tooltip("The bones to use for bending.")] public BendBone[] bendBones = new BendBone[0]; [LargeHeader("CCD")] [Tooltip("Optional. The master weight of the CCD (Cyclic Coordinate Descent) IK effect that bends the spine towards the head effector before FBBIK solves.")] [Range(0f, 1f)] public float CCDWeight = 1f; [Tooltip("The weight of rolling the bones in towards the target")] [Range(0f, 1f)] public float roll = 0f; [Tooltip("Smoothing the CCD effect.")] [Range(0f, 1000f)] public float damper = 500f; [Tooltip("Bones to use for the CCD pass. Assign spine and/or neck bones.")] public Transform[] CCDBones = (Transform[])(object)new Transform[0]; [LargeHeader("Stretching")] [Tooltip("Stretching the spine/neck to help reach the target. This is useful for making sure the head stays locked relative to the VR headset. NB! Stretching is done after FBBIK has solved so if you have the hand effectors pinned and spine bones included in the 'Stretch Bones', the hands might become offset from their target positions.")] [Range(0f, 1f)] public float postStretchWeight = 1f; [Tooltip("Stretch magnitude limit.")] public float maxStretch = 0.1f; [Tooltip("If > 0, dampers the stretching effect.")] public float stretchDamper = 0f; [Tooltip("If true, will fix head position to this Transform no matter what. Good for making sure the head will not budge away from the VR headset")] public bool fixHead; [Tooltip("Bones to use for stretching. The more bones you add, the less noticable the effect.")] public Transform[] stretchBones = (Transform[])(object)new Transform[0]; [LargeHeader("Chest Direction")] public Vector3 chestDirection = Vector3.forward; [Range(0f, 1f)] public float chestDirectionWeight = 1f; public Transform[] chestBones = (Transform[])(object)new Transform[0]; public IKSolver.UpdateDelegate OnPostHeadEffectorFK; private Vector3 offset; private Vector3 headToBody; private Vector3 shoulderCenterToHead; private Vector3 headToLeftThigh; private Vector3 headToRightThigh; private Vector3 leftShoulderPos; private Vector3 rightShoulderPos; private float shoulderDist; private float leftShoulderDist; private float rightShoulderDist; private Quaternion chestRotation; private Quaternion headRotationRelativeToRoot; private Quaternion[] ccdDefaultLocalRotations = (Quaternion[])(object)new Quaternion[0]; private Vector3 headLocalPosition; private Quaternion headLocalRotation; private Vector3[] stretchLocalPositions = (Vector3[])(object)new Vector3[0]; private Quaternion[] stretchLocalRotations = (Quaternion[])(object)new Quaternion[0]; private Vector3[] chestLocalPositions = (Vector3[])(object)new Vector3[0]; private Quaternion[] chestLocalRotations = (Quaternion[])(object)new Quaternion[0]; private int bendBonesCount; private int ccdBonesCount; private int stretchBonesCount; private int chestBonesCount; private void Start() { //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) IKSolverFullBodyBiped solver = ik.solver; solver.OnPreRead = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreRead, new IKSolver.UpdateDelegate(OnPreRead)); IKSolverFullBodyBiped solver2 = ik.solver; solver2.OnPreIteration = (IKSolver.IterationDelegate)Delegate.Combine(solver2.OnPreIteration, new IKSolver.IterationDelegate(Iterate)); IKSolverFullBodyBiped solver3 = ik.solver; solver3.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver3.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostUpdate)); IKSolverFullBodyBiped solver4 = ik.solver; solver4.OnStoreDefaultLocalState = (IKSolver.UpdateDelegate)Delegate.Combine(solver4.OnStoreDefaultLocalState, new IKSolver.UpdateDelegate(OnStoreDefaultLocalState)); IKSolverFullBodyBiped solver5 = ik.solver; solver5.OnFixTransforms = (IKSolver.UpdateDelegate)Delegate.Combine(solver5.OnFixTransforms, new IKSolver.UpdateDelegate(OnFixTransforms)); OnStoreDefaultLocalState(); headRotationRelativeToRoot = Quaternion.Inverse(ik.references.root.rotation) * ik.references.head.rotation; } private void OnStoreDefaultLocalState() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) BendBone[] array = bendBones; for (int i = 0; i < array.Length; i++) { array[i]?.StoreDefaultLocalState(); } ccdDefaultLocalRotations = (Quaternion[])(object)new Quaternion[CCDBones.Length]; for (int j = 0; j < CCDBones.Length; j++) { if ((Object)(object)CCDBones[j] != (Object)null) { ref Quaternion reference = ref ccdDefaultLocalRotations[j]; reference = CCDBones[j].localRotation; } } headLocalPosition = ik.references.head.localPosition; headLocalRotation = ik.references.head.localRotation; stretchLocalPositions = (Vector3[])(object)new Vector3[stretchBones.Length]; stretchLocalRotations = (Quaternion[])(object)new Quaternion[stretchBones.Length]; for (int k = 0; k < stretchBones.Length; k++) { if ((Object)(object)stretchBones[k] != (Object)null) { ref Vector3 reference2 = ref stretchLocalPositions[k]; reference2 = stretchBones[k].localPosition; ref Quaternion reference3 = ref stretchLocalRotations[k]; reference3 = stretchBones[k].localRotation; } } chestLocalPositions = (Vector3[])(object)new Vector3[chestBones.Length]; chestLocalRotations = (Quaternion[])(object)new Quaternion[chestBones.Length]; for (int l = 0; l < chestBones.Length; l++) { if ((Object)(object)chestBones[l] != (Object)null) { ref Vector3 reference4 = ref chestLocalPositions[l]; reference4 = chestBones[l].localPosition; ref Quaternion reference5 = ref chestLocalRotations[l]; reference5 = chestBones[l].localRotation; } } bendBonesCount = bendBones.Length; ccdBonesCount = CCDBones.Length; stretchBonesCount = stretchBones.Length; chestBonesCount = chestBones.Length; } private void OnFixTransforms() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } BendBone[] array = bendBones; for (int i = 0; i < array.Length; i++) { array[i]?.FixTransforms(); } for (int j = 0; j < CCDBones.Length; j++) { if ((Object)(object)CCDBones[j] != (Object)null) { CCDBones[j].localRotation = ccdDefaultLocalRotations[j]; } } ik.references.head.localPosition = headLocalPosition; ik.references.head.localRotation = headLocalRotation; for (int k = 0; k < stretchBones.Length; k++) { if ((Object)(object)stretchBones[k] != (Object)null) { stretchBones[k].localPosition = stretchLocalPositions[k]; stretchBones[k].localRotation = stretchLocalRotations[k]; } } for (int l = 0; l < chestBones.Length; l++) { if ((Object)(object)chestBones[l] != (Object)null) { chestBones[l].localPosition = chestLocalPositions[l]; chestBones[l].localRotation = chestLocalRotations[l]; } } } private void OnPreRead() { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled && ((Component)this).gameObject.activeInHierarchy && ik.solver.iterations != 0) { ik.solver.FABRIKPass = handsPullBody; if (bendBonesCount != bendBones.Length || ccdBonesCount != CCDBones.Length || stretchBonesCount != stretchBones.Length || chestBonesCount != chestBones.Length) { OnStoreDefaultLocalState(); } ChestDirection(); SpineBend(); CCDPass(); offset = ((Component)this).transform.position - ik.references.head.position; shoulderDist = Vector3.Distance(ik.references.leftUpperArm.position, ik.references.rightUpperArm.position); leftShoulderDist = Vector3.Distance(ik.references.head.position, ik.references.leftUpperArm.position); rightShoulderDist = Vector3.Distance(ik.references.head.position, ik.references.rightUpperArm.position); headToBody = ik.solver.rootNode.position - ik.references.head.position; headToLeftThigh = ik.references.leftThigh.position - ik.references.head.position; headToRightThigh = ik.references.rightThigh.position - ik.references.head.position; leftShoulderPos = ik.references.leftUpperArm.position + offset * bodyWeight; rightShoulderPos = ik.references.rightUpperArm.position + offset * bodyWeight; chestRotation = Quaternion.LookRotation(ik.references.head.position - ik.references.leftUpperArm.position, ik.references.rightUpperArm.position - ik.references.leftUpperArm.position); if (OnPostHeadEffectorFK != null) { OnPostHeadEffectorFK(); } } } private void SpineBend() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) float num = bendWeight * ik.solver.IKPositionWeight; if (num <= 0f || bendBones.Length == 0) { return; } Quaternion rotation = ((Component)this).transform.rotation * Quaternion.Inverse(ik.references.root.rotation * headRotationRelativeToRoot); rotation = QuaTools.ClampRotation(rotation, bodyClampWeight, 2); float num2 = 1f / (float)bendBones.Length; for (int i = 0; i < bendBones.Length; i++) { if ((Object)(object)bendBones[i].transform != (Object)null) { bendBones[i].transform.rotation = Quaternion.Lerp(Quaternion.identity, rotation, num2 * bendBones[i].weight * num) * bendBones[i].transform.rotation; } } } private void CCDPass() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) float num = CCDWeight * ik.solver.IKPositionWeight; if (!(num <= 0f)) { for (int num2 = CCDBones.Length - 1; num2 > -1; num2--) { Quaternion val = Quaternion.FromToRotation(ik.references.head.position - CCDBones[num2].position, ((Component)this).transform.position - CCDBones[num2].position) * CCDBones[num2].rotation; float num3 = Mathf.Lerp((float)((CCDBones.Length - num2) / CCDBones.Length), 1f, roll); float num4 = Quaternion.Angle(Quaternion.identity, val); num4 = Mathf.Lerp(0f, num4, (damper - num4) / damper); CCDBones[num2].rotation = Quaternion.RotateTowards(CCDBones[num2].rotation, val, num4 * num * num3); } } } private void Iterate(int iteration) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled && ((Component)this).gameObject.activeInHierarchy && ik.solver.iterations != 0) { Vector3 position = ((Component)this).transform.position; Vector3 val = leftShoulderPos - ((Component)this).transform.position; leftShoulderPos = position + ((Vector3)(ref val)).normalized * leftShoulderDist; Vector3 position2 = ((Component)this).transform.position; Vector3 val2 = rightShoulderPos - ((Component)this).transform.position; rightShoulderPos = position2 + ((Vector3)(ref val2)).normalized * rightShoulderDist; Solve(ref leftShoulderPos, ref rightShoulderPos, shoulderDist); LerpSolverPosition(ik.solver.leftShoulderEffector, leftShoulderPos, positionWeight * ik.solver.IKPositionWeight, ik.solver.leftShoulderEffector.positionOffset); LerpSolverPosition(ik.solver.rightShoulderEffector, rightShoulderPos, positionWeight * ik.solver.IKPositionWeight, ik.solver.rightShoulderEffector.positionOffset); Quaternion to = Quaternion.LookRotation(((Component)this).transform.position - leftShoulderPos, rightShoulderPos - leftShoulderPos); Quaternion val3 = QuaTools.FromToRotation(chestRotation, to); Vector3 val4 = val3 * headToBody; LerpSolverPosition(ik.solver.bodyEffector, ((Component)this).transform.position + val4, positionWeight * ik.solver.IKPositionWeight, ik.solver.bodyEffector.positionOffset - ik.solver.pullBodyOffset); Quaternion val5 = Quaternion.Lerp(Quaternion.identity, val3, thighWeight); Vector3 val6 = val5 * headToLeftThigh; Vector3 val7 = val5 * headToRightThigh; LerpSolverPosition(ik.solver.leftThighEffector, ((Component)this).transform.position + val6, positionWeight * ik.solver.IKPositionWeight, ik.solver.bodyEffector.positionOffset - ik.solver.pullBodyOffset + ik.solver.leftThighEffector.positionOffset); LerpSolverPosition(ik.solver.rightThighEffector, ((Component)this).transform.position + val7, positionWeight * ik.solver.IKPositionWeight, ik.solver.bodyEffector.positionOffset - ik.solver.pullBodyOffset + ik.solver.rightThighEffector.positionOffset); } } private void OnPostUpdate() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled && ((Component)this).gameObject.activeInHierarchy) { PostStretching(); Quaternion rotation = QuaTools.FromToRotation(ik.references.head.rotation, ((Component)this).transform.rotation); rotation = QuaTools.ClampRotation(rotation, headClampWeight, 2); ik.references.head.rotation = Quaternion.Lerp(Quaternion.identity, rotation, rotationWeight * ik.solver.IKPositionWeight) * ik.references.head.rotation; } } private void ChestDirection() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) float num = chestDirectionWeight * ik.solver.IKPositionWeight; if (num <= 0f) { return; } bool changed = false; chestDirection = V3Tools.ClampDirection(chestDirection, ik.references.root.forward, 0.45f, 2, out changed); if (!(chestDirection == Vector3.zero)) { Quaternion val = Quaternion.FromToRotation(ik.references.root.forward, chestDirection); val = Quaternion.Lerp(Quaternion.identity, val, num * (1f / (float)chestBones.Length)); Transform[] array = chestBones; foreach (Transform val2 in array) { val2.rotation = val * val2.rotation; } } } private void PostStretching() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) float num = postStretchWeight * ik.solver.IKPositionWeight; if (num > 0f) { Vector3 val = Vector3.ClampMagnitude(((Component)this).transform.position - ik.references.head.position, maxStretch); val *= num; stretchDamper = Mathf.Max(stretchDamper, 0f); if (stretchDamper > 0f) { val /= (1f + ((Vector3)(ref val)).magnitude) * (1f + stretchDamper); } for (int i = 0; i < stretchBones.Length; i++) { if ((Object)(object)stretchBones[i] != (Object)null) { Transform obj = stretchBones[i]; obj.position += val / (float)stretchBones.Length; } } } if (fixHead && ik.solver.IKPositionWeight > 0f) { ik.references.head.position = ((Component)this).transform.position; } } private void LerpSolverPosition(IKEffector effector, Vector3 position, float weight, Vector3 offset) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) effector.GetNode(ik.solver).solverPosition = Vector3.Lerp(effector.GetNode(ik.solver).solverPosition, position + offset, weight); } private void Solve(ref Vector3 pos1, ref Vector3 pos2, float nominalDistance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos2 - pos1; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude != nominalDistance && magnitude != 0f) { float num = 1f; num *= 1f - nominalDistance / magnitude; Vector3 val2 = val * num * 0.5f; pos1 += val2; pos2 -= val2; } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPreRead = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreRead, new IKSolver.UpdateDelegate(OnPreRead)); IKSolverFullBodyBiped solver2 = ik.solver; solver2.OnPreIteration = (IKSolver.IterationDelegate)Delegate.Remove(solver2.OnPreIteration, new IKSolver.IterationDelegate(Iterate)); IKSolverFullBodyBiped solver3 = ik.solver; solver3.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver3.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostUpdate)); IKSolverFullBodyBiped solver4 = ik.solver; solver4.OnStoreDefaultLocalState = (IKSolver.UpdateDelegate)Delegate.Remove(solver4.OnStoreDefaultLocalState, new IKSolver.UpdateDelegate(OnStoreDefaultLocalState)); IKSolverFullBodyBiped solver5 = ik.solver; solver5.OnFixTransforms = (IKSolver.UpdateDelegate)Delegate.Remove(solver5.OnFixTransforms, new IKSolver.UpdateDelegate(OnFixTransforms)); } } } [Serializable] public class FBIKChain { [Serializable] public class ChildConstraint { public float pushElasticity = 0f; public float pullElasticity = 0f; [SerializeField] private Transform bone1; [SerializeField] private Transform bone2; private float crossFade; private float inverseCrossFade; private int chain1Index; private int chain2Index; public float nominalDistance { get; private set; } public bool isRigid { get; private set; } public ChildConstraint(Transform bone1, Transform bone2, float pushElasticity = 0f, float pullElasticity = 0f) { this.bone1 = bone1; this.bone2 = bone2; this.pushElasticity = pushElasticity; this.pullElasticity = pullElasticity; } public void Initiate(IKSolverFullBody solver) { chain1Index = solver.GetChainIndex(bone1); chain2Index = solver.GetChainIndex(bone2); OnPreSolve(solver); } public void OnPreSolve(IKSolverFullBody solver) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) nominalDistance = Vector3.Distance(solver.chain[chain1Index].nodes[0].transform.position, solver.chain[chain2Index].nodes[0].transform.position); isRigid = pushElasticity <= 0f && pullElasticity <= 0f; if (isRigid) { float num = solver.chain[chain1Index].pull - solver.chain[chain2Index].pull; crossFade = 1f - (0.5f + num * 0.5f); } else { crossFade = 0.5f; } inverseCrossFade = 1f - crossFade; } public void Solve(IKSolverFullBody solver) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) if (pushElasticity >= 1f && pullElasticity >= 1f) { return; } Vector3 val = solver.chain[chain2Index].nodes[0].solverPosition - solver.chain[chain1Index].nodes[0].solverPosition; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude != nominalDistance && magnitude != 0f) { float num = 1f; if (!isRigid) { float num2 = ((!(magnitude > nominalDistance)) ? pushElasticity : pullElasticity); num = 1f - num2; } num *= 1f - nominalDistance / magnitude; Vector3 val2 = val * num; IKSolver.Node obj = solver.chain[chain1Index].nodes[0]; obj.solverPosition += val2 * crossFade; IKSolver.Node obj2 = solver.chain[chain2Index].nodes[0]; obj2.solverPosition -= val2 * inverseCrossFade; } } } [Serializable] public enum Smoothing { None, Exponential, Cubic } [Range(0f, 1f)] public float pin; [Range(0f, 1f)] public float pull = 1f; [Range(0f, 1f)] public float push; [Range(-1f, 1f)] public float pushParent; [Range(0f, 1f)] public float reach = 0.1f; public Smoothing reachSmoothing = Smoothing.Exponential; public Smoothing pushSmoothing = Smoothing.Exponential; public IKSolver.Node[] nodes = new IKSolver.Node[0]; public int[] children = new int[0]; public ChildConstraint[] childConstraints = new ChildConstraint[0]; public IKConstraintBend bendConstraint = new IKConstraintBend(); private float rootLength; private bool initiated; private float length; private float distance; private IKSolver.Point p; private float reachForce; private float pullParentSum; private float[] crossFades; private float sqrMag1; private float sqrMag2; private float sqrMagDif; private const float maxLimbLength = 0.99999f; public FBIKChain() { } public FBIKChain(float pin, float pull, params Transform[] nodeTransforms) { this.pin = pin; this.pull = pull; SetNodes(nodeTransforms); children = new int[0]; } public void SetNodes(params Transform[] boneTransforms) { nodes = new IKSolver.Node[boneTransforms.Length]; for (int i = 0; i < boneTransforms.Length; i++) { nodes[i] = new IKSolver.Node(boneTransforms[i]); } } public int GetNodeIndex(Transform boneTransform) { for (int i = 0; i < nodes.Length; i++) { if ((Object)(object)nodes[i].transform == (Object)(object)boneTransform) { return i; } } return -1; } public bool IsValid(ref string message) { if (nodes.Length == 0) { message = "FBIK chain contains no nodes."; return false; } IKSolver.Node[] array = nodes; foreach (IKSolver.Node node in array) { if ((Object)(object)node.transform == (Object)null) { message = "Node transform is null in FBIK chain."; return false; } } return true; } public void Initiate(IKSolverFullBody solver) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) initiated = false; IKSolver.Node[] array = nodes; foreach (IKSolver.Node node in array) { node.solverPosition = node.transform.position; } CalculateBoneLengths(solver); ChildConstraint[] array2 = childConstraints; foreach (ChildConstraint childConstraint in array2) { childConstraint.Initiate(solver); } if (nodes.Length == 3) { bendConstraint.SetBones(nodes[0].transform, nodes[1].transform, nodes[2].transform); bendConstraint.Initiate(solver); } crossFades = new float[children.Length]; initiated = true; } public void ReadPose(IKSolverFullBody solver, bool fullBody) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } for (int i = 0; i < nodes.Length; i++) { nodes[i].solverPosition = nodes[i].transform.position + nodes[i].offset; } CalculateBoneLengths(solver); if (!fullBody) { return; } for (int j = 0; j < childConstraints.Length; j++) { childConstraints[j].OnPreSolve(solver); } if (children.Length > 0) { float num = nodes[nodes.Length - 1].effectorPositionWeight; for (int k = 0; k < children.Length; k++) { num += solver.chain[children[k]].nodes[0].effectorPositionWeight * solver.chain[children[k]].pull; } num = Mathf.Clamp(num, 1f, float.PositiveInfinity); for (int l = 0; l < children.Length; l++) { crossFades[l] = solver.chain[children[l]].nodes[0].effectorPositionWeight * solver.chain[children[l]].pull / num; } } pullParentSum = 0f; for (int m = 0; m < children.Length; m++) { pullParentSum += solver.chain[children[m]].pull; } pullParentSum = Mathf.Clamp(pullParentSum, 1f, float.PositiveInfinity); if (nodes.Length == 3) { reachForce = reach * Mathf.Clamp(nodes[2].effectorPositionWeight, 0f, 1f); } else { reachForce = 0f; } if (push > 0f && nodes.Length > 1) { distance = Vector3.Distance(nodes[0].transform.position, nodes[nodes.Length - 1].transform.position); } } private void CalculateBoneLengths(IKSolverFullBody solver) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) length = 0f; for (int i = 0; i < nodes.Length - 1; i++) { nodes[i].length = Vector3.Distance(nodes[i].transform.position, nodes[i + 1].transform.position); length += nodes[i].length; if (nodes[i].length == 0f) { Warning.Log("Bone " + ((Object)nodes[i].transform).name + " - " + ((Object)nodes[i + 1].transform).name + " length is zero, can not solve.", nodes[i].transform); return; } } for (int j = 0; j < children.Length; j++) { FBIKChain obj = solver.chain[children[j]]; Vector3 val = solver.chain[children[j]].nodes[0].transform.position - nodes[nodes.Length - 1].transform.position; obj.rootLength = ((Vector3)(ref val)).magnitude; if (solver.chain[children[j]].rootLength == 0f) { return; } } if (nodes.Length == 3) { sqrMag1 = nodes[0].length * nodes[0].length; sqrMag2 = nodes[1].length * nodes[1].length; sqrMagDif = sqrMag1 - sqrMag2; } } public void Reach(IKSolverFullBody solver) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } for (int i = 0; i < children.Length; i++) { solver.chain[children[i]].Reach(solver); } if (reachForce <= 0f) { return; } Vector3 val = nodes[2].solverPosition - nodes[0].solverPosition; if (!(val == Vector3.zero)) { float magnitude = ((Vector3)(ref val)).magnitude; Vector3 val2 = val / magnitude * length; float num = Mathf.Clamp(magnitude / length, 1f - reachForce, 1f + reachForce) - 1f; num = Mathf.Clamp(num + reachForce, -1f, 1f); switch (reachSmoothing) { case Smoothing.Exponential: num *= num; break; case Smoothing.Cubic: num *= num * num; break; } Vector3 val3 = val2 * Mathf.Clamp(num, 0f, magnitude); IKSolver.Node obj = nodes[0]; obj.solverPosition += val3 * (1f - nodes[0].effectorPositionWeight); IKSolver.Node obj2 = nodes[2]; obj2.solverPosition += val3; } } public Vector3 Push(IKSolverFullBody solver) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; for (int i = 0; i < children.Length; i++) { val += solver.chain[children[i]].Push(solver) * solver.chain[children[i]].pushParent; } IKSolver.Node obj = nodes[nodes.Length - 1]; obj.solverPosition += val; if (nodes.Length < 2) { return Vector3.zero; } if (push <= 0f) { return Vector3.zero; } Vector3 val2 = nodes[2].solverPosition - nodes[0].solverPosition; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude == 0f) { return Vector3.zero; } float num = 1f - magnitude / distance; if (num <= 0f) { return Vector3.zero; } switch (pushSmoothing) { case Smoothing.Exponential: num *= num; break; case Smoothing.Cubic: num *= num * num; break; } Vector3 val3 = -val2 * num * push; IKSolver.Node obj2 = nodes[0]; obj2.solverPosition += val3; return val3; } public void SolveTrigonometric(IKSolverFullBody solver, bool calculateBendDirection = false) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } for (int i = 0; i < children.Length; i++) { solver.chain[children[i]].SolveTrigonometric(solver, calculateBendDirection); } if (nodes.Length == 3) { Vector3 val = nodes[2].solverPosition - nodes[0].solverPosition; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude != 0f) { float num = Mathf.Clamp(magnitude, 0f, length * 0.99999f); Vector3 direction = val / magnitude * num; Vector3 bendDirection = ((!calculateBendDirection || !bendConstraint.initiated) ? (nodes[1].solverPosition - nodes[0].solverPosition) : bendConstraint.GetDir(solver)); Vector3 dirToBendPoint = GetDirToBendPoint(direction, bendDirection, num); nodes[1].solverPosition = nodes[0].solverPosition + dirToBendPoint; } } } public void Stage1(IKSolverFullBody solver) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < children.Length; i++) { solver.chain[children[i]].Stage1(solver); } if (children.Length == 0) { ForwardReach(nodes[nodes.Length - 1].solverPosition); return; } Vector3 val = nodes[nodes.Length - 1].solverPosition; SolveChildConstraints(solver); for (int j = 0; j < children.Length; j++) { Vector3 val2 = solver.chain[children[j]].nodes[0].solverPosition; if (solver.chain[children[j]].rootLength > 0f) { val2 = SolveFABRIKJoint(nodes[nodes.Length - 1].solverPosition, solver.chain[children[j]].nodes[0].solverPosition, solver.chain[children[j]].rootLength); } if (pullParentSum > 0f) { val += (val2 - nodes[nodes.Length - 1].solverPosition) * (solver.chain[children[j]].pull / pullParentSum); } } ForwardReach(Vector3.Lerp(val, nodes[nodes.Length - 1].solverPosition, pin)); } public void Stage2(IKSolverFullBody solver, Vector3 position) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) BackwardReach(position); int num = Mathf.Clamp(solver.iterations, 2, 4); if (childConstraints.Length > 0) { for (int i = 0; i < num; i++) { SolveConstraintSystems(solver); } } for (int j = 0; j < children.Length; j++) { solver.chain[children[j]].Stage2(solver, nodes[nodes.Length - 1].solverPosition); } } public void SolveConstraintSystems(IKSolverFullBody solver) { SolveChildConstraints(solver); for (int i = 0; i < children.Length; i++) { SolveLinearConstraint(nodes[nodes.Length - 1], solver.chain[children[i]].nodes[0], crossFades[i], solver.chain[children[i]].rootLength); } } private Vector3 SolveFABRIKJoint(Vector3 pos1, Vector3 pos2, float length) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos1 - pos2; return pos2 + ((Vector3)(ref val)).normalized * length; } protected Vector3 GetDirToBendPoint(Vector3 direction, Vector3 bendDirection, float directionMagnitude) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) float num = (directionMagnitude * directionMagnitude + sqrMagDif) / 2f / directionMagnitude; float num2 = (float)Math.Sqrt(Mathf.Clamp(sqrMag1 - num * num, 0f, float.PositiveInfinity)); if (direction == Vector3.zero) { return Vector3.zero; } return Quaternion.LookRotation(direction, bendDirection) * new Vector3(0f, num2, num); } private void SolveChildConstraints(IKSolverFullBody solver) { for (int i = 0; i < childConstraints.Length; i++) { childConstraints[i].Solve(solver); } } private void SolveLinearConstraint(IKSolver.Node node1, IKSolver.Node node2, float crossFade, float distance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = node2.solverPosition - node1.solverPosition; float magnitude = ((Vector3)(ref val)).magnitude; if (distance != magnitude && magnitude != 0f) { Vector3 val2 = val * (1f - distance / magnitude); node1.solverPosition += val2 * crossFade; node2.solverPosition -= val2 * (1f - crossFade); } } public void ForwardReach(Vector3 position) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) nodes[nodes.Length - 1].solverPosition = position; for (int num = nodes.Length - 2; num > -1; num--) { nodes[num].solverPosition = SolveFABRIKJoint(nodes[num].solverPosition, nodes[num + 1].solverPosition, nodes[num].length); } } private void BackwardReach(Vector3 position) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) if (rootLength > 0f) { position = SolveFABRIKJoint(nodes[0].solverPosition, position, rootLength); } nodes[0].solverPosition = position; for (int i = 1; i < nodes.Length; i++) { nodes[i].solverPosition = SolveFABRIKJoint(nodes[i].solverPosition, nodes[i - 1].solverPosition, nodes[i - 1].length); } } } [Serializable] public class IKConstraintBend { public Transform bone1; public Transform bone2; public Transform bone3; public Transform bendGoal; public Vector3 direction = Vector3.right; public Quaternion rotationOffset; [Range(0f, 1f)] public float weight = 0f; public Vector3 defaultLocalDirection; public Vector3 defaultChildDirection; [NonSerialized] public float clampF = 0.505f; private int chainIndex1; private int nodeIndex1; private int chainIndex2; private int nodeIndex2; private int chainIndex3; private int nodeIndex3; private bool limbOrientationsSet; public bool initiated { get; private set; } public IKConstraintBend() { }//IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) public IKConstraintBend(Transform bone1, Transform bone2, Transform bone3) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) SetBones(bone1, bone2, bone3); } public bool IsValid(IKSolverFullBody solver, Warning.Logger logger) { if ((Object)(object)bone1 == (Object)null || (Object)(object)bone2 == (Object)null || (Object)(object)bone3 == (Object)null) { logger?.Invoke("Bend Constraint contains a null reference."); return false; } if (solver.GetPoint(bone1) == null) { logger?.Invoke("Bend Constraint is referencing to a bone '" + ((Object)bone1).name + "' that does not excist in the Node Chain."); return false; } if (solver.GetPoint(bone2) == null) { logger?.Invoke("Bend Constraint is referencing to a bone '" + ((Object)bone2).name + "' that does not excist in the Node Chain."); return false; } if (solver.GetPoint(bone3) == null) { logger?.Invoke("Bend Constraint is referencing to a bone '" + ((Object)bone3).name + "' that does not excist in the Node Chain."); return false; } return true; } public void SetBones(Transform bone1, Transform bone2, Transform bone3) { this.bone1 = bone1; this.bone2 = bone2; this.bone3 = bone3; } public void Initiate(IKSolverFullBody solver) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) solver.GetChainAndNodeIndexes(bone1, out chainIndex1, out nodeIndex1); solver.GetChainAndNodeIndexes(bone2, out chainIndex2, out nodeIndex2); solver.GetChainAndNodeIndexes(bone3, out chainIndex3, out nodeIndex3); direction = OrthoToBone1(solver, OrthoToLimb(solver, bone2.position - bone1.position)); if (!limbOrientationsSet) { defaultLocalDirection = Quaternion.Inverse(bone1.rotation) * direction; Vector3 val = bone3.position - bone1.position; Vector3 val2 = Vector3.Cross(((Vector3)(ref val)).normalized, direction); defaultChildDirection = Quaternion.Inverse(bone3.rotation) * val2; } initiated = true; } public void SetLimbOrientation(Vector3 upper, Vector3 lower, Vector3 last) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (upper == Vector3.zero) { Debug.LogError((object)"Attempting to set limb orientation to Vector3.zero axis"); } if (lower == Vector3.zero) { Debug.LogError((object)"Attempting to set limb orientation to Vector3.zero axis"); } if (last == Vector3.zero) { Debug.LogError((object)"Attempting to set limb orientation to Vector3.zero axis"); } defaultLocalDirection = ((Vector3)(ref upper)).normalized; defaultChildDirection = ((Vector3)(ref last)).normalized; limbOrientationsSet = true; } public void LimitBend(float solverWeight, float positionWeight) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) if (initiated) { Vector3 val = bone1.rotation * -defaultLocalDirection; Vector3 val2 = bone3.position - bone2.position; bool changed = false; Vector3 val3 = V3Tools.ClampDirection(val2, val, clampF * solverWeight, 0, out changed); Quaternion rotation = bone3.rotation; if (changed) { Quaternion val4 = Quaternion.FromToRotation(val2, val3); bone2.rotation = val4 * bone2.rotation; } if (positionWeight > 0f) { Vector3 val5 = bone2.position - bone1.position; Vector3 val6 = bone3.position - bone2.position; Vector3.OrthoNormalize(ref val5, ref val6); Quaternion val7 = Quaternion.FromToRotation(val6, val); bone2.rotation = Quaternion.Lerp(bone2.rotation, val7 * bone2.rotation, positionWeight * solverWeight); } if (changed || positionWeight > 0f) { bone3.rotation = rotation; } } } public Vector3 GetDir(IKSolverFullBody solver) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return Vector3.zero; } float num = weight * solver.IKPositionWeight; if ((Object)(object)bendGoal != (Object)null) { Vector3 val = bendGoal.position - solver.GetNode(chainIndex1, nodeIndex1).solverPosition; if (val != Vector3.zero) { direction = val; } } if (num >= 1f) { return ((Vector3)(ref direction)).normalized; } Vector3 val2 = solver.GetNode(chainIndex3, nodeIndex3).solverPosition - solver.GetNode(chainIndex1, nodeIndex1).solverPosition; Quaternion val3 = Quaternion.FromToRotation(bone3.position - bone1.position, val2); Vector3 val4 = val3 * (bone2.position - bone1.position); if (solver.GetNode(chainIndex3, nodeIndex3).effectorRotationWeight > 0f) { Vector3 val5 = -Vector3.Cross(val2, solver.GetNode(chainIndex3, nodeIndex3).solverRotation * defaultChildDirection); val4 = Vector3.Lerp(val4, val5, solver.GetNode(chainIndex3, nodeIndex3).effectorRotationWeight); } if (rotationOffset != Quaternion.identity) { Quaternion val6 = Quaternion.FromToRotation(rotationOffset * val2, val2); val4 = val6 * rotationOffset * val4; } if (num <= 0f) { return val4; } return Vector3.Lerp(val4, ((Vector3)(ref direction)).normalized, num); } private Vector3 OrthoToLimb(IKSolverFullBody solver, Vector3 tangent) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Vector3 val = solver.GetNode(chainIndex3, nodeIndex3).solverPosition - solver.GetNode(chainIndex1, nodeIndex1).solverPosition; Vector3.OrthoNormalize(ref val, ref tangent); return tangent; } private Vector3 OrthoToBone1(IKSolverFullBody solver, Vector3 tangent) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Vector3 val = solver.GetNode(chainIndex2, nodeIndex2).solverPosition - solver.GetNode(chainIndex1, nodeIndex1).solverPosition; Vector3.OrthoNormalize(ref val, ref tangent); return tangent; } } [Serializable] public class IKEffector { public Transform bone; public Transform target; [Range(0f, 1f)] public float positionWeight; [Range(0f, 1f)] public float rotationWeight; public Vector3 position = Vector3.zero; public Quaternion rotation = Quaternion.identity; public Vector3 positionOffset; public bool effectChildNodes = true; [Range(0f, 1f)] public float maintainRelativePositionWeight; public Transform[] childBones = (Transform[])(object)new Transform[0]; public Transform planeBone1; public Transform planeBone2; public Transform planeBone3; public Quaternion planeRotationOffset = Quaternion.identity; private float posW; private float rotW; private Vector3[] localPositions = (Vector3[])(object)new Vector3[0]; private bool usePlaneNodes; private Quaternion animatedPlaneRotation = Quaternion.identity; private Vector3 animatedPosition; private bool firstUpdate; private int chainIndex = -1; private int nodeIndex = -1; private int plane1ChainIndex; private int plane1NodeIndex = -1; private int plane2ChainIndex = -1; private int plane2NodeIndex = -1; private int plane3ChainIndex = -1; private int plane3NodeIndex = -1; private int[] childChainIndexes = new int[0]; private int[] childNodeIndexes = new int[0]; public bool isEndEffector { get; private set; } public IKEffector() { }//IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) public IKEffector(Transform bone, Transform[] childBones) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) this.bone = bone; this.childBones = childBones; } public IKSolver.Node GetNode(IKSolverFullBody solver) { return solver.chain[chainIndex].nodes[nodeIndex]; } public void PinToBone(float positionWeight, float rotationWeight) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) position = bone.position; this.positionWeight = Mathf.Clamp(positionWeight, 0f, 1f); rotation = bone.rotation; this.rotationWeight = Mathf.Clamp(rotationWeight, 0f, 1f); } public bool IsValid(IKSolver solver, ref string message) { if ((Object)(object)bone == (Object)null) { message = "IK Effector bone is null."; return false; } if (solver.GetPoint(bone) == null) { message = "IK Effector is referencing to a bone '" + ((Object)bone).name + "' that does not excist in the Node Chain."; return false; } Transform[] array = childBones; foreach (Transform val in array) { if ((Object)(object)val == (Object)null) { message = "IK Effector contains a null reference."; return false; } } Transform[] array2 = childBones; foreach (Transform val2 in array2) { if (solver.GetPoint(val2) == null) { message = "IK Effector is referencing to a bone '" + ((Object)val2).name + "' that does not excist in the Node Chain."; return false; } } if ((Object)(object)planeBone1 != (Object)null && solver.GetPoint(planeBone1) == null) { message = "IK Effector is referencing to a bone '" + ((Object)planeBone1).name + "' that does not excist in the Node Chain."; return false; } if ((Object)(object)planeBone2 != (Object)null && solver.GetPoint(planeBone2) == null) { message = "IK Effector is referencing to a bone '" + ((Object)planeBone2).name + "' that does not excist in the Node Chain."; return false; } if ((Object)(object)planeBone3 != (Object)null && solver.GetPoint(planeBone3) == null) { message = "IK Effector is referencing to a bone '" + ((Object)planeBone3).name + "' that does not excist in the Node Chain."; return false; } return true; } public void Initiate(IKSolverFullBody solver) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) position = bone.position; rotation = bone.rotation; animatedPlaneRotation = Quaternion.identity; solver.GetChainAndNodeIndexes(bone, out chainIndex, out nodeIndex); childChainIndexes = new int[childBones.Length]; childNodeIndexes = new int[childBones.Length]; for (int i = 0; i < childBones.Length; i++) { solver.GetChainAndNodeIndexes(childBones[i], out childChainIndexes[i], out childNodeIndexes[i]); } localPositions = (Vector3[])(object)new Vector3[childBones.Length]; usePlaneNodes = false; if ((Object)(object)planeBone1 != (Object)null) { solver.GetChainAndNodeIndexes(planeBone1, out plane1ChainIndex, out plane1NodeIndex); if ((Object)(object)planeBone2 != (Object)null) { solver.GetChainAndNodeIndexes(planeBone2, out plane2ChainIndex, out plane2NodeIndex); if ((Object)(object)planeBone3 != (Object)null) { solver.GetChainAndNodeIndexes(planeBone3, out plane3ChainIndex, out plane3NodeIndex); usePlaneNodes = true; } } isEndEffector = true; } else { isEndEffector = false; } } public void ResetOffset(IKSolverFullBody solver) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) solver.GetNode(chainIndex, nodeIndex).offset = Vector3.zero; for (int i = 0; i < childChainIndexes.Length; i++) { solver.GetNode(childChainIndexes[i], childNodeIndexes[i]).offset = Vector3.zero; } } public void SetToTarget() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)target == (Object)null)) { position = target.position; rotation = target.rotation; } } public void OnPreSolve(IKSolverFullBody solver) { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) positionWeight = Mathf.Clamp(positionWeight, 0f, 1f); rotationWeight = Mathf.Clamp(rotationWeight, 0f, 1f); maintainRelativePositionWeight = Mathf.Clamp(maintainRelativePositionWeight, 0f, 1f); posW = positionWeight * solver.IKPositionWeight; rotW = rotationWeight * solver.IKPositionWeight; solver.GetNode(chainIndex, nodeIndex).effectorPositionWeight = posW; solver.GetNode(chainIndex, nodeIndex).effectorRotationWeight = rotW; solver.GetNode(chainIndex, nodeIndex).solverRotation = rotation; if (float.IsInfinity(positionOffset.x) || float.IsInfinity(positionOffset.y) || float.IsInfinity(positionOffset.z)) { Debug.LogError((object)"Invalid IKEffector.positionOffset (contains Infinity)! Please make sure not to set IKEffector.positionOffset to infinite values.", (Object)(object)bone); } if (float.IsNaN(positionOffset.x) || float.IsNaN(positionOffset.y) || float.IsNaN(positionOffset.z)) { Debug.LogError((object)"Invalid IKEffector.positionOffset (contains NaN)! Please make sure not to set IKEffector.positionOffset to NaN values.", (Object)(object)bone); } if (((Vector3)(ref positionOffset)).sqrMagnitude > 1E+10f) { Debug.LogError((object)"Additive effector positionOffset detected in Full Body IK (extremely large value). Make sure you are not circularily adding to effector positionOffset each frame.", (Object)(object)bone); } if (float.IsInfinity(position.x) || float.IsInfinity(position.y) || float.IsInfinity(position.z)) { Debug.LogError((object)"Invalid IKEffector.position (contains Infinity)!"); } IKSolver.Node node = solver.GetNode(chainIndex, nodeIndex); node.offset += positionOffset * solver.IKPositionWeight; if (effectChildNodes && solver.iterations > 0) { for (int i = 0; i < childBones.Length; i++) { ref Vector3 reference = ref localPositions[i]; reference = ((Component)childBones[i]).transform.position - ((Component)bone).transform.position; IKSolver.Node node2 = solver.GetNode(childChainIndexes[i], childNodeIndexes[i]); node2.offset += positionOffset * solver.IKPositionWeight; } } if (usePlaneNodes && maintainRelativePositionWeight > 0f) { animatedPlaneRotation = Quaternion.LookRotation(planeBone2.position - planeBone1.position, planeBone3.position - planeBone1.position); } firstUpdate = true; } public void OnPostWrite() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) positionOffset = Vector3.zero; } private Quaternion GetPlaneRotation(IKSolverFullBody solver) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) Vector3 solverPosition = solver.GetNode(plane1ChainIndex, plane1NodeIndex).solverPosition; Vector3 solverPosition2 = solver.GetNode(plane2ChainIndex, plane2NodeIndex).solverPosition; Vector3 solverPosition3 = solver.GetNode(plane3ChainIndex, plane3NodeIndex).solverPosition; Vector3 val = solverPosition2 - solverPosition; Vector3 val2 = solverPosition3 - solverPosition; if (val == Vector3.zero) { Warning.Log("Make sure you are not placing 2 or more FBBIK effectors of the same chain to exactly the same position.", bone); return Quaternion.identity; } return Quaternion.LookRotation(val, val2); } public void Update(IKSolverFullBody solver) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) if (firstUpdate) { animatedPosition = bone.position + solver.GetNode(chainIndex, nodeIndex).offset; firstUpdate = false; } solver.GetNode(chainIndex, nodeIndex).solverPosition = Vector3.Lerp(GetPosition(solver, out planeRotationOffset), position, posW); if (effectChildNodes) { for (int i = 0; i < childBones.Length; i++) { solver.GetNode(childChainIndexes[i], childNodeIndexes[i]).solverPosition = Vector3.Lerp(solver.GetNode(childChainIndexes[i], childNodeIndexes[i]).solverPosition, solver.GetNode(chainIndex, nodeIndex).solverPosition + localPositions[i], posW); } } } private Vector3 GetPosition(IKSolverFullBody solver, out Quaternion planeRotationOffset) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) planeRotationOffset = Quaternion.identity; if (!isEndEffector) { return solver.GetNode(chainIndex, nodeIndex).solverPosition; } if (maintainRelativePositionWeight <= 0f) { return animatedPosition; } Vector3 val = bone.position; Vector3 val2 = val - planeBone1.position; planeRotationOffset = GetPlaneRotation(solver) * Quaternion.Inverse(animatedPlaneRotation); val = solver.GetNode(plane1ChainIndex, plane1NodeIndex).solverPosition + planeRotationOffset * val2; planeRotationOffset = Quaternion.Lerp(Quaternion.identity, planeRotationOffset, maintainRelativePositionWeight); return Vector3.Lerp(animatedPosition, val + solver.GetNode(chainIndex, nodeIndex).offset, maintainRelativePositionWeight); } } [Serializable] public class IKMapping { [Serializable] public class BoneMap { public Transform transform; public int chainIndex = -1; public int nodeIndex = -1; public Vector3 defaultLocalPosition; public Quaternion defaultLocalRotation; public Vector3 localSwingAxis; public Vector3 localTwistAxis; public Vector3 planePosition; public Vector3 ikPosition; public Quaternion defaultLocalTargetRotation; private Quaternion maintainRotation; public float length; public Quaternion animatedRotation; private Transform planeBone1; private Transform planeBone2; private Transform planeBone3; private int plane1ChainIndex = -1; private int plane1NodeIndex = -1; private int plane2ChainIndex = -1; private int plane2NodeIndex = -1; private int plane3ChainIndex = -1; private int plane3NodeIndex = -1; public Vector3 swingDirection => transform.rotation * localSwingAxis; public bool isNodeBone => nodeIndex != -1; private Quaternion lastAnimatedTargetRotation { get { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (planeBone1.position == planeBone3.position) { return Quaternion.identity; } return Quaternion.LookRotation(planeBone2.position - planeBone1.position, planeBone3.position - planeBone1.position); } } public void Initiate(Transform transform, IKSolverFullBody solver) { this.transform = transform; solver.GetChainAndNodeIndexes(transform, out chainIndex, out nodeIndex); } public void StoreDefaultLocalState() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) defaultLocalPosition = transform.localPosition; defaultLocalRotation = transform.localRotation; } public void FixTransform(bool position) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (position) { transform.localPosition = defaultLocalPosition; } transform.localRotation = defaultLocalRotation; } public void SetLength(BoneMap nextBone) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) length = Vector3.Distance(transform.position, nextBone.transform.position); } public void SetLocalSwingAxis(BoneMap swingTarget) { SetLocalSwingAxis(swingTarget, this); } public void SetLocalSwingAxis(BoneMap bone1, BoneMap bone2) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) localSwingAxis = Quaternion.Inverse(transform.rotation) * (bone1.transform.position - bone2.transform.position); } public void SetLocalTwistAxis(Vector3 twistDirection, Vector3 normalDirection) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) Vector3.OrthoNormalize(ref normalDirection, ref twistDirection); localTwistAxis = Quaternion.Inverse(transform.rotation) * twistDirection; } public void SetPlane(IKSolverFullBody solver, Transform planeBone1, Transform planeBone2, Transform planeBone3) { this.planeBone1 = planeBone1; this.planeBone2 = planeBone2; this.planeBone3 = planeBone3; solver.GetChainAndNodeIndexes(planeBone1, out plane1ChainIndex, out plane1NodeIndex); solver.GetChainAndNodeIndexes(planeBone2, out plane2ChainIndex, out plane2NodeIndex); solver.GetChainAndNodeIndexes(planeBone3, out plane3ChainIndex, out plane3NodeIndex); UpdatePlane(rotation: true, position: true); } public void UpdatePlane(bool rotation, bool position) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Quaternion val = lastAnimatedTargetRotation; if (rotation) { defaultLocalTargetRotation = QuaTools.RotationToLocalSpace(transform.rotation, val); } if (position) { planePosition = Quaternion.Inverse(val) * (transform.position - planeBone1.position); } } public void SetIKPosition() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) ikPosition = transform.position; } public void MaintainRotation() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) maintainRotation = transform.rotation; } public void SetToIKPosition() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) transform.position = ikPosition; } public void FixToNode(IKSolverFullBody solver, float weight, IKSolver.Node fixNode = null) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (fixNode == null) { fixNode = solver.GetNode(chainIndex, nodeIndex); } if (weight >= 1f) { transform.position = fixNode.solverPosition; } else { transform.position = Vector3.Lerp(transform.position, fixNode.solverPosition, weight); } } public Vector3 GetPlanePosition(IKSolverFullBody solver) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) return solver.GetNode(plane1ChainIndex, plane1NodeIndex).solverPosition + GetTargetRotation(solver) * planePosition; } public void PositionToPlane(IKSolverFullBody solver) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) transform.position = GetPlanePosition(solver); } public void RotateToPlane(IKSolverFullBody solver, float weight) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Quaternion val = GetTargetRotation(solver) * defaultLocalTargetRotation; if (weight >= 1f) { transform.rotation = val; } else { transform.rotation = Quaternion.Lerp(transform.rotation, val, weight); } } public void Swing(Vector3 swingTarget, float weight) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Swing(swingTarget, transform.position, weight); } public void Swing(Vector3 pos1, Vector3 pos2, float weight) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(transform.rotation * localSwingAxis, pos1 - pos2) * transform.rotation; if (weight >= 1f) { transform.rotation = val; } else { transform.rotation = Quaternion.Lerp(transform.rotation, val, weight); } } public void Twist(Vector3 twistDirection, Vector3 normalDirection, float weight) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) Vector3.OrthoNormalize(ref normalDirection, ref twistDirection); Quaternion val = Quaternion.FromToRotation(transform.rotation * localTwistAxis, twistDirection) * transform.rotation; if (weight >= 1f) { transform.rotation = val; } else { transform.rotation = Quaternion.Lerp(transform.rotation, val, weight); } } public void RotateToMaintain(float weight) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { transform.rotation = Quaternion.Lerp(transform.rotation, maintainRotation, weight); } } public void RotateToEffector(IKSolverFullBody solver, float weight) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (!isNodeBone) { return; } float num = weight * solver.GetNode(chainIndex, nodeIndex).effectorRotationWeight; if (!(num <= 0f)) { if (num >= 1f) { transform.rotation = solver.GetNode(chainIndex, nodeIndex).solverRotation; } else { transform.rotation = Quaternion.Lerp(transform.rotation, solver.GetNode(chainIndex, nodeIndex).solverRotation, num); } } } private Quaternion GetTargetRotation(IKSolverFullBody solver) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) Vector3 solverPosition = solver.GetNode(plane1ChainIndex, plane1NodeIndex).solverPosition; Vector3 solverPosition2 = solver.GetNode(plane2ChainIndex, plane2NodeIndex).solverPosition; Vector3 solverPosition3 = solver.GetNode(plane3ChainIndex, plane3NodeIndex).solverPosition; if (solverPosition == solverPosition3) { return Quaternion.identity; } return Quaternion.LookRotation(solverPosition2 - solverPosition, solverPosition3 - solverPosition); } } public virtual bool IsValid(IKSolver solver, ref string message) { return true; } public virtual void Initiate(IKSolverFullBody solver) { } protected bool BoneIsValid(Transform bone, IKSolver solver, ref string message, Warning.Logger logger = null) { if ((Object)(object)bone == (Object)null) { message = "IKMappingLimb contains a null reference."; logger?.Invoke(message); return false; } if (solver.GetPoint(bone) == null) { message = "IKMappingLimb is referencing to a bone '" + ((Object)bone).name + "' that does not excist in the Node Chain."; logger?.Invoke(message); return false; } return true; } protected Vector3 SolveFABRIKJoint(Vector3 pos1, Vector3 pos2, float length) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos1 - pos2; return pos2 + ((Vector3)(ref val)).normalized * length; } } [Serializable] public class IKMappingBone : IKMapping { public Transform bone; [Range(0f, 1f)] public float maintainRotationWeight = 1f; private BoneMap boneMap = new BoneMap(); public IKMappingBone() { } public IKMappingBone(Transform bone) { this.bone = bone; } public override bool IsValid(IKSolver solver, ref string message) { if (!base.IsValid(solver, ref message)) { return false; } if ((Object)(object)bone == (Object)null) { message = "IKMappingBone's bone is null."; return false; } return true; } public void StoreDefaultLocalState() { boneMap.StoreDefaultLocalState(); } public void FixTransforms() { boneMap.FixTransform(position: false); } public override void Initiate(IKSolverFullBody solver) { if (boneMap == null) { boneMap = new BoneMap(); } boneMap.Initiate(bone, solver); } public void ReadPose() { boneMap.MaintainRotation(); } public void WritePose(float solverWeight) { boneMap.RotateToMaintain(solverWeight * maintainRotationWeight); } } [Serializable] public class IKMappingLimb : IKMapping { [Serializable] public enum BoneMapType { Parent, Bone1, Bone2, Bone3 } public Transform parentBone; public Transform bone1; public Transform bone2; public Transform bone3; [Range(0f, 1f)] public float maintainRotationWeight; [Range(0f, 1f)] public float weight = 1f; [NonSerialized] public bool updatePlaneRotations = true; private BoneMap boneMapParent = new BoneMap(); private BoneMap boneMap1 = new BoneMap(); private BoneMap boneMap2 = new BoneMap(); private BoneMap boneMap3 = new BoneMap(); public IKMappingLimb() { } public IKMappingLimb(Transform bone1, Transform bone2, Transform bone3, Transform parentBone = null) { SetBones(bone1, bone2, bone3, parentBone); } public override bool IsValid(IKSolver solver, ref string message) { if (!base.IsValid(solver, ref message)) { return false; } if (!BoneIsValid(bone1, solver, ref message)) { return false; } if (!BoneIsValid(bone2, solver, ref message)) { return false; } if (!BoneIsValid(bone3, solver, ref message)) { return false; } return true; } public BoneMap GetBoneMap(BoneMapType boneMap) { switch (boneMap) { case BoneMapType.Parent: if ((Object)(object)parentBone == (Object)null) { Warning.Log("This limb does not have a parent (shoulder) bone", bone1); } return boneMapParent; case BoneMapType.Bone1: return boneMap1; case BoneMapType.Bone2: return boneMap2; default: return boneMap3; } } public void SetLimbOrientation(Vector3 upper, Vector3 lower) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) boneMap1.defaultLocalTargetRotation = Quaternion.Inverse(Quaternion.Inverse(bone1.rotation) * Quaternion.LookRotation(bone2.position - bone1.position, bone1.rotation * -upper)); boneMap2.defaultLocalTargetRotation = Quaternion.Inverse(Quaternion.Inverse(bone2.rotation) * Quaternion.LookRotation(bone3.position - bone2.position, bone2.rotation * -lower)); } public void SetBones(Transform bone1, Transform bone2, Transform bone3, Transform parentBone = null) { this.bone1 = bone1; this.bone2 = bone2; this.bone3 = bone3; this.parentBone = parentBone; } public void StoreDefaultLocalState() { if ((Object)(object)parentBone != (Object)null) { boneMapParent.StoreDefaultLocalState(); } boneMap1.StoreDefaultLocalState(); boneMap2.StoreDefaultLocalState(); boneMap3.StoreDefaultLocalState(); } public void FixTransforms() { if ((Object)(object)parentBone != (Object)null) { boneMapParent.FixTransform(position: false); } boneMap1.FixTransform(position: true); boneMap2.FixTransform(position: false); boneMap3.FixTransform(position: false); } public override void Initiate(IKSolverFullBody solver) { if (boneMapParent == null) { boneMapParent = new BoneMap(); } if (boneMap1 == null) { boneMap1 = new BoneMap(); } if (boneMap2 == null) { boneMap2 = new BoneMap(); } if (boneMap3 == null) { boneMap3 = new BoneMap(); } if ((Object)(object)parentBone != (Object)null) { boneMapParent.Initiate(parentBone, solver); } boneMap1.Initiate(bone1, solver); boneMap2.Initiate(bone2, solver); boneMap3.Initiate(bone3, solver); boneMap1.SetPlane(solver, boneMap1.transform, boneMap2.transform, boneMap3.transform); boneMap2.SetPlane(solver, boneMap2.transform, boneMap3.transform, boneMap1.transform); if ((Object)(object)parentBone != (Object)null) { boneMapParent.SetLocalSwingAxis(boneMap1); } } public void ReadPose() { boneMap1.UpdatePlane(updatePlaneRotations, position: true); boneMap2.UpdatePlane(updatePlaneRotations, position: false); weight = Mathf.Clamp(weight, 0f, 1f); boneMap3.MaintainRotation(); } public void WritePose(IKSolverFullBody solver, bool fullBody) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } if (fullBody) { if ((Object)(object)parentBone != (Object)null) { boneMapParent.Swing(solver.GetNode(boneMap1.chainIndex, boneMap1.nodeIndex).solverPosition, weight); } boneMap1.FixToNode(solver, weight); } boneMap1.RotateToPlane(solver, weight); boneMap2.RotateToPlane(solver, weight); boneMap3.RotateToMaintain(maintainRotationWeight * weight * solver.IKPositionWeight); boneMap3.RotateToEffector(solver, weight); } } [Serializable] public class IKMappingSpine : IKMapping { public Transform[] spineBones; public Transform leftUpperArmBone; public Transform rightUpperArmBone; public Transform leftThighBone; public Transform rightThighBone; [Range(1f, 3f)] public int iterations = 3; [Range(0f, 1f)] public float twistWeight = 1f; private int rootNodeIndex; private BoneMap[] spine = new BoneMap[0]; private BoneMap leftUpperArm = new BoneMap(); private BoneMap rightUpperArm = new BoneMap(); private BoneMap leftThigh = new BoneMap(); private BoneMap rightThigh = new BoneMap(); private bool useFABRIK; public IKMappingSpine() { } public IKMappingSpine(Transform[] spineBones, Transform leftUpperArmBone, Transform rightUpperArmBone, Transform leftThighBone, Transform rightThighBone) { SetBones(spineBones, leftUpperArmBone, rightUpperArmBone, leftThighBone, rightThighBone); } public override bool IsValid(IKSolver solver, ref string message) { if (!base.IsValid(solver, ref message)) { return false; } Transform[] array = spineBones; foreach (Transform val in array) { if ((Object)(object)val == (Object)null) { message = "Spine bones contains a null reference."; return false; } } int num = 0; for (int j = 0; j < spineBones.Length; j++) { if (solver.GetPoint(spineBones[j]) != null) { num++; } } if (num == 0) { message = "IKMappingSpine does not contain any nodes."; return false; } if ((Object)(object)leftUpperArmBone == (Object)null) { message = "IKMappingSpine is missing the left upper arm bone."; return false; } if ((Object)(object)rightUpperArmBone == (Object)null) { message = "IKMappingSpine is missing the right upper arm bone."; return false; } if ((Object)(object)leftThighBone == (Object)null) { message = "IKMappingSpine is missing the left thigh bone."; return false; } if ((Object)(object)rightThighBone == (Object)null) { message = "IKMappingSpine is missing the right thigh bone."; return false; } if (solver.GetPoint(leftUpperArmBone) == null) { message = "Full Body IK is missing the left upper arm node."; return false; } if (solver.GetPoint(rightUpperArmBone) == null) { message = "Full Body IK is missing the right upper arm node."; return false; } if (solver.GetPoint(leftThighBone) == null) { message = "Full Body IK is missing the left thigh node."; return false; } if (solver.GetPoint(rightThighBone) == null) { message = "Full Body IK is missing the right thigh node."; return false; } return true; } public void SetBones(Transform[] spineBones, Transform leftUpperArmBone, Transform rightUpperArmBone, Transform leftThighBone, Transform rightThighBone) { this.spineBones = spineBones; this.leftUpperArmBone = leftUpperArmBone; this.rightUpperArmBone = rightUpperArmBone; this.leftThighBone = leftThighBone; this.rightThighBone = rightThighBone; } public void StoreDefaultLocalState() { for (int i = 0; i < spine.Length; i++) { spine[i].StoreDefaultLocalState(); } } public void FixTransforms() { for (int i = 0; i < spine.Length; i++) { spine[i].FixTransform(i == 0 || i == spine.Length - 1); } } public override void Initiate(IKSolverFullBody solver) { //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) if (iterations <= 0) { iterations = 3; } if (spine == null || spine.Length != spineBones.Length) { spine = new BoneMap[spineBones.Length]; } rootNodeIndex = -1; for (int i = 0; i < spineBones.Length; i++) { if (spine[i] == null) { spine[i] = new BoneMap(); } spine[i].Initiate(spineBones[i], solver); if (spine[i].isNodeBone) { rootNodeIndex = i; } } if (leftUpperArm == null) { leftUpperArm = new BoneMap(); } if (rightUpperArm == null) { rightUpperArm = new BoneMap(); } if (leftThigh == null) { leftThigh = new BoneMap(); } if (rightThigh == null) { rightThigh = new BoneMap(); } leftUpperArm.Initiate(leftUpperArmBone, solver); rightUpperArm.Initiate(rightUpperArmBone, solver); leftThigh.Initiate(leftThighBone, solver); rightThigh.Initiate(rightThighBone, solver); for (int j = 0; j < spine.Length; j++) { spine[j].SetIKPosition(); } spine[0].SetPlane(solver, spine[rootNodeIndex].transform, leftThigh.transform, rightThigh.transform); for (int k = 0; k < spine.Length - 1; k++) { spine[k].SetLength(spine[k + 1]); spine[k].SetLocalSwingAxis(spine[k + 1]); spine[k].SetLocalTwistAxis(leftUpperArm.transform.position - rightUpperArm.transform.position, spine[k + 1].transform.position - spine[k].transform.position); } spine[spine.Length - 1].SetPlane(solver, spine[rootNodeIndex].transform, leftUpperArm.transform, rightUpperArm.transform); spine[spine.Length - 1].SetLocalSwingAxis(leftUpperArm, rightUpperArm); useFABRIK = UseFABRIK(); } private bool UseFABRIK() { if (spine.Length > 3) { return true; } if (rootNodeIndex != 1) { return true; } return false; } public void ReadPose() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) spine[0].UpdatePlane(rotation: true, position: true); for (int i = 0; i < spine.Length - 1; i++) { spine[i].SetLength(spine[i + 1]); spine[i].SetLocalSwingAxis(spine[i + 1]); spine[i].SetLocalTwistAxis(leftUpperArm.transform.position - rightUpperArm.transform.position, spine[i + 1].transform.position - spine[i].transform.position); } spine[spine.Length - 1].UpdatePlane(rotation: true, position: true); spine[spine.Length - 1].SetLocalSwingAxis(leftUpperArm, rightUpperArm); } public void WritePose(IKSolverFullBody solver) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) Vector3 planePosition = spine[0].GetPlanePosition(solver); Vector3 solverPosition = solver.GetNode(spine[rootNodeIndex].chainIndex, spine[rootNodeIndex].nodeIndex).solverPosition; Vector3 planePosition2 = spine[spine.Length - 1].GetPlanePosition(solver); if (useFABRIK) { Vector3 val = solver.GetNode(spine[rootNodeIndex].chainIndex, spine[rootNodeIndex].nodeIndex).solverPosition - spine[rootNodeIndex].transform.position; for (int i = 0; i < spine.Length; i++) { spine[i].ikPosition = spine[i].transform.position + val; } for (int j = 0; j < iterations; j++) { ForwardReach(planePosition2); BackwardReach(planePosition); spine[rootNodeIndex].ikPosition = solverPosition; } } else { spine[0].ikPosition = planePosition; spine[rootNodeIndex].ikPosition = solverPosition; } spine[spine.Length - 1].ikPosition = planePosition2; MapToSolverPositions(solver); } public void ForwardReach(Vector3 position) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) spine[spineBones.Length - 1].ikPosition = position; for (int num = spine.Length - 2; num > -1; num--) { spine[num].ikPosition = SolveFABRIKJoint(spine[num].ikPosition, spine[num + 1].ikPosition, spine[num].length); } } private void BackwardReach(Vector3 position) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) spine[0].ikPosition = position; for (int i = 1; i < spine.Length; i++) { spine[i].ikPosition = SolveFABRIKJoint(spine[i].ikPosition, spine[i - 1].ikPosition, spine[i - 1].length); } } private void MapToSolverPositions(IKSolverFullBody solver) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) spine[0].SetToIKPosition(); spine[0].RotateToPlane(solver, 1f); for (int i = 1; i < spine.Length - 1; i++) { spine[i].Swing(spine[i + 1].ikPosition, 1f); if (twistWeight > 0f) { float num = (float)i / ((float)spine.Length - 2f); Vector3 solverPosition = solver.GetNode(leftUpperArm.chainIndex, leftUpperArm.nodeIndex).solverPosition; Vector3 solverPosition2 = solver.GetNode(rightUpperArm.chainIndex, rightUpperArm.nodeIndex).solverPosition; spine[i].Twist(solverPosition - solverPosition2, spine[i + 1].ikPosition - spine[i].transform.position, num * twistWeight); } } spine[spine.Length - 1].SetToIKPosition(); spine[spine.Length - 1].RotateToPlane(solver, 1f); } } [Serializable] public abstract class IKSolver { [Serializable] public class Point { public Transform transform; [Range(0f, 1f)] public float weight = 1f; public Vector3 solverPosition; public Quaternion solverRotation = Quaternion.identity; public Vector3 defaultLocalPosition; public Quaternion defaultLocalRotation; public void StoreDefaultLocalState() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) defaultLocalPosition = transform.localPosition; defaultLocalRotation = transform.localRotation; } public void FixTransform() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (transform.localPosition != defaultLocalPosition) { transform.localPosition = defaultLocalPosition; } if (transform.localRotation != defaultLocalRotation) { transform.localRotation = defaultLocalRotation; } } public void UpdateSolverPosition() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) solverPosition = transform.position; } public void UpdateSolverLocalPosition() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) solverPosition = transform.localPosition; } public void UpdateSolverState() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) solverPosition = transform.position; solverRotation = transform.rotation; } public void UpdateSolverLocalState() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) solverPosition = transform.localPosition; solverRotation = transform.localRotation; } } [Serializable] public class Bone : Point { public float length; public float sqrMag; public Vector3 axis = -Vector3.right; private RotationLimit _rotationLimit; private bool isLimited = true; public RotationLimit rotationLimit { get { if (!isLimited) { return null; } if ((Object)(object)_rotationLimit == (Object)null) { _rotationLimit = ((Component)transform).GetComponent(); } isLimited = (Object)(object)_rotationLimit != (Object)null; return _rotationLimit; } set { _rotationLimit = value; isLimited = (Object)(object)value != (Object)null; } } public Bone() { }//IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) public Bone(Transform transform) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) base.transform = transform; } public Bone(Transform transform, float weight) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) base.transform = transform; base.weight = weight; } public void Swing(Vector3 swingTarget, float weight = 1f) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { Quaternion val = Quaternion.FromToRotation(transform.rotation * axis, swingTarget - transform.position); if (weight >= 1f) { transform.rotation = val * transform.rotation; } else { transform.rotation = Quaternion.Lerp(Quaternion.identity, val, weight) * transform.rotation; } } } public static void SolverSwing(Bone[] bones, int index, Vector3 swingTarget, float weight = 1f) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } Quaternion val = Quaternion.FromToRotation(bones[index].solverRotation * bones[index].axis, swingTarget - bones[index].solverPosition); if (weight >= 1f) { for (int i = index; i < bones.Length; i++) { bones[i].solverRotation = val * bones[i].solverRotation; } } else { for (int j = index; j < bones.Length; j++) { bones[j].solverRotation = Quaternion.Lerp(Quaternion.identity, val, weight) * bones[j].solverRotation; } } } public void Swing2D(Vector3 swingTarget, float weight = 1f) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { Vector3 val = transform.rotation * axis; Vector3 val2 = swingTarget - transform.position; float num = Mathf.Atan2(val.x, val.y) * 57.29578f; float num2 = Mathf.Atan2(val2.x, val2.y) * 57.29578f; transform.rotation = Quaternion.AngleAxis(Mathf.DeltaAngle(num, num2) * weight, Vector3.back) * transform.rotation; } } public void SetToSolverPosition() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) transform.position = solverPosition; } } [Serializable] public class Node : Point { public float length; public float effectorPositionWeight; public float effectorRotationWeight; public Vector3 offset; public Node() { } public Node(Transform transform) { base.transform = transform; } public Node(Transform transform, float weight) { base.transform = transform; base.weight = weight; } } public delegate void UpdateDelegate(); public delegate void IterationDelegate(int i); [HideInInspector] public bool executedInEditor; [HideInInspector] public Vector3 IKPosition; [Tooltip("The positional or the master weight of the solver.")] [Range(0f, 1f)] public float IKPositionWeight = 1f; public UpdateDelegate OnPreInitiate; public UpdateDelegate OnPostInitiate; public UpdateDelegate OnPreUpdate; public UpdateDelegate OnPostUpdate; protected bool firstInitiation = true; [SerializeField] [HideInInspector] protected Transform root; public bool initiated { get; private set; } public bool IsValid() { string message = string.Empty; return IsValid(ref message); } public abstract bool IsValid(ref string message); public void Initiate(Transform root) { if (executedInEditor) { return; } if (OnPreInitiate != null) { OnPreInitiate(); } if ((Object)(object)root == (Object)null) { Debug.LogError((object)"Initiating IKSolver with null root Transform."); } this.root = root; initiated = false; string message = string.Empty; if (!IsValid(ref message)) { Warning.Log(message, root); return; } OnInitiate(); StoreDefaultLocalState(); initiated = true; firstInitiation = false; if (OnPostInitiate != null) { OnPostInitiate(); } } public void Update() { if (OnPreUpdate != null) { OnPreUpdate(); } if (firstInitiation) { Initiate(root); } if (initiated) { OnUpdate(); if (OnPostUpdate != null) { OnPostUpdate(); } } } public virtual Vector3 GetIKPosition() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return IKPosition; } public void SetIKPosition(Vector3 position) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) IKPosition = position; } public float GetIKPositionWeight() { return IKPositionWeight; } public void SetIKPositionWeight(float weight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); } public Transform GetRoot() { return root; } public abstract Point[] GetPoints(); public abstract Point GetPoint(Transform transform); public abstract void FixTransforms(); public abstract void StoreDefaultLocalState(); protected abstract void OnInitiate(); protected abstract void OnUpdate(); protected void LogWarning(string message) { Warning.Log(message, root, logInEditMode: true); } public static Transform ContainsDuplicateBone(Bone[] bones) { for (int i = 0; i < bones.Length; i++) { for (int j = 0; j < bones.Length; j++) { if (i != j && (Object)(object)bones[i].transform == (Object)(object)bones[j].transform) { return bones[i].transform; } } } return null; } public static bool HierarchyIsValid(Bone[] bones) { for (int i = 1; i < bones.Length; i++) { if (!Hierarchy.IsAncestor(bones[i].transform, bones[i - 1].transform)) { return false; } } return true; } protected static float PreSolveBones(ref Bone[] bones) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) float num = 0f; for (int i = 0; i < bones.Length; i++) { bones[i].solverPosition = bones[i].transform.position; bones[i].solverRotation = bones[i].transform.rotation; } for (int j = 0; j < bones.Length; j++) { if (j < bones.Length - 1) { Bone obj = bones[j]; Vector3 val = bones[j + 1].solverPosition - bones[j].solverPosition; obj.sqrMag = ((Vector3)(ref val)).sqrMagnitude; bones[j].length = Mathf.Sqrt(bones[j].sqrMag); num += bones[j].length; bones[j].axis = Quaternion.Inverse(bones[j].solverRotation) * (bones[j + 1].solverPosition - bones[j].solverPosition); } else { bones[j].sqrMag = 0f; bones[j].length = 0f; } } return num; } } [Serializable] public class IKSolverAim : IKSolverHeuristic { public Transform transform; public Vector3 axis = Vector3.forward; public Vector3 poleAxis = Vector3.up; public Vector3 polePosition; [Range(0f, 1f)] public float poleWeight; public Transform poleTarget; [Range(0f, 1f)] public float clampWeight = 0.1f; [Range(0f, 2f)] public int clampSmoothing = 2; public IterationDelegate OnPreIteration; private float step; private Vector3 clampedIKPosition; private RotationLimit transformLimit; private Transform lastTransform; public Vector3 transformAxis => transform.rotation * axis; public Vector3 transformPoleAxis => transform.rotation * poleAxis; protected override int minBones => 1; protected override Vector3 localDirection => bones[0].transform.InverseTransformDirection(bones[bones.Length - 1].transform.forward); public float GetAngle() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) return Vector3.Angle(transformAxis, IKPosition - transform.position); } protected override void OnInitiate() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) if ((firstInitiation || !Application.isPlaying) && (Object)(object)transform != (Object)null) { IKPosition = transform.position + transformAxis * 3f; polePosition = transform.position + transformPoleAxis * 3f; } for (int i = 0; i < bones.Length; i++) { if ((Object)(object)bones[i].rotationLimit != (Object)null) { bones[i].rotationLimit.Disable(); } } step = 1f / (float)bones.Length; if (Application.isPlaying) { axis = ((Vector3)(ref axis)).normalized; } } protected override void OnUpdate() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) if (axis == Vector3.zero) { if (!Warning.logged) { LogWarning("IKSolverAim axis is Vector3.zero."); } return; } if (poleAxis == Vector3.zero && poleWeight > 0f) { if (!Warning.logged) { LogWarning("IKSolverAim poleAxis is Vector3.zero."); } return; } if ((Object)(object)target != (Object)null) { IKPosition = target.position; } if ((Object)(object)poleTarget != (Object)null) { polePosition = poleTarget.position; } if (XY) { IKPosition.z = bones[0].transform.position.z; } if (IKPositionWeight <= 0f) { return; } IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); if ((Object)(object)transform != (Object)(object)lastTransform) { transformLimit = ((Component)transform).GetComponent(); if ((Object)(object)transformLimit != (Object)null) { ((Behaviour)transformLimit).enabled = false; } lastTransform = transform; } if ((Object)(object)transformLimit != (Object)null) { transformLimit.Apply(); } if ((Object)(object)transform == (Object)null) { if (!Warning.logged) { LogWarning("Aim Transform unassigned in Aim IK solver. Please Assign a Transform (lineal descendant to the last bone in the spine) that you want to be aimed at IKPosition"); } return; } clampWeight = Mathf.Clamp(clampWeight, 0f, 1f); clampedIKPosition = GetClampedIKPosition(); Vector3 val = clampedIKPosition - transform.position; val = Vector3.Slerp(transformAxis * ((Vector3)(ref val)).magnitude, val, IKPositionWeight); clampedIKPosition = transform.position + val; for (int i = 0; i < maxIterations && (i < 1 || !(tolerance > 0f) || !(GetAngle() < tolerance)); i++) { lastLocalDirection = localDirection; if (OnPreIteration != null) { OnPreIteration(i); } Solve(); } lastLocalDirection = localDirection; } private void Solve() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < bones.Length - 1; i++) { RotateToTarget(clampedIKPosition, bones[i], step * (float)(i + 1) * IKPositionWeight * bones[i].weight); } RotateToTarget(clampedIKPosition, bones[bones.Length - 1], IKPositionWeight * bones[bones.Length - 1].weight); } private Vector3 GetClampedIKPosition() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) if (clampWeight <= 0f) { return IKPosition; } if (clampWeight >= 1f) { Vector3 position = transform.position; Vector3 val = transformAxis; Vector3 val2 = IKPosition - transform.position; return position + val * ((Vector3)(ref val2)).magnitude; } float num = Vector3.Angle(transformAxis, IKPosition - transform.position); float num2 = 1f - num / 180f; float num3 = ((!(clampWeight > 0f)) ? 1f : Mathf.Clamp(1f - (clampWeight - num2) / (1f - num2), 0f, 1f)); float num4 = ((!(clampWeight > 0f)) ? 1f : Mathf.Clamp(num2 / clampWeight, 0f, 1f)); for (int i = 0; i < clampSmoothing; i++) { float num5 = num4 * (float)Math.PI * 0.5f; num4 = Mathf.Sin(num5); } return transform.position + Vector3.Slerp(transformAxis * 10f, IKPosition - transform.position, num4 * num3); } private void RotateToTarget(Vector3 targetPosition, Bone bone, float weight) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) if (XY) { if (weight >= 0f) { Vector3 val = transformAxis; Vector3 val2 = targetPosition - transform.position; float num = Mathf.Atan2(val.x, val.y) * 57.29578f; float num2 = Mathf.Atan2(val2.x, val2.y) * 57.29578f; bone.transform.rotation = Quaternion.AngleAxis(Mathf.DeltaAngle(num, num2), Vector3.back) * bone.transform.rotation; } } else { if (weight >= 0f) { Quaternion val3 = Quaternion.FromToRotation(transformAxis, targetPosition - transform.position); if (weight >= 1f) { bone.transform.rotation = val3 * bone.transform.rotation; } else { bone.transform.rotation = Quaternion.Lerp(Quaternion.identity, val3, weight) * bone.transform.rotation; } } if (poleWeight > 0f) { Vector3 val4 = polePosition - transform.position; Vector3 val5 = val4; Vector3 val6 = transformAxis; Vector3.OrthoNormalize(ref val6, ref val5); Quaternion val7 = Quaternion.FromToRotation(transformPoleAxis, val5); bone.transform.rotation = Quaternion.Lerp(Quaternion.identity, val7, weight * poleWeight) * bone.transform.rotation; } } if (useRotationLimits && (Object)(object)bone.rotationLimit != (Object)null) { bone.rotationLimit.Apply(); } } } [Serializable] public class IKSolverArm : IKSolver { [Range(0f, 1f)] public float IKRotationWeight = 1f; public Quaternion IKRotation = Quaternion.identity; public Point chest = new Point(); public Point shoulder = new Point(); public Point upperArm = new Point(); public Point forearm = new Point(); public Point hand = new Point(); public bool isLeft; public IKSolverVR.Arm arm = new IKSolverVR.Arm(); private Vector3[] positions = (Vector3[])(object)new Vector3[6]; private Quaternion[] rotations = (Quaternion[])(object)new Quaternion[6]; public override bool IsValid(ref string message) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown if ((Object)(object)chest.transform == (Object)null || (Object)(object)shoulder.transform == (Object)null || (Object)(object)upperArm.transform == (Object)null || (Object)(object)forearm.transform == (Object)null || (Object)(object)hand.transform == (Object)null) { message = "Please assign all bone slots of the Arm IK solver."; return false; } Transform val = (Transform)Hierarchy.ContainsDuplicate((Object[])(object)new Transform[5] { chest.transform, shoulder.transform, upperArm.transform, forearm.transform, hand.transform }); if ((Object)(object)val != (Object)null) { message = ((Object)val).name + " is represented multiple times in the ArmIK."; return false; } return true; } public bool SetChain(Transform chest, Transform shoulder, Transform upperArm, Transform forearm, Transform hand, Transform root) { this.chest.transform = chest; this.shoulder.transform = shoulder; this.upperArm.transform = upperArm; this.forearm.transform = forearm; this.hand.transform = hand; Initiate(root); return base.initiated; } public override Point[] GetPoints() { return new Point[5] { chest, shoulder, upperArm, forearm, hand }; } public override Point GetPoint(Transform transform) { if ((Object)(object)chest.transform == (Object)(object)transform) { return chest; } if ((Object)(object)shoulder.transform == (Object)(object)transform) { return shoulder; } if ((Object)(object)upperArm.transform == (Object)(object)transform) { return upperArm; } if ((Object)(object)forearm.transform == (Object)(object)transform) { return forearm; } if ((Object)(object)hand.transform == (Object)(object)transform) { return hand; } return null; } public override void StoreDefaultLocalState() { shoulder.StoreDefaultLocalState(); upperArm.StoreDefaultLocalState(); forearm.StoreDefaultLocalState(); hand.StoreDefaultLocalState(); } public override void FixTransforms() { if (base.initiated) { shoulder.FixTransform(); upperArm.FixTransform(); forearm.FixTransform(); hand.FixTransform(); } } protected override void OnInitiate() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) IKPosition = hand.transform.position; IKRotation = hand.transform.rotation; Read(); } protected override void OnUpdate() { Read(); Solve(); Write(); } private void Solve() { arm.PreSolve(); arm.ApplyOffsets(1f); arm.Solve(isLeft); arm.ResetOffsets(); } private void Read() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) arm.IKPosition = IKPosition; arm.positionWeight = IKPositionWeight; arm.IKRotation = IKRotation; arm.rotationWeight = IKRotationWeight; ref Vector3 reference = ref positions[0]; reference = root.position; ref Vector3 reference2 = ref positions[1]; reference2 = chest.transform.position; ref Vector3 reference3 = ref positions[2]; reference3 = shoulder.transform.position; ref Vector3 reference4 = ref positions[3]; reference4 = upperArm.transform.position; ref Vector3 reference5 = ref positions[4]; reference5 = forearm.transform.position; ref Vector3 reference6 = ref positions[5]; reference6 = hand.transform.position; ref Quaternion reference7 = ref rotations[0]; reference7 = root.rotation; ref Quaternion reference8 = ref rotations[1]; reference8 = chest.transform.rotation; ref Quaternion reference9 = ref rotations[2]; reference9 = shoulder.transform.rotation; ref Quaternion reference10 = ref rotations[3]; reference10 = upperArm.transform.rotation; ref Quaternion reference11 = ref rotations[4]; reference11 = forearm.transform.rotation; ref Quaternion reference12 = ref rotations[5]; reference12 = hand.transform.rotation; arm.Read(positions, rotations, hasChest: false, hasNeck: false, hasShoulders: true, hasToes: false, hasLegs: false, 1, 2); } private void Write() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) arm.Write(ref positions, ref rotations); shoulder.transform.rotation = rotations[2]; upperArm.transform.rotation = rotations[3]; forearm.transform.rotation = rotations[4]; hand.transform.rotation = rotations[5]; forearm.transform.position = positions[4]; hand.transform.position = positions[5]; } } [Serializable] public class IKSolverCCD : IKSolverHeuristic { public IterationDelegate OnPreIteration; public void FadeOutBoneWeights() { if (bones.Length >= 2) { bones[0].weight = 1f; float num = 1f / (float)(bones.Length - 1); for (int i = 1; i < bones.Length; i++) { bones[i].weight = num * (float)(bones.Length - 1 - i); } } } protected override void OnInitiate() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (firstInitiation || !Application.isPlaying) { IKPosition = bones[bones.Length - 1].transform.position; } InitiateBones(); } protected override void OnUpdate() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight <= 0f) { return; } IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); if ((Object)(object)target != (Object)null) { IKPosition = target.position; } if (XY) { IKPosition.z = bones[0].transform.position.z; } Vector3 val = ((maxIterations <= 1) ? Vector3.zero : GetSingularityOffset()); for (int i = 0; i < maxIterations && (!(val == Vector3.zero) || i < 1 || !(tolerance > 0f) || !(base.positionOffset < tolerance * tolerance)); i++) { lastLocalDirection = localDirection; if (OnPreIteration != null) { OnPreIteration(i); } Solve(IKPosition + ((i != 0) ? Vector3.zero : val)); } lastLocalDirection = localDirection; } protected void Solve(Vector3 targetPosition) { //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) if (XY) { for (int num = bones.Length - 2; num > -1; num--) { float num2 = bones[num].weight * IKPositionWeight; if (num2 > 0f) { Vector3 val = bones[bones.Length - 1].transform.position - bones[num].transform.position; Vector3 val2 = targetPosition - bones[num].transform.position; float num3 = Mathf.Atan2(val.x, val.y) * 57.29578f; float num4 = Mathf.Atan2(val2.x, val2.y) * 57.29578f; bones[num].transform.rotation = Quaternion.AngleAxis(Mathf.DeltaAngle(num3, num4) * num2, Vector3.back) * bones[num].transform.rotation; } if (useRotationLimits && (Object)(object)bones[num].rotationLimit != (Object)null) { bones[num].rotationLimit.Apply(); } } return; } for (int num5 = bones.Length - 2; num5 > -1; num5--) { float num6 = bones[num5].weight * IKPositionWeight; if (num6 > 0f) { Vector3 val3 = bones[bones.Length - 1].transform.position - bones[num5].transform.position; Vector3 val4 = targetPosition - bones[num5].transform.position; Quaternion val5 = Quaternion.FromToRotation(val3, val4) * bones[num5].transform.rotation; if (num6 >= 1f) { bones[num5].transform.rotation = val5; } else { bones[num5].transform.rotation = Quaternion.Lerp(bones[num5].transform.rotation, val5, num6); } } if (useRotationLimits && (Object)(object)bones[num5].rotationLimit != (Object)null) { bones[num5].rotationLimit.Apply(); } } } } [Serializable] public class IKSolverFABRIK : IKSolverHeuristic { public IterationDelegate OnPreIteration; private bool[] limitedBones = new bool[0]; private Vector3[] solverLocalPositions = (Vector3[])(object)new Vector3[0]; protected override bool boneLengthCanBeZero => false; public void SolveForward(Vector3 position) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (!base.initiated) { if (!Warning.logged) { LogWarning("Trying to solve uninitiated FABRIK chain."); } } else { OnPreSolve(); ForwardReach(position); } } public void SolveBackward(Vector3 position) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (!base.initiated) { if (!Warning.logged) { LogWarning("Trying to solve uninitiated FABRIK chain."); } } else { BackwardReach(position); OnPostSolve(); } } public override Vector3 GetIKPosition() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)null) { return target.position; } return IKPosition; } protected override void OnInitiate() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if (firstInitiation || !Application.isPlaying) { IKPosition = bones[bones.Length - 1].transform.position; } for (int i = 0; i < bones.Length; i++) { bones[i].solverPosition = bones[i].transform.position; bones[i].solverRotation = bones[i].transform.rotation; } limitedBones = new bool[bones.Length]; solverLocalPositions = (Vector3[])(object)new Vector3[bones.Length]; InitiateBones(); for (int j = 0; j < bones.Length; j++) { ref Vector3 reference = ref solverLocalPositions[j]; reference = Quaternion.Inverse(GetParentSolverRotation(j)) * (bones[j].transform.position - GetParentSolverPosition(j)); } } protected override void OnUpdate() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight <= 0f) { return; } IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); OnPreSolve(); if ((Object)(object)target != (Object)null) { IKPosition = target.position; } if (XY) { IKPosition.z = bones[0].transform.position.z; } Vector3 val = ((maxIterations <= 1) ? Vector3.zero : GetSingularityOffset()); for (int i = 0; i < maxIterations && (!(val == Vector3.zero) || i < 1 || !(tolerance > 0f) || !(base.positionOffset < tolerance * tolerance)); i++) { lastLocalDirection = localDirection; if (OnPreIteration != null) { OnPreIteration(i); } Solve(IKPosition + ((i != 0) ? Vector3.zero : val)); } OnPostSolve(); } private Vector3 SolveJoint(Vector3 pos1, Vector3 pos2, float length) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (XY) { pos1.z = pos2.z; } Vector3 val = pos2; Vector3 val2 = pos1 - pos2; return val + ((Vector3)(ref val2)).normalized * length; } private void OnPreSolve() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) chainLength = 0f; for (int i = 0; i < bones.Length; i++) { bones[i].solverPosition = bones[i].transform.position; bones[i].solverRotation = bones[i].transform.rotation; if (i < bones.Length - 1) { Bone obj = bones[i]; Vector3 val = bones[i].transform.position - bones[i + 1].transform.position; obj.length = ((Vector3)(ref val)).magnitude; bones[i].axis = Quaternion.Inverse(bones[i].transform.rotation) * (bones[i + 1].transform.position - bones[i].transform.position); chainLength += bones[i].length; } if (useRotationLimits) { ref Vector3 reference = ref solverLocalPositions[i]; reference = Quaternion.Inverse(GetParentSolverRotation(i)) * (bones[i].transform.position - GetParentSolverPosition(i)); } } } private void OnPostSolve() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!useRotationLimits) { MapToSolverPositions(); } else { MapToSolverPositionsLimited(); } lastLocalDirection = localDirection; } private void Solve(Vector3 targetPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) ForwardReach(targetPosition); BackwardReach(bones[0].transform.position); } private void ForwardReach(Vector3 position) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) bones[bones.Length - 1].solverPosition = Vector3.Lerp(bones[bones.Length - 1].solverPosition, position, IKPositionWeight); for (int i = 0; i < limitedBones.Length; i++) { limitedBones[i] = false; } for (int num = bones.Length - 2; num > -1; num--) { bones[num].solverPosition = SolveJoint(bones[num].solverPosition, bones[num + 1].solverPosition, bones[num].length); LimitForward(num, num + 1); } LimitForward(0, 0); } private void SolverMove(int index, Vector3 offset) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) for (int i = index; i < bones.Length; i++) { Bone obj = bones[i]; obj.solverPosition += offset; } } private void SolverRotate(int index, Quaternion rotation, bool recursive) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) for (int i = index; i < bones.Length; i++) { bones[i].solverRotation = rotation * bones[i].solverRotation; if (!recursive) { break; } } } private void SolverRotateChildren(int index, Quaternion rotation) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) for (int i = index + 1; i < bones.Length; i++) { bones[i].solverRotation = rotation * bones[i].solverRotation; } } private void SolverMoveChildrenAroundPoint(int index, Quaternion rotation) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) for (int i = index + 1; i < bones.Length; i++) { Vector3 val = bones[i].solverPosition - bones[index].solverPosition; bones[i].solverPosition = bones[index].solverPosition + rotation * val; } } private Quaternion GetParentSolverRotation(int index) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (index > 0) { return bones[index - 1].solverRotation; } if ((Object)(object)bones[0].transform.parent == (Object)null) { return Quaternion.identity; } return bones[0].transform.parent.rotation; } private Vector3 GetParentSolverPosition(int index) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (index > 0) { return bones[index - 1].solverPosition; } if ((Object)(object)bones[0].transform.parent == (Object)null) { return Vector3.zero; } return bones[0].transform.parent.position; } private Quaternion GetLimitedRotation(int index, Quaternion q, out bool changed) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) changed = false; Quaternion parentSolverRotation = GetParentSolverRotation(index); Quaternion localRotation = Quaternion.Inverse(parentSolverRotation) * q; Quaternion limitedLocalRotation = bones[index].rotationLimit.GetLimitedLocalRotation(localRotation, out changed); if (!changed) { return q; } return parentSolverRotation * limitedLocalRotation; } private void LimitForward(int rotateBone, int limitBone) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) if (!useRotationLimits || (Object)(object)bones[limitBone].rotationLimit == (Object)null) { return; } Vector3 solverPosition = bones[bones.Length - 1].solverPosition; for (int i = rotateBone; i < bones.Length - 1 && !limitedBones[i]; i++) { Quaternion rotation = Quaternion.FromToRotation(bones[i].solverRotation * bones[i].axis, bones[i + 1].solverPosition - bones[i].solverPosition); SolverRotate(i, rotation, recursive: false); } bool changed = false; Quaternion limitedRotation = GetLimitedRotation(limitBone, bones[limitBone].solverRotation, out changed); if (changed) { if (limitBone < bones.Length - 1) { Quaternion rotation2 = QuaTools.FromToRotation(bones[limitBone].solverRotation, limitedRotation); bones[limitBone].solverRotation = limitedRotation; SolverRotateChildren(limitBone, rotation2); SolverMoveChildrenAroundPoint(limitBone, rotation2); Quaternion rotation3 = Quaternion.FromToRotation(bones[bones.Length - 1].solverPosition - bones[rotateBone].solverPosition, solverPosition - bones[rotateBone].solverPosition); SolverRotate(rotateBone, rotation3, recursive: true); SolverMoveChildrenAroundPoint(rotateBone, rotation3); SolverMove(rotateBone, solverPosition - bones[bones.Length - 1].solverPosition); } else { bones[limitBone].solverRotation = limitedRotation; } } limitedBones[limitBone] = true; } private void BackwardReach(Vector3 position) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (useRotationLimits) { BackwardReachLimited(position); } else { BackwardReachUnlimited(position); } } private void BackwardReachUnlimited(Vector3 position) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) bones[0].solverPosition = position; for (int i = 1; i < bones.Length; i++) { bones[i].solverPosition = SolveJoint(bones[i].solverPosition, bones[i - 1].solverPosition, bones[i - 1].length); } } private void BackwardReachLimited(Vector3 position) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) bones[0].solverPosition = position; for (int i = 0; i < bones.Length - 1; i++) { Vector3 val = SolveJoint(bones[i + 1].solverPosition, bones[i].solverPosition, bones[i].length); Quaternion val2 = Quaternion.FromToRotation(bones[i].solverRotation * bones[i].axis, val - bones[i].solverPosition); Quaternion val3 = val2 * bones[i].solverRotation; if ((Object)(object)bones[i].rotationLimit != (Object)null) { bool changed = false; val3 = GetLimitedRotation(i, val3, out changed); } Quaternion rotation = QuaTools.FromToRotation(bones[i].solverRotation, val3); bones[i].solverRotation = val3; SolverRotateChildren(i, rotation); bones[i + 1].solverPosition = bones[i].solverPosition + bones[i].solverRotation * solverLocalPositions[i + 1]; } for (int j = 0; j < bones.Length; j++) { bones[j].solverRotation = Quaternion.LookRotation(bones[j].solverRotation * Vector3.forward, bones[j].solverRotation * Vector3.up); } } private void MapToSolverPositions() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) bones[0].transform.position = bones[0].solverPosition; for (int i = 0; i < bones.Length - 1; i++) { if (XY) { bones[i].Swing2D(bones[i + 1].solverPosition); } else { bones[i].Swing(bones[i + 1].solverPosition); } } } private void MapToSolverPositionsLimited() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) bones[0].transform.position = bones[0].solverPosition; for (int i = 0; i < bones.Length; i++) { if (i < bones.Length - 1) { bones[i].transform.rotation = bones[i].solverRotation; } } } } [Serializable] public class IKSolverFABRIKRoot : IKSolver { public int iterations = 4; [Range(0f, 1f)] public float rootPin = 0f; public FABRIKChain[] chains = new FABRIKChain[0]; private bool zeroWeightApplied; private bool[] isRoot; private Vector3 rootDefaultPosition; public override bool IsValid(ref string message) { if (chains.Length == 0) { message = "IKSolverFABRIKRoot contains no chains."; return false; } FABRIKChain[] array = chains; foreach (FABRIKChain fABRIKChain in array) { if (!fABRIKChain.IsValid(ref message)) { return false; } } for (int j = 0; j < chains.Length; j++) { for (int k = 0; k < chains.Length; k++) { if (j != k && (Object)(object)chains[j].ik == (Object)(object)chains[k].ik) { message = ((Object)chains[j].ik).name + " is represented more than once in IKSolverFABRIKRoot chain."; return false; } } } for (int l = 0; l < chains.Length; l++) { for (int m = 0; m < chains[l].children.Length; m++) { int num = chains[l].children[m]; if (num < 0) { message = ((Object)chains[l].ik).name + "IKSolverFABRIKRoot chain at index " + l + " has invalid children array. Child index is < 0."; return false; } if (num == l) { message = ((Object)chains[l].ik).name + "IKSolverFABRIKRoot chain at index " + l + " has invalid children array. Child index is referencing to itself."; return false; } if (num >= chains.Length) { message = ((Object)chains[l].ik).name + "IKSolverFABRIKRoot chain at index " + l + " has invalid children array. Child index > number of chains"; return false; } for (int n = 0; n < chains.Length; n++) { if (num != n) { continue; } for (int num2 = 0; num2 < chains[n].children.Length; num2++) { if (chains[n].children[num2] == l) { message = "Circular parenting. " + ((Object)chains[n].ik).name + " already has " + ((Object)chains[l].ik).name + " listed as it's child."; return false; } } } for (int num3 = 0; num3 < chains[l].children.Length; num3++) { if (m != num3 && chains[l].children[num3] == num) { message = "Chain number " + num + " is represented more than once in the children of " + ((Object)chains[l].ik).name; return false; } } } } return true; } public override void StoreDefaultLocalState() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) rootDefaultPosition = root.localPosition; for (int i = 0; i < chains.Length; i++) { chains[i].ik.solver.StoreDefaultLocalState(); } } public override void FixTransforms() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (base.initiated) { root.localPosition = rootDefaultPosition; for (int i = 0; i < chains.Length; i++) { chains[i].ik.solver.FixTransforms(); } } } protected override void OnInitiate() { for (int i = 0; i < chains.Length; i++) { chains[i].Initiate(); } isRoot = new bool[chains.Length]; for (int j = 0; j < chains.Length; j++) { isRoot[j] = IsRoot(j); } } private bool IsRoot(int index) { for (int i = 0; i < chains.Length; i++) { for (int j = 0; j < chains[i].children.Length; j++) { if (chains[i].children[j] == index) { return false; } } } return true; } protected override void OnUpdate() { //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight <= 0f && zeroWeightApplied) { return; } IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); for (int i = 0; i < chains.Length; i++) { chains[i].ik.solver.IKPositionWeight = IKPositionWeight; } if (IKPositionWeight <= 0f) { zeroWeightApplied = true; return; } zeroWeightApplied = false; for (int j = 0; j < iterations; j++) { for (int k = 0; k < chains.Length; k++) { if (isRoot[k]) { chains[k].Stage1(chains); } } Vector3 centroid = GetCentroid(); root.position = centroid; for (int l = 0; l < chains.Length; l++) { if (isRoot[l]) { chains[l].Stage2(centroid, chains); } } } } public override Point[] GetPoints() { Point[] array = new Point[0]; for (int i = 0; i < chains.Length; i++) { AddPointsToArray(ref array, chains[i]); } return array; } public override Point GetPoint(Transform transform) { Point point = null; for (int i = 0; i < chains.Length; i++) { point = chains[i].ik.solver.GetPoint(transform); if (point != null) { return point; } } return null; } private void AddPointsToArray(ref Point[] array, FABRIKChain chain) { Point[] points = chain.ik.solver.GetPoints(); Array.Resize(ref array, array.Length + points.Length); int num = 0; for (int i = array.Length - points.Length; i < array.Length; i++) { array[i] = points[num]; num++; } } private Vector3 GetCentroid() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) Vector3 val = root.position; if (rootPin >= 1f) { return val; } float num = 0f; for (int i = 0; i < chains.Length; i++) { if (isRoot[i]) { num += chains[i].pull; } } for (int j = 0; j < chains.Length; j++) { if (isRoot[j] && num > 0f) { val += (chains[j].ik.solver.bones[0].solverPosition - root.position) * (chains[j].pull / Mathf.Clamp(num, 1f, num)); } } return Vector3.Lerp(val, root.position, rootPin); } } [Serializable] public class IKSolverFullBody : IKSolver { [Range(0f, 10f)] public int iterations = 4; public FBIKChain[] chain = new FBIKChain[0]; public IKEffector[] effectors = new IKEffector[0]; public IKMappingSpine spineMapping = new IKMappingSpine(); public IKMappingBone[] boneMappings = new IKMappingBone[0]; public IKMappingLimb[] limbMappings = new IKMappingLimb[0]; public bool FABRIKPass = true; public UpdateDelegate OnPreRead; public UpdateDelegate OnPreSolve; public IterationDelegate OnPreIteration; public IterationDelegate OnPostIteration; public UpdateDelegate OnPreBend; public UpdateDelegate OnPostSolve; public UpdateDelegate OnStoreDefaultLocalState; public UpdateDelegate OnFixTransforms; public IKEffector GetEffector(Transform t) { for (int i = 0; i < effectors.Length; i++) { if ((Object)(object)effectors[i].bone == (Object)(object)t) { return effectors[i]; } } return null; } public FBIKChain GetChain(Transform transform) { int chainIndex = GetChainIndex(transform); if (chainIndex == -1) { return null; } return chain[chainIndex]; } public int GetChainIndex(Transform transform) { for (int i = 0; i < chain.Length; i++) { for (int j = 0; j < chain[i].nodes.Length; j++) { if ((Object)(object)chain[i].nodes[j].transform == (Object)(object)transform) { return i; } } } return -1; } public Node GetNode(int chainIndex, int nodeIndex) { return chain[chainIndex].nodes[nodeIndex]; } public void GetChainAndNodeIndexes(Transform transform, out int chainIndex, out int nodeIndex) { chainIndex = GetChainIndex(transform); if (chainIndex == -1) { nodeIndex = -1; } else { nodeIndex = chain[chainIndex].GetNodeIndex(transform); } } public override Point[] GetPoints() { int num = 0; for (int i = 0; i < chain.Length; i++) { num += chain[i].nodes.Length; } Point[] array = new Point[num]; int num2 = 0; for (int j = 0; j < chain.Length; j++) { for (int k = 0; k < chain[j].nodes.Length; k++) { array[num2] = chain[j].nodes[k]; num2++; } } return array; } public override Point GetPoint(Transform transform) { for (int i = 0; i < chain.Length; i++) { for (int j = 0; j < chain[i].nodes.Length; j++) { if ((Object)(object)chain[i].nodes[j].transform == (Object)(object)transform) { return chain[i].nodes[j]; } } } return null; } public override bool IsValid(ref string message) { if (chain == null) { message = "FBIK chain is null, can't initiate solver."; return false; } if (chain.Length == 0) { message = "FBIK chain length is 0, can't initiate solver."; return false; } for (int i = 0; i < chain.Length; i++) { if (!chain[i].IsValid(ref message)) { return false; } } IKEffector[] array = effectors; foreach (IKEffector iKEffector in array) { if (!iKEffector.IsValid(this, ref message)) { return false; } } if (!spineMapping.IsValid(this, ref message)) { return false; } IKMappingLimb[] array2 = limbMappings; foreach (IKMappingLimb iKMappingLimb in array2) { if (!iKMappingLimb.IsValid(this, ref message)) { return false; } } IKMappingBone[] array3 = boneMappings; foreach (IKMappingBone iKMappingBone in array3) { if (!iKMappingBone.IsValid(this, ref message)) { return false; } } return true; } public override void StoreDefaultLocalState() { spineMapping.StoreDefaultLocalState(); for (int i = 0; i < limbMappings.Length; i++) { limbMappings[i].StoreDefaultLocalState(); } for (int j = 0; j < boneMappings.Length; j++) { boneMappings[j].StoreDefaultLocalState(); } if (OnStoreDefaultLocalState != null) { OnStoreDefaultLocalState(); } } public override void FixTransforms() { if (base.initiated && !(IKPositionWeight <= 0f)) { spineMapping.FixTransforms(); for (int i = 0; i < limbMappings.Length; i++) { limbMappings[i].FixTransforms(); } for (int j = 0; j < boneMappings.Length; j++) { boneMappings[j].FixTransforms(); } if (OnFixTransforms != null) { OnFixTransforms(); } } } protected override void OnInitiate() { for (int i = 0; i < chain.Length; i++) { chain[i].Initiate(this); } IKEffector[] array = effectors; foreach (IKEffector iKEffector in array) { iKEffector.Initiate(this); } spineMapping.Initiate(this); IKMappingBone[] array2 = boneMappings; foreach (IKMappingBone iKMappingBone in array2) { iKMappingBone.Initiate(this); } IKMappingLimb[] array3 = limbMappings; foreach (IKMappingLimb iKMappingLimb in array3) { iKMappingLimb.Initiate(this); } } protected override void OnUpdate() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight <= 0f) { for (int i = 0; i < effectors.Length; i++) { effectors[i].positionOffset = Vector3.zero; } } else if (chain.Length != 0) { IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); if (OnPreRead != null) { OnPreRead(); } ReadPose(); if (OnPreSolve != null) { OnPreSolve(); } Solve(); if (OnPostSolve != null) { OnPostSolve(); } WritePose(); for (int j = 0; j < effectors.Length; j++) { effectors[j].OnPostWrite(); } } } protected virtual void ReadPose() { for (int i = 0; i < chain.Length; i++) { if (chain[i].bendConstraint.initiated) { chain[i].bendConstraint.LimitBend(IKPositionWeight, GetEffector(chain[i].nodes[2].transform).positionWeight); } } for (int j = 0; j < effectors.Length; j++) { effectors[j].ResetOffset(this); } for (int k = 0; k < effectors.Length; k++) { effectors[k].OnPreSolve(this); } for (int l = 0; l < chain.Length; l++) { chain[l].ReadPose(this, iterations > 0); } if (iterations > 0) { spineMapping.ReadPose(); for (int m = 0; m < boneMappings.Length; m++) { boneMappings[m].ReadPose(); } } for (int n = 0; n < limbMappings.Length; n++) { limbMappings[n].ReadPose(); } } protected virtual void Solve() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) if (iterations > 0) { for (int i = 0; i < ((!FABRIKPass) ? 1 : iterations); i++) { if (OnPreIteration != null) { OnPreIteration(i); } for (int j = 0; j < effectors.Length; j++) { if (effectors[j].isEndEffector) { effectors[j].Update(this); } } if (FABRIKPass) { chain[0].Push(this); if (FABRIKPass) { chain[0].Reach(this); } for (int k = 0; k < effectors.Length; k++) { if (!effectors[k].isEndEffector) { effectors[k].Update(this); } } } chain[0].SolveTrigonometric(this); if (FABRIKPass) { chain[0].Stage1(this); for (int l = 0; l < effectors.Length; l++) { if (!effectors[l].isEndEffector) { effectors[l].Update(this); } } chain[0].Stage2(this, chain[0].nodes[0].solverPosition); } if (OnPostIteration != null) { OnPostIteration(i); } } } if (OnPreBend != null) { OnPreBend(); } for (int m = 0; m < effectors.Length; m++) { if (effectors[m].isEndEffector) { effectors[m].Update(this); } } ApplyBendConstraints(); } protected virtual void ApplyBendConstraints() { chain[0].SolveTrigonometric(this, calculateBendDirection: true); } protected virtual void WritePose() { if (IKPositionWeight <= 0f) { return; } if (iterations > 0) { spineMapping.WritePose(this); for (int i = 0; i < boneMappings.Length; i++) { boneMappings[i].WritePose(IKPositionWeight); } } for (int j = 0; j < limbMappings.Length; j++) { limbMappings[j].WritePose(this, iterations > 0); } } } [Serializable] public enum FullBodyBipedEffector { Body, LeftShoulder, RightShoulder, LeftThigh, RightThigh, LeftHand, RightHand, LeftFoot, RightFoot } [Serializable] public enum FullBodyBipedChain { LeftArm, RightArm, LeftLeg, RightLeg } [Serializable] public class IKSolverFullBodyBiped : IKSolverFullBody { public Transform rootNode; [Range(0f, 1f)] public float spineStiffness = 0.5f; [Range(-1f, 1f)] public float pullBodyVertical = 0.5f; [Range(-1f, 1f)] public float pullBodyHorizontal = 0f; private Vector3 offset; public IKEffector bodyEffector => GetEffector(FullBodyBipedEffector.Body); public IKEffector leftShoulderEffector => GetEffector(FullBodyBipedEffector.LeftShoulder); public IKEffector rightShoulderEffector => GetEffector(FullBodyBipedEffector.RightShoulder); public IKEffector leftThighEffector => GetEffector(FullBodyBipedEffector.LeftThigh); public IKEffector rightThighEffector => GetEffector(FullBodyBipedEffector.RightThigh); public IKEffector leftHandEffector => GetEffector(FullBodyBipedEffector.LeftHand); public IKEffector rightHandEffector => GetEffector(FullBodyBipedEffector.RightHand); public IKEffector leftFootEffector => GetEffector(FullBodyBipedEffector.LeftFoot); public IKEffector rightFootEffector => GetEffector(FullBodyBipedEffector.RightFoot); public FBIKChain leftArmChain => chain[1]; public FBIKChain rightArmChain => chain[2]; public FBIKChain leftLegChain => chain[3]; public FBIKChain rightLegChain => chain[4]; public IKMappingLimb leftArmMapping => limbMappings[0]; public IKMappingLimb rightArmMapping => limbMappings[1]; public IKMappingLimb leftLegMapping => limbMappings[2]; public IKMappingLimb rightLegMapping => limbMappings[3]; public IKMappingBone headMapping => boneMappings[0]; public Vector3 pullBodyOffset { get; private set; } public void SetChainWeights(FullBodyBipedChain c, float pull, float reach = 0f) { GetChain(c).pull = pull; GetChain(c).reach = reach; } public void SetEffectorWeights(FullBodyBipedEffector effector, float positionWeight, float rotationWeight) { GetEffector(effector).positionWeight = Mathf.Clamp(positionWeight, 0f, 1f); GetEffector(effector).rotationWeight = Mathf.Clamp(rotationWeight, 0f, 1f); } public FBIKChain GetChain(FullBodyBipedChain c) { return c switch { FullBodyBipedChain.LeftArm => chain[1], FullBodyBipedChain.RightArm => chain[2], FullBodyBipedChain.LeftLeg => chain[3], FullBodyBipedChain.RightLeg => chain[4], _ => null, }; } public FBIKChain GetChain(FullBodyBipedEffector effector) { return effector switch { FullBodyBipedEffector.Body => chain[0], FullBodyBipedEffector.LeftShoulder => chain[1], FullBodyBipedEffector.RightShoulder => chain[2], FullBodyBipedEffector.LeftThigh => chain[3], FullBodyBipedEffector.RightThigh => chain[4], FullBodyBipedEffector.LeftHand => chain[1], FullBodyBipedEffector.RightHand => chain[2], FullBodyBipedEffector.LeftFoot => chain[3], FullBodyBipedEffector.RightFoot => chain[4], _ => null, }; } public IKEffector GetEffector(FullBodyBipedEffector effector) { return effector switch { FullBodyBipedEffector.Body => effectors[0], FullBodyBipedEffector.LeftShoulder => effectors[1], FullBodyBipedEffector.RightShoulder => effectors[2], FullBodyBipedEffector.LeftThigh => effectors[3], FullBodyBipedEffector.RightThigh => effectors[4], FullBodyBipedEffector.LeftHand => effectors[5], FullBodyBipedEffector.RightHand => effectors[6], FullBodyBipedEffector.LeftFoot => effectors[7], FullBodyBipedEffector.RightFoot => effectors[8], _ => null, }; } public IKEffector GetEndEffector(FullBodyBipedChain c) { return c switch { FullBodyBipedChain.LeftArm => effectors[5], FullBodyBipedChain.RightArm => effectors[6], FullBodyBipedChain.LeftLeg => effectors[7], FullBodyBipedChain.RightLeg => effectors[8], _ => null, }; } public IKMappingLimb GetLimbMapping(FullBodyBipedChain chain) { return chain switch { FullBodyBipedChain.LeftArm => limbMappings[0], FullBodyBipedChain.RightArm => limbMappings[1], FullBodyBipedChain.LeftLeg => limbMappings[2], FullBodyBipedChain.RightLeg => limbMappings[3], _ => null, }; } public IKMappingLimb GetLimbMapping(FullBodyBipedEffector effector) { return effector switch { FullBodyBipedEffector.LeftShoulder => limbMappings[0], FullBodyBipedEffector.RightShoulder => limbMappings[1], FullBodyBipedEffector.LeftThigh => limbMappings[2], FullBodyBipedEffector.RightThigh => limbMappings[3], FullBodyBipedEffector.LeftHand => limbMappings[0], FullBodyBipedEffector.RightHand => limbMappings[1], FullBodyBipedEffector.LeftFoot => limbMappings[2], FullBodyBipedEffector.RightFoot => limbMappings[3], _ => null, }; } public IKMappingSpine GetSpineMapping() { return spineMapping; } public IKMappingBone GetHeadMapping() { return boneMappings[0]; } public IKConstraintBend GetBendConstraint(FullBodyBipedChain limb) { return limb switch { FullBodyBipedChain.LeftArm => chain[1].bendConstraint, FullBodyBipedChain.RightArm => chain[2].bendConstraint, FullBodyBipedChain.LeftLeg => chain[3].bendConstraint, FullBodyBipedChain.RightLeg => chain[4].bendConstraint, _ => null, }; } public override bool IsValid(ref string message) { if (!base.IsValid(ref message)) { return false; } if ((Object)(object)rootNode == (Object)null) { message = "Root Node bone is null. FBBIK will not initiate."; return false; } if (chain.Length != 5 || chain[0].nodes.Length != 1 || chain[1].nodes.Length != 3 || chain[2].nodes.Length != 3 || chain[3].nodes.Length != 3 || chain[4].nodes.Length != 3 || effectors.Length != 9 || limbMappings.Length != 4) { message = "Invalid FBBIK setup. Please right-click on the component header and select 'Reinitiate'."; return false; } return true; } public void SetToReferences(BipedReferences references, Transform rootNode = null) { root = references.root; if ((Object)(object)rootNode == (Object)null) { rootNode = DetectRootNodeBone(references); } this.rootNode = rootNode; if (chain == null || chain.Length != 5) { chain = new FBIKChain[5]; } for (int i = 0; i < chain.Length; i++) { if (chain[i] == null) { chain[i] = new FBIKChain(); } } chain[0].pin = 0f; chain[0].SetNodes(rootNode); chain[0].children = new int[4] { 1, 2, 3, 4 }; chain[1].SetNodes(references.leftUpperArm, references.leftForearm, references.leftHand); chain[2].SetNodes(references.rightUpperArm, references.rightForearm, references.rightHand); chain[3].SetNodes(references.leftThigh, references.leftCalf, references.leftFoot); chain[4].SetNodes(references.rightThigh, references.rightCalf, references.rightFoot); if (effectors.Length != 9) { effectors = new IKEffector[9] { new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector() }; } effectors[0].bone = rootNode; effectors[0].childBones = (Transform[])(object)new Transform[2] { references.leftThigh, references.rightThigh }; effectors[1].bone = references.leftUpperArm; effectors[2].bone = references.rightUpperArm; effectors[3].bone = references.leftThigh; effectors[4].bone = references.rightThigh; effectors[5].bone = references.leftHand; effectors[6].bone = references.rightHand; effectors[7].bone = references.leftFoot; effectors[8].bone = references.rightFoot; effectors[5].planeBone1 = references.leftUpperArm; effectors[5].planeBone2 = references.rightUpperArm; effectors[5].planeBone3 = rootNode; effectors[6].planeBone1 = references.rightUpperArm; effectors[6].planeBone2 = references.leftUpperArm; effectors[6].planeBone3 = rootNode; effectors[7].planeBone1 = references.leftThigh; effectors[7].planeBone2 = references.rightThigh; effectors[7].planeBone3 = rootNode; effectors[8].planeBone1 = references.rightThigh; effectors[8].planeBone2 = references.leftThigh; effectors[8].planeBone3 = rootNode; chain[0].childConstraints = new FBIKChain.ChildConstraint[4] { new FBIKChain.ChildConstraint(references.leftUpperArm, references.rightThigh, 0f, 1f), new FBIKChain.ChildConstraint(references.rightUpperArm, references.leftThigh, 0f, 1f), new FBIKChain.ChildConstraint(references.leftUpperArm, references.rightUpperArm), new FBIKChain.ChildConstraint(references.leftThigh, references.rightThigh) }; Transform[] array = (Transform[])(object)new Transform[references.spine.Length + 1]; array[0] = references.pelvis; for (int j = 0; j < references.spine.Length; j++) { array[j + 1] = references.spine[j]; } if (spineMapping == null) { spineMapping = new IKMappingSpine(); spineMapping.iterations = 3; } spineMapping.SetBones(array, references.leftUpperArm, references.rightUpperArm, references.leftThigh, references.rightThigh); int num = (((Object)(object)references.head != (Object)null) ? 1 : 0); if (boneMappings.Length != num) { boneMappings = new IKMappingBone[num]; for (int k = 0; k < boneMappings.Length; k++) { boneMappings[k] = new IKMappingBone(); } if (num == 1) { boneMappings[0].maintainRotationWeight = 0f; } } if (boneMappings.Length > 0) { boneMappings[0].bone = references.head; } if (limbMappings.Length != 4) { limbMappings = new IKMappingLimb[4] { new IKMappingLimb(), new IKMappingLimb(), new IKMappingLimb(), new IKMappingLimb() }; limbMappings[2].maintainRotationWeight = 1f; limbMappings[3].maintainRotationWeight = 1f; } limbMappings[0].SetBones(references.leftUpperArm, references.leftForearm, references.leftHand, GetLeftClavicle(references)); limbMappings[1].SetBones(references.rightUpperArm, references.rightForearm, references.rightHand, GetRightClavicle(references)); limbMappings[2].SetBones(references.leftThigh, references.leftCalf, references.leftFoot); limbMappings[3].SetBones(references.rightThigh, references.rightCalf, references.rightFoot); if (Application.isPlaying) { Initiate(references.root); } } public static Transform DetectRootNodeBone(BipedReferences references) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if (!references.isFilled) { return null; } if (references.spine.Length < 1) { return null; } int num = references.spine.Length; if (num == 1) { return references.spine[0]; } Vector3 val = Vector3.Lerp(references.leftThigh.position, references.rightThigh.position, 0.5f); Vector3 val2 = Vector3.Lerp(references.leftUpperArm.position, references.rightUpperArm.position, 0.5f); Vector3 val3 = val2 - val; float magnitude = ((Vector3)(ref val3)).magnitude; if (references.spine.Length < 2) { return references.spine[0]; } int num2 = 0; for (int i = 1; i < num; i++) { Vector3 val4 = references.spine[i].position - val; Vector3 val5 = Vector3.Project(val4, val3); float num3 = Vector3.Dot(((Vector3)(ref val5)).normalized, ((Vector3)(ref val3)).normalized); if (num3 > 0f) { float num4 = ((Vector3)(ref val5)).magnitude / magnitude; if (num4 < 0.5f) { num2 = i; } } } return references.spine[num2]; } public void SetLimbOrientations(BipedLimbOrientations o) { SetLimbOrientation(FullBodyBipedChain.LeftArm, o.leftArm); SetLimbOrientation(FullBodyBipedChain.RightArm, o.rightArm); SetLimbOrientation(FullBodyBipedChain.LeftLeg, o.leftLeg); SetLimbOrientation(FullBodyBipedChain.RightLeg, o.rightLeg); } private void SetLimbOrientation(FullBodyBipedChain chain, BipedLimbOrientations.LimbOrientation limbOrientation) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (chain == FullBodyBipedChain.LeftArm || chain == FullBodyBipedChain.RightArm) { GetBendConstraint(chain).SetLimbOrientation(-limbOrientation.upperBoneForwardAxis, -limbOrientation.lowerBoneForwardAxis, -limbOrientation.lastBoneLeftAxis); GetLimbMapping(chain).SetLimbOrientation(-limbOrientation.upperBoneForwardAxis, -limbOrientation.lowerBoneForwardAxis); } else { GetBendConstraint(chain).SetLimbOrientation(limbOrientation.upperBoneForwardAxis, limbOrientation.lowerBoneForwardAxis, limbOrientation.lastBoneLeftAxis); GetLimbMapping(chain).SetLimbOrientation(limbOrientation.upperBoneForwardAxis, limbOrientation.lowerBoneForwardAxis); } } private static Transform GetLeftClavicle(BipedReferences references) { if ((Object)(object)references.leftUpperArm == (Object)null) { return null; } if (!Contains(references.spine, references.leftUpperArm.parent)) { return references.leftUpperArm.parent; } return null; } private static Transform GetRightClavicle(BipedReferences references) { if ((Object)(object)references.rightUpperArm == (Object)null) { return null; } if (!Contains(references.spine, references.rightUpperArm.parent)) { return references.rightUpperArm.parent; } return null; } private static bool Contains(Transform[] array, Transform transform) { foreach (Transform val in array) { if ((Object)(object)val == (Object)(object)transform) { return true; } } return false; } protected override void ReadPose() { for (int i = 0; i < effectors.Length; i++) { effectors[i].SetToTarget(); } PullBody(); float pushElasticity = Mathf.Clamp(1f - spineStiffness, 0f, 1f); chain[0].childConstraints[0].pushElasticity = pushElasticity; chain[0].childConstraints[1].pushElasticity = pushElasticity; base.ReadPose(); } private void PullBody() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) if (iterations >= 1 && (pullBodyVertical != 0f || pullBodyHorizontal != 0f)) { Vector3 bodyOffset = GetBodyOffset(); pullBodyOffset = V3Tools.ExtractVertical(bodyOffset, root.up, pullBodyVertical) + V3Tools.ExtractHorizontal(bodyOffset, root.up, pullBodyHorizontal); IKEffector iKEffector = bodyEffector; iKEffector.positionOffset += pullBodyOffset; } } private Vector3 GetBodyOffset() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero + GetHandBodyPull(leftHandEffector, leftArmChain, Vector3.zero) * Mathf.Clamp(leftHandEffector.positionWeight, 0f, 1f); return val + GetHandBodyPull(rightHandEffector, rightArmChain, val) * Mathf.Clamp(rightHandEffector.positionWeight, 0f, 1f); } private Vector3 GetHandBodyPull(IKEffector effector, FBIKChain arm, Vector3 offset) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Vector3 val = effector.position - (arm.nodes[0].transform.position + offset); float num = arm.nodes[0].length + arm.nodes[1].length; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < num) { return Vector3.zero; } float num2 = magnitude - num; return val / magnitude * num2; } protected override void ApplyBendConstraints() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) if (iterations > 0) { chain[1].bendConstraint.rotationOffset = leftHandEffector.planeRotationOffset; chain[2].bendConstraint.rotationOffset = rightHandEffector.planeRotationOffset; chain[3].bendConstraint.rotationOffset = leftFootEffector.planeRotationOffset; chain[4].bendConstraint.rotationOffset = rightFootEffector.planeRotationOffset; } else { offset = Vector3.Lerp(effectors[0].positionOffset, effectors[0].position - (effectors[0].bone.position + effectors[0].positionOffset), effectors[0].positionWeight); for (int i = 0; i < 5; i++) { Node node = effectors[i].GetNode(this); node.solverPosition += offset; } } base.ApplyBendConstraints(); } protected override void WritePose() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (iterations == 0) { Transform obj = spineMapping.spineBones[0]; obj.position += offset; } base.WritePose(); } } [Serializable] public class IKSolverHeuristic : IKSolver { public Transform target; public float tolerance = 0f; public int maxIterations = 4; public bool useRotationLimits = true; public bool XY; public Bone[] bones = new Bone[0]; protected Vector3 lastLocalDirection; protected float chainLength; protected virtual int minBones => 2; protected virtual bool boneLengthCanBeZero => true; protected virtual bool allowCommonParent => false; protected virtual Vector3 localDirection => bones[0].transform.InverseTransformDirection(bones[bones.Length - 1].transform.position - bones[0].transform.position); protected float positionOffset => Vector3.SqrMagnitude(localDirection - lastLocalDirection); public bool SetChain(Transform[] hierarchy, Transform root) { if (bones == null || bones.Length != hierarchy.Length) { bones = new Bone[hierarchy.Length]; } for (int i = 0; i < hierarchy.Length; i++) { if (bones[i] == null) { bones[i] = new Bone(); } bones[i].transform = hierarchy[i]; } Initiate(root); return base.initiated; } public void AddBone(Transform bone) { Transform[] array = (Transform[])(object)new Transform[bones.Length + 1]; for (int i = 0; i < bones.Length; i++) { array[i] = bones[i].transform; } array[^1] = bone; SetChain(array, root); } public override void StoreDefaultLocalState() { for (int i = 0; i < bones.Length; i++) { bones[i].StoreDefaultLocalState(); } } public override void FixTransforms() { if (base.initiated && !(IKPositionWeight <= 0f)) { for (int i = 0; i < bones.Length; i++) { bones[i].FixTransform(); } } } public override bool IsValid(ref string message) { //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) if (bones.Length == 0) { message = "IK chain has no Bones."; return false; } if (bones.Length < minBones) { message = "IK chain has less than " + minBones + " Bones."; return false; } Bone[] array = bones; foreach (Bone bone in array) { if ((Object)(object)bone.transform == (Object)null) { message = "One of the Bones is null."; return false; } } Transform val = IKSolver.ContainsDuplicateBone(bones); if ((Object)(object)val != (Object)null) { message = ((Object)val).name + " is represented multiple times in the Bones."; return false; } if (!allowCommonParent && !IKSolver.HierarchyIsValid(bones)) { message = "Invalid bone hierarchy detected. IK requires for it's bones to be parented to each other in descending order."; return false; } if (!boneLengthCanBeZero) { for (int j = 0; j < bones.Length - 1; j++) { Vector3 val2 = bones[j].transform.position - bones[j + 1].transform.position; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude == 0f) { message = "Bone " + j + " length is zero."; return false; } } } return true; } public override Point[] GetPoints() { return bones; } public override Point GetPoint(Transform transform) { for (int i = 0; i < bones.Length; i++) { if ((Object)(object)bones[i].transform == (Object)(object)transform) { return bones[i]; } } return null; } protected override void OnInitiate() { } protected override void OnUpdate() { } protected void InitiateBones() { //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) chainLength = 0f; for (int i = 0; i < bones.Length; i++) { if (i < bones.Length - 1) { Bone obj = bones[i]; Vector3 val = bones[i].transform.position - bones[i + 1].transform.position; obj.length = ((Vector3)(ref val)).magnitude; chainLength += bones[i].length; Vector3 position = bones[i + 1].transform.position; bones[i].axis = Quaternion.Inverse(bones[i].transform.rotation) * (position - bones[i].transform.position); if ((Object)(object)bones[i].rotationLimit != (Object)null) { if (XY && !(bones[i].rotationLimit is RotationLimitHinge)) { Warning.Log("Only Hinge Rotation Limits should be used on 2D IK solvers.", bones[i].transform); } bones[i].rotationLimit.Disable(); } } else { bones[i].axis = Quaternion.Inverse(bones[i].transform.rotation) * (bones[bones.Length - 1].transform.position - bones[0].transform.position); } } } protected Vector3 GetSingularityOffset() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if (!SingularityDetected()) { return Vector3.zero; } Vector3 val = IKPosition - bones[0].transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(normalized.y, normalized.z, normalized.x); if (useRotationLimits && (Object)(object)bones[bones.Length - 2].rotationLimit != (Object)null && bones[bones.Length - 2].rotationLimit is RotationLimitHinge) { val2 = bones[bones.Length - 2].transform.rotation * bones[bones.Length - 2].rotationLimit.axis; } return Vector3.Cross(normalized, val2) * bones[bones.Length - 2].length * 0.5f; } private bool SingularityDetected() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) if (!base.initiated) { return false; } Vector3 val = bones[bones.Length - 1].transform.position - bones[0].transform.position; Vector3 val2 = IKPosition - bones[0].transform.position; float magnitude = ((Vector3)(ref val)).magnitude; float magnitude2 = ((Vector3)(ref val2)).magnitude; if (magnitude < magnitude2) { return false; } if (magnitude < chainLength - bones[bones.Length - 2].length * 0.1f) { return false; } if (magnitude == 0f) { return false; } if (magnitude2 == 0f) { return false; } if (magnitude2 > magnitude) { return false; } float num = Vector3.Dot(val / magnitude, val2 / magnitude2); if (num < 0.999f) { return false; } return true; } } [Serializable] public class IKSolverLeg : IKSolver { [Range(0f, 1f)] public float IKRotationWeight = 1f; public Quaternion IKRotation = Quaternion.identity; public Point pelvis = new Point(); public Point thigh = new Point(); public Point calf = new Point(); public Point foot = new Point(); public Point toe = new Point(); public IKSolverVR.Leg leg = new IKSolverVR.Leg(); public Vector3 heelOffset; private Vector3[] positions = (Vector3[])(object)new Vector3[6]; private Quaternion[] rotations = (Quaternion[])(object)new Quaternion[6]; public override bool IsValid(ref string message) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown if ((Object)(object)pelvis.transform == (Object)null || (Object)(object)thigh.transform == (Object)null || (Object)(object)calf.transform == (Object)null || (Object)(object)foot.transform == (Object)null || (Object)(object)toe.transform == (Object)null) { message = "Please assign all bone slots of the Leg IK solver."; return false; } Transform val = (Transform)Hierarchy.ContainsDuplicate((Object[])(object)new Transform[5] { pelvis.transform, thigh.transform, calf.transform, foot.transform, toe.transform }); if ((Object)(object)val != (Object)null) { message = ((Object)val).name + " is represented multiple times in the LegIK."; return false; } return true; } public bool SetChain(Transform pelvis, Transform thigh, Transform calf, Transform foot, Transform toe, Transform root) { this.pelvis.transform = pelvis; this.thigh.transform = thigh; this.calf.transform = calf; this.foot.transform = foot; this.toe.transform = toe; Initiate(root); return base.initiated; } public override Point[] GetPoints() { return new Point[5] { pelvis, thigh, calf, foot, toe }; } public override Point GetPoint(Transform transform) { if ((Object)(object)pelvis.transform == (Object)(object)transform) { return pelvis; } if ((Object)(object)thigh.transform == (Object)(object)transform) { return thigh; } if ((Object)(object)calf.transform == (Object)(object)transform) { return calf; } if ((Object)(object)foot.transform == (Object)(object)transform) { return foot; } if ((Object)(object)toe.transform == (Object)(object)transform) { return toe; } return null; } public override void StoreDefaultLocalState() { thigh.StoreDefaultLocalState(); calf.StoreDefaultLocalState(); foot.StoreDefaultLocalState(); toe.StoreDefaultLocalState(); } public override void FixTransforms() { if (base.initiated) { thigh.FixTransform(); calf.FixTransform(); foot.FixTransform(); toe.FixTransform(); } } protected override void OnInitiate() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) IKPosition = toe.transform.position; IKRotation = toe.transform.rotation; Read(); } protected override void OnUpdate() { Read(); Solve(); Write(); } private void Solve() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) IKSolverVR.Leg obj = leg; obj.heelPositionOffset += heelOffset; leg.PreSolve(); leg.ApplyOffsets(1f); leg.Solve(stretch: true); leg.ResetOffsets(); } private void Read() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) leg.IKPosition = IKPosition; leg.positionWeight = IKPositionWeight; leg.IKRotation = IKRotation; leg.rotationWeight = IKRotationWeight; ref Vector3 reference = ref positions[0]; reference = root.position; ref Vector3 reference2 = ref positions[1]; reference2 = pelvis.transform.position; ref Vector3 reference3 = ref positions[2]; reference3 = thigh.transform.position; ref Vector3 reference4 = ref positions[3]; reference4 = calf.transform.position; ref Vector3 reference5 = ref positions[4]; reference5 = foot.transform.position; ref Vector3 reference6 = ref positions[5]; reference6 = toe.transform.position; ref Quaternion reference7 = ref rotations[0]; reference7 = root.rotation; ref Quaternion reference8 = ref rotations[1]; reference8 = pelvis.transform.rotation; ref Quaternion reference9 = ref rotations[2]; reference9 = thigh.transform.rotation; ref Quaternion reference10 = ref rotations[3]; reference10 = calf.transform.rotation; ref Quaternion reference11 = ref rotations[4]; reference11 = foot.transform.rotation; ref Quaternion reference12 = ref rotations[5]; reference12 = toe.transform.rotation; leg.Read(positions, rotations, hasChest: false, hasNeck: false, hasShoulders: false, hasToes: true, hasLegs: true, 1, 2); } private void Write() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) leg.Write(ref positions, ref rotations); thigh.transform.rotation = rotations[2]; calf.transform.rotation = rotations[3]; foot.transform.rotation = rotations[4]; toe.transform.rotation = rotations[5]; calf.transform.position = positions[3]; foot.transform.position = positions[4]; } } [Serializable] public class IKSolverLimb : IKSolverTrigonometric { [Serializable] public enum BendModifier { Animation, Target, Parent, Arm, Goal } [Serializable] public struct AxisDirection { public Vector3 direction; public Vector3 axis; public float dot; public AxisDirection(Vector3 direction, Vector3 axis) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) this.direction = ((Vector3)(ref direction)).normalized; this.axis = ((Vector3)(ref axis)).normalized; dot = 0f; } } public AvatarIKGoal goal; public BendModifier bendModifier; [Range(0f, 1f)] public float maintainRotationWeight; [Range(0f, 1f)] public float bendModifierWeight = 1f; public Transform bendGoal; private bool maintainBendFor1Frame; private bool maintainRotationFor1Frame; private Quaternion defaultRootRotation; private Quaternion parentDefaultRotation; private Quaternion bone3RotationBeforeSolve; private Quaternion maintainRotation; private Quaternion bone3DefaultRotation; private Vector3 _bendNormal; private Vector3 animationNormal; private AxisDirection[] axisDirectionsLeft = new AxisDirection[4]; private AxisDirection[] axisDirectionsRight = new AxisDirection[4]; private AxisDirection[] axisDirections { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)goal == 2) { return axisDirectionsLeft; } return axisDirectionsRight; } } public IKSolverLimb() { } public IKSolverLimb(AvatarIKGoal goal) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) this.goal = goal; } public void MaintainRotation() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (base.initiated) { maintainRotation = bone3.transform.rotation; maintainRotationFor1Frame = true; } } public void MaintainBend() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (base.initiated) { animationNormal = bone1.GetBendNormalFromCurrentRotation(); maintainBendFor1Frame = true; } } protected override void OnInitiateVirtual() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) defaultRootRotation = root.rotation; if ((Object)(object)bone1.transform.parent != (Object)null) { parentDefaultRotation = Quaternion.Inverse(defaultRootRotation) * bone1.transform.parent.rotation; } if ((Object)(object)bone3.rotationLimit != (Object)null) { bone3.rotationLimit.Disable(); } bone3DefaultRotation = bone3.transform.rotation; Vector3 val = Vector3.Cross(bone2.transform.position - bone1.transform.position, bone3.transform.position - bone2.transform.position); if (val != Vector3.zero) { bendNormal = val; } animationNormal = bendNormal; StoreAxisDirections(ref axisDirectionsLeft); StoreAxisDirections(ref axisDirectionsRight); } protected override void OnUpdateVirtual() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight > 0f) { bendModifierWeight = Mathf.Clamp(bendModifierWeight, 0f, 1f); maintainRotationWeight = Mathf.Clamp(maintainRotationWeight, 0f, 1f); _bendNormal = bendNormal; bendNormal = GetModifiedBendNormal(); } if (maintainRotationWeight * IKPositionWeight > 0f) { bone3RotationBeforeSolve = ((!maintainRotationFor1Frame) ? bone3.transform.rotation : maintainRotation); maintainRotationFor1Frame = false; } } protected override void OnPostSolveVirtual() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight > 0f) { bendNormal = _bendNormal; } if (maintainRotationWeight * IKPositionWeight > 0f) { bone3.transform.rotation = Quaternion.Slerp(bone3.transform.rotation, bone3RotationBeforeSolve, maintainRotationWeight * IKPositionWeight); } } private void StoreAxisDirections(ref AxisDirection[] axisDirections) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) ref AxisDirection reference = ref axisDirections[0]; reference = new AxisDirection(Vector3.zero, new Vector3(-1f, 0f, 0f)); ref AxisDirection reference2 = ref axisDirections[1]; reference2 = new AxisDirection(new Vector3(0.5f, 0f, -0.2f), new Vector3(-0.5f, -1f, 1f)); ref AxisDirection reference3 = ref axisDirections[2]; reference3 = new AxisDirection(new Vector3(-0.5f, -1f, -0.2f), new Vector3(0f, 0.5f, -1f)); ref AxisDirection reference4 = ref axisDirections[3]; reference4 = new AxisDirection(new Vector3(-0.5f, -0.5f, 1f), new Vector3(-1f, -1f, -1f)); } private Vector3 GetModifiedBendNormal() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Invalid comparison between Unknown and I4 //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Invalid comparison between Unknown and I4 //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Invalid comparison between Unknown and I4 //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) float num = bendModifierWeight; if (num <= 0f) { return bendNormal; } switch (bendModifier) { case BendModifier.Animation: if (!maintainBendFor1Frame) { MaintainBend(); } maintainBendFor1Frame = false; return Vector3.Lerp(bendNormal, animationNormal, num); case BendModifier.Parent: { if ((Object)(object)bone1.transform.parent == (Object)null) { return bendNormal; } Quaternion val6 = bone1.transform.parent.rotation * Quaternion.Inverse(parentDefaultRotation); return Quaternion.Slerp(Quaternion.identity, val6 * Quaternion.Inverse(defaultRootRotation), num) * bendNormal; } case BendModifier.Target: { Quaternion val5 = IKRotation * Quaternion.Inverse(bone3DefaultRotation); return Quaternion.Slerp(Quaternion.identity, val5, num) * bendNormal; } case BendModifier.Arm: { if ((Object)(object)bone1.transform.parent == (Object)null) { return bendNormal; } if ((int)goal == 0 || (int)goal == 1) { if (!Warning.logged) { LogWarning("Trying to use the 'Arm' bend modifier on a leg."); } return bendNormal; } Vector3 val2 = IKPosition - bone1.transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; normalized = Quaternion.Inverse(bone1.transform.parent.rotation * Quaternion.Inverse(parentDefaultRotation)) * normalized; if ((int)goal == 2) { normalized.x = 0f - normalized.x; } for (int i = 1; i < axisDirections.Length; i++) { axisDirections[i].dot = Mathf.Clamp(Vector3.Dot(axisDirections[i].direction, normalized), 0f, 1f); axisDirections[i].dot = Interp.Float(axisDirections[i].dot, InterpolationMode.InOutQuintic); } Vector3 val3 = axisDirections[0].axis; for (int j = 1; j < axisDirections.Length; j++) { val3 = Vector3.Slerp(val3, axisDirections[j].axis, axisDirections[j].dot); } if ((int)goal == 2) { val3.x = 0f - val3.x; val3 = -val3; } Vector3 val4 = bone1.transform.parent.rotation * Quaternion.Inverse(parentDefaultRotation) * val3; if (num >= 1f) { return val4; } return Vector3.Lerp(bendNormal, val4, num); } case BendModifier.Goal: { if ((Object)(object)bendGoal == (Object)null) { if (!Warning.logged) { LogWarning("Trying to use the 'Goal' Bend Modifier, but the Bend Goal is unassigned."); } return bendNormal; } Vector3 val = Vector3.Cross(bendGoal.position - bone1.transform.position, IKPosition - bone1.transform.position); if (val == Vector3.zero) { return bendNormal; } if (num >= 1f) { return val; } return Vector3.Lerp(bendNormal, val, num); } default: return bendNormal; } } } [Serializable] public class IKSolverLookAt : IKSolver { [Serializable] public class LookAtBone : Bone { public Vector3 baseForwardOffsetEuler; public Vector3 forward => transform.rotation * axis; public LookAtBone() { } public LookAtBone(Transform transform) { base.transform = transform; } public void Initiate(Transform root) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)transform == (Object)null)) { axis = Quaternion.Inverse(transform.rotation) * root.forward; } } public void LookAt(Vector3 direction, float weight) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(forward, direction); Quaternion rotation = transform.rotation; transform.rotation = Quaternion.Lerp(rotation, val * rotation, weight); } } public Transform target; public LookAtBone[] spine = new LookAtBone[0]; public LookAtBone head = new LookAtBone(); public LookAtBone[] eyes = new LookAtBone[0]; [Range(0f, 1f)] public float bodyWeight = 0.5f; [Range(0f, 1f)] public float headWeight = 0.5f; [Range(0f, 1f)] public float eyesWeight = 1f; [Range(0f, 1f)] public float clampWeight = 0.5f; [Range(0f, 1f)] public float clampWeightHead = 0.5f; [Range(0f, 1f)] public float clampWeightEyes = 0.5f; [Range(0f, 2f)] public int clampSmoothing = 2; public AnimationCurve spineWeightCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 0.3f), new Keyframe(1f, 1f) }); public Vector3 spineTargetOffset; protected Vector3[] spineForwards = (Vector3[])(object)new Vector3[0]; protected Vector3[] headForwards = (Vector3[])(object)new Vector3[1]; protected Vector3[] eyeForward = (Vector3[])(object)new Vector3[1]; private bool isDirty; protected bool spineIsValid { get { if (spine == null) { return false; } if (spine.Length == 0) { return true; } for (int i = 0; i < spine.Length; i++) { if (spine[i] == null || (Object)(object)spine[i].transform == (Object)null) { return false; } } return true; } } protected bool spineIsEmpty => spine.Length == 0; protected bool headIsValid { get { if (head == null) { return false; } return true; } } protected bool headIsEmpty => (Object)(object)head.transform == (Object)null; protected bool eyesIsValid { get { if (eyes == null) { return false; } if (eyes.Length == 0) { return true; } for (int i = 0; i < eyes.Length; i++) { if (eyes[i] == null || (Object)(object)eyes[i].transform == (Object)null) { return false; } } return true; } } protected bool eyesIsEmpty => eyes.Length == 0; public void SetLookAtWeight(float weight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); } public void SetLookAtWeight(float weight, float bodyWeight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); this.bodyWeight = Mathf.Clamp(bodyWeight, 0f, 1f); } public void SetLookAtWeight(float weight, float bodyWeight, float headWeight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); this.bodyWeight = Mathf.Clamp(bodyWeight, 0f, 1f); this.headWeight = Mathf.Clamp(headWeight, 0f, 1f); } public void SetLookAtWeight(float weight, float bodyWeight, float headWeight, float eyesWeight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); this.bodyWeight = Mathf.Clamp(bodyWeight, 0f, 1f); this.headWeight = Mathf.Clamp(headWeight, 0f, 1f); this.eyesWeight = Mathf.Clamp(eyesWeight, 0f, 1f); } public void SetLookAtWeight(float weight, float bodyWeight, float headWeight, float eyesWeight, float clampWeight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); this.bodyWeight = Mathf.Clamp(bodyWeight, 0f, 1f); this.headWeight = Mathf.Clamp(headWeight, 0f, 1f); this.eyesWeight = Mathf.Clamp(eyesWeight, 0f, 1f); this.clampWeight = Mathf.Clamp(clampWeight, 0f, 1f); clampWeightHead = this.clampWeight; clampWeightEyes = this.clampWeight; } public void SetLookAtWeight(float weight, float bodyWeight = 0f, float headWeight = 1f, float eyesWeight = 0.5f, float clampWeight = 0.5f, float clampWeightHead = 0.5f, float clampWeightEyes = 0.3f) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); this.bodyWeight = Mathf.Clamp(bodyWeight, 0f, 1f); this.headWeight = Mathf.Clamp(headWeight, 0f, 1f); this.eyesWeight = Mathf.Clamp(eyesWeight, 0f, 1f); this.clampWeight = Mathf.Clamp(clampWeight, 0f, 1f); this.clampWeightHead = Mathf.Clamp(clampWeightHead, 0f, 1f); this.clampWeightEyes = Mathf.Clamp(clampWeightEyes, 0f, 1f); } public override void StoreDefaultLocalState() { for (int i = 0; i < spine.Length; i++) { spine[i].StoreDefaultLocalState(); } for (int j = 0; j < eyes.Length; j++) { eyes[j].StoreDefaultLocalState(); } if (head != null && (Object)(object)head.transform != (Object)null) { head.StoreDefaultLocalState(); } } public void SetDirty() { isDirty = true; } public override void FixTransforms() { if (base.initiated && (!(IKPositionWeight <= 0f) || isDirty)) { for (int i = 0; i < spine.Length; i++) { spine[i].FixTransform(); } for (int j = 0; j < eyes.Length; j++) { eyes[j].FixTransform(); } if (head != null && (Object)(object)head.transform != (Object)null) { head.FixTransform(); } isDirty = false; } } public override bool IsValid(ref string message) { if (!spineIsValid) { message = "IKSolverLookAt spine setup is invalid. Can't initiate solver."; return false; } if (!headIsValid) { message = "IKSolverLookAt head transform is null. Can't initiate solver."; return false; } if (!eyesIsValid) { message = "IKSolverLookAt eyes setup is invalid. Can't initiate solver."; return false; } if (spineIsEmpty && headIsEmpty && eyesIsEmpty) { message = "IKSolverLookAt eyes setup is invalid. Can't initiate solver."; return false; } Transform val = IKSolver.ContainsDuplicateBone(spine); if ((Object)(object)val != (Object)null) { message = ((Object)val).name + " is represented multiple times in a single IK chain. Can't initiate solver."; return false; } Transform val2 = IKSolver.ContainsDuplicateBone(eyes); if ((Object)(object)val2 != (Object)null) { message = ((Object)val2).name + " is represented multiple times in a single IK chain. Can't initiate solver."; return false; } return true; } public override Point[] GetPoints() { Point[] array = new Point[spine.Length + eyes.Length + (((Object)(object)head.transform != (Object)null) ? 1 : 0)]; for (int i = 0; i < spine.Length; i++) { array[i] = spine[i]; } int num = 0; for (int j = spine.Length; j < spine.Length + eyes.Length; j++) { array[j] = eyes[num]; num++; } if ((Object)(object)head.transform != (Object)null) { array[^1] = head; } return array; } public override Point GetPoint(Transform transform) { LookAtBone[] array = spine; foreach (LookAtBone lookAtBone in array) { if ((Object)(object)lookAtBone.transform == (Object)(object)transform) { return lookAtBone; } } LookAtBone[] array2 = eyes; foreach (LookAtBone lookAtBone2 in array2) { if ((Object)(object)lookAtBone2.transform == (Object)(object)transform) { return lookAtBone2; } } if ((Object)(object)head.transform == (Object)(object)transform) { return head; } return null; } public bool SetChain(Transform[] spine, Transform head, Transform[] eyes, Transform root) { SetBones(spine, ref this.spine); this.head = new LookAtBone(head); SetBones(eyes, ref this.eyes); Initiate(root); return base.initiated; } protected override void OnInitiate() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if (firstInitiation || !Application.isPlaying) { if (spine.Length > 0) { IKPosition = spine[spine.Length - 1].transform.position + root.forward * 3f; } else if ((Object)(object)head.transform != (Object)null) { IKPosition = head.transform.position + root.forward * 3f; } else if (eyes.Length > 0 && (Object)(object)eyes[0].transform != (Object)null) { IKPosition = eyes[0].transform.position + root.forward * 3f; } } LookAtBone[] array = spine; foreach (LookAtBone lookAtBone in array) { lookAtBone.Initiate(root); } if (head != null) { head.Initiate(root); } LookAtBone[] array2 = eyes; foreach (LookAtBone lookAtBone2 in array2) { lookAtBone2.Initiate(root); } if (spineForwards == null || spineForwards.Length != spine.Length) { spineForwards = (Vector3[])(object)new Vector3[spine.Length]; } if (headForwards == null) { headForwards = (Vector3[])(object)new Vector3[1]; } if (eyeForward == null) { eyeForward = (Vector3[])(object)new Vector3[1]; } } protected override void OnUpdate() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (!(IKPositionWeight <= 0f)) { IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); if ((Object)(object)target != (Object)null) { IKPosition = target.position; } SolveSpine(); SolveHead(); SolveEyes(); } } protected void SolveSpine() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if (!(bodyWeight <= 0f) && !spineIsEmpty) { Vector3 val = IKPosition + spineTargetOffset - spine[spine.Length - 1].transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; GetForwards(ref spineForwards, spine[0].forward, normalized, spine.Length, clampWeight); for (int i = 0; i < spine.Length; i++) { spine[i].LookAt(spineForwards[i], bodyWeight * IKPositionWeight); } } } protected void SolveHead() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (!(headWeight <= 0f) && !headIsEmpty) { Vector3 val = ((spine.Length <= 0 || !((Object)(object)spine[spine.Length - 1].transform != (Object)null)) ? head.forward : spine[spine.Length - 1].forward); Vector3 val2 = IKPosition - head.transform.position; Vector3 val3 = Vector3.Lerp(val, ((Vector3)(ref val2)).normalized, headWeight * IKPositionWeight); Vector3 normalized = ((Vector3)(ref val3)).normalized; GetForwards(ref headForwards, val, normalized, 1, clampWeightHead); head.LookAt(headForwards[0], headWeight * IKPositionWeight); } } protected void SolveEyes() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (eyesWeight <= 0f || eyesIsEmpty) { return; } for (int i = 0; i < eyes.Length; i++) { Quaternion val = (((Object)(object)head.transform != (Object)null) ? head.transform.rotation : ((spine.Length <= 0) ? root.rotation : spine[spine.Length - 1].transform.rotation)); Vector3 val2 = (((Object)(object)head.transform != (Object)null) ? head.axis : ((spine.Length <= 0) ? root.forward : spine[spine.Length - 1].axis)); if (eyes[i].baseForwardOffsetEuler != Vector3.zero) { val *= Quaternion.Euler(eyes[i].baseForwardOffsetEuler); } Vector3 baseForward = val * val2; ref Vector3[] forwards = ref eyeForward; Vector3 val3 = IKPosition - eyes[i].transform.position; GetForwards(ref forwards, baseForward, ((Vector3)(ref val3)).normalized, 1, clampWeightEyes); eyes[i].LookAt(eyeForward[0], eyesWeight * IKPositionWeight); } } protected Vector3[] GetForwards(ref Vector3[] forwards, Vector3 baseForward, Vector3 targetForward, int bones, float clamp) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) if (clamp >= 1f || IKPositionWeight <= 0f) { for (int i = 0; i < forwards.Length; i++) { forwards[i] = baseForward; } return forwards; } float num = Vector3.Angle(baseForward, targetForward); float num2 = 1f - num / 180f; float num3 = ((!(clamp > 0f)) ? 1f : Mathf.Clamp(1f - (clamp - num2) / (1f - num2), 0f, 1f)); float num4 = ((!(clamp > 0f)) ? 1f : Mathf.Clamp(num2 / clamp, 0f, 1f)); for (int j = 0; j < clampSmoothing; j++) { float num5 = num4 * (float)Math.PI * 0.5f; num4 = Mathf.Sin(num5); } if (forwards.Length == 1) { ref Vector3 reference = ref forwards[0]; reference = Vector3.Slerp(baseForward, targetForward, num4 * num3); } else { float num6 = 1f / (float)(forwards.Length - 1); for (int k = 0; k < forwards.Length; k++) { ref Vector3 reference2 = ref forwards[k]; reference2 = Vector3.Slerp(baseForward, targetForward, spineWeightCurve.Evaluate(num6 * (float)k) * num4 * num3); } } return forwards; } protected void SetBones(Transform[] array, ref LookAtBone[] bones) { if (array == null) { bones = new LookAtBone[0]; return; } if (bones.Length != array.Length) { bones = new LookAtBone[array.Length]; } for (int i = 0; i < array.Length; i++) { if (bones[i] == null) { bones[i] = new LookAtBone(array[i]); } else { bones[i].transform = array[i]; } } } } [Serializable] public class IKSolverTrigonometric : IKSolver { [Serializable] public class TrigonometricBone : Bone { private Quaternion targetToLocalSpace; private Vector3 defaultLocalBendNormal; public void Initiate(Vector3 childPosition, Vector3 bendNormal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = Quaternion.LookRotation(childPosition - transform.position, bendNormal); targetToLocalSpace = QuaTools.RotationToLocalSpace(transform.rotation, rotation); defaultLocalBendNormal = Quaternion.Inverse(transform.rotation) * bendNormal; } public Quaternion GetRotation(Vector3 direction, Vector3 bendNormal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) return Quaternion.LookRotation(direction, bendNormal) * targetToLocalSpace; } public Vector3 GetBendNormalFromCurrentRotation() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) return transform.rotation * defaultLocalBendNormal; } } public Transform target; [Range(0f, 1f)] public float IKRotationWeight = 1f; public Quaternion IKRotation = Quaternion.identity; public Vector3 bendNormal = Vector3.right; public TrigonometricBone bone1 = new TrigonometricBone(); public TrigonometricBone bone2 = new TrigonometricBone(); public TrigonometricBone bone3 = new TrigonometricBone(); protected Vector3 weightIKPosition; protected bool directHierarchy = true; public void SetBendGoalPosition(Vector3 goalPosition, float weight) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (!base.initiated || weight <= 0f) { return; } Vector3 val = Vector3.Cross(goalPosition - bone1.transform.position, IKPosition - bone1.transform.position); if (val != Vector3.zero) { if (weight >= 1f) { bendNormal = val; } else { bendNormal = Vector3.Lerp(bendNormal, val, weight); } } } public void SetBendPlaneToCurrent() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (base.initiated) { Vector3 val = Vector3.Cross(bone2.transform.position - bone1.transform.position, bone3.transform.position - bone2.transform.position); if (val != Vector3.zero) { bendNormal = val; } } } public void SetIKRotation(Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) IKRotation = rotation; } public void SetIKRotationWeight(float weight) { IKRotationWeight = Mathf.Clamp(weight, 0f, 1f); } public Quaternion GetIKRotation() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return IKRotation; } public float GetIKRotationWeight() { return IKRotationWeight; } public override Point[] GetPoints() { return new Point[3] { bone1, bone2, bone3 }; } public override Point GetPoint(Transform transform) { if ((Object)(object)bone1.transform == (Object)(object)transform) { return bone1; } if ((Object)(object)bone2.transform == (Object)(object)transform) { return bone2; } if ((Object)(object)bone3.transform == (Object)(object)transform) { return bone3; } return null; } public override void StoreDefaultLocalState() { bone1.StoreDefaultLocalState(); bone2.StoreDefaultLocalState(); bone3.StoreDefaultLocalState(); } public override void FixTransforms() { if (base.initiated) { bone1.FixTransform(); bone2.FixTransform(); bone3.FixTransform(); } } public override bool IsValid(ref string message) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bone1.transform == (Object)null || (Object)(object)bone2.transform == (Object)null || (Object)(object)bone3.transform == (Object)null) { message = "Please assign all Bones to the IK solver."; return false; } Transform val = (Transform)Hierarchy.ContainsDuplicate((Object[])(object)new Transform[3] { bone1.transform, bone2.transform, bone3.transform }); if ((Object)(object)val != (Object)null) { message = ((Object)val).name + " is represented multiple times in the Bones."; return false; } if (bone1.transform.position == bone2.transform.position) { message = "first bone position is the same as second bone position."; return false; } if (bone2.transform.position == bone3.transform.position) { message = "second bone position is the same as third bone position."; return false; } return true; } public bool SetChain(Transform bone1, Transform bone2, Transform bone3, Transform root) { this.bone1.transform = bone1; this.bone2.transform = bone2; this.bone3.transform = bone3; Initiate(root); return base.initiated; } public static void Solve(Transform bone1, Transform bone2, Transform bone3, Vector3 targetPosition, Vector3 bendNormal, float weight) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } targetPosition = Vector3.Lerp(bone3.position, targetPosition, weight); Vector3 val = targetPosition - bone1.position; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude != 0f) { Vector3 val2 = bone2.position - bone1.position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; Vector3 val3 = bone3.position - bone2.position; float sqrMagnitude2 = ((Vector3)(ref val3)).sqrMagnitude; Vector3 bendDirection = Vector3.Cross(val, bendNormal); Vector3 directionToBendPoint = GetDirectionToBendPoint(val, magnitude, bendDirection, sqrMagnitude, sqrMagnitude2); Quaternion val4 = Quaternion.FromToRotation(bone2.position - bone1.position, directionToBendPoint); if (weight < 1f) { val4 = Quaternion.Lerp(Quaternion.identity, val4, weight); } bone1.rotation = val4 * bone1.rotation; Quaternion val5 = Quaternion.FromToRotation(bone3.position - bone2.position, targetPosition - bone2.position); if (weight < 1f) { val5 = Quaternion.Lerp(Quaternion.identity, val5, weight); } bone2.rotation = val5 * bone2.rotation; } } private static Vector3 GetDirectionToBendPoint(Vector3 direction, float directionMag, Vector3 bendDirection, float sqrMag1, float sqrMag2) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) float num = (directionMag * directionMag + (sqrMag1 - sqrMag2)) / 2f / directionMag; float num2 = (float)Math.Sqrt(Mathf.Clamp(sqrMag1 - num * num, 0f, float.PositiveInfinity)); if (direction == Vector3.zero) { return Vector3.zero; } return Quaternion.LookRotation(direction, bendDirection) * new Vector3(0f, num2, num); } protected override void OnInitiate() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (bendNormal == Vector3.zero) { bendNormal = Vector3.right; } OnInitiateVirtual(); IKPosition = bone3.transform.position; IKRotation = bone3.transform.rotation; InitiateBones(); directHierarchy = IsDirectHierarchy(); } private bool IsDirectHierarchy() { if ((Object)(object)bone3.transform.parent != (Object)(object)bone2.transform) { return false; } if ((Object)(object)bone2.transform.parent != (Object)(object)bone1.transform) { return false; } return true; } private void InitiateBones() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) bone1.Initiate(bone2.transform.position, bendNormal); bone2.Initiate(bone3.transform.position, bendNormal); SetBendPlaneToCurrent(); } protected override void OnUpdate() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); IKRotationWeight = Mathf.Clamp(IKRotationWeight, 0f, 1f); if ((Object)(object)target != (Object)null) { IKPosition = target.position; IKRotation = target.rotation; } OnUpdateVirtual(); if (IKPositionWeight > 0f) { if (!directHierarchy) { bone1.Initiate(bone2.transform.position, bendNormal); bone2.Initiate(bone3.transform.position, bendNormal); } TrigonometricBone trigonometricBone = bone1; Vector3 val = bone2.transform.position - bone1.transform.position; trigonometricBone.sqrMag = ((Vector3)(ref val)).sqrMagnitude; TrigonometricBone trigonometricBone2 = bone2; Vector3 val2 = bone3.transform.position - bone2.transform.position; trigonometricBone2.sqrMag = ((Vector3)(ref val2)).sqrMagnitude; if (bendNormal == Vector3.zero && !Warning.logged) { LogWarning("IKSolverTrigonometric Bend Normal is Vector3.zero."); } weightIKPosition = Vector3.Lerp(bone3.transform.position, IKPosition, IKPositionWeight); Vector3 val3 = Vector3.Lerp(bone1.GetBendNormalFromCurrentRotation(), bendNormal, IKPositionWeight); Vector3 val4 = Vector3.Lerp(bone2.transform.position - bone1.transform.position, GetBendDirection(weightIKPosition, val3), IKPositionWeight); if (val4 == Vector3.zero) { val4 = bone2.transform.position - bone1.transform.position; } bone1.transform.rotation = bone1.GetRotation(val4, val3); bone2.transform.rotation = bone2.GetRotation(weightIKPosition - bone2.transform.position, bone2.GetBendNormalFromCurrentRotation()); } if (IKRotationWeight > 0f) { bone3.transform.rotation = Quaternion.Slerp(bone3.transform.rotation, IKRotation, IKRotationWeight); } OnPostSolveVirtual(); } protected virtual void OnInitiateVirtual() { } protected virtual void OnUpdateVirtual() { } protected virtual void OnPostSolveVirtual() { } protected Vector3 GetBendDirection(Vector3 IKPosition, Vector3 bendNormal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) Vector3 val = IKPosition - bone1.transform.position; if (val == Vector3.zero) { return Vector3.zero; } float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; float num = (float)Math.Sqrt(sqrMagnitude); float num2 = (sqrMagnitude + bone1.sqrMag - bone2.sqrMag) / 2f / num; float num3 = (float)Math.Sqrt(Mathf.Clamp(bone1.sqrMag - num2 * num2, 0f, float.PositiveInfinity)); Vector3 val2 = Vector3.Cross(val / num, bendNormal); return Quaternion.LookRotation(val, val2) * new Vector3(0f, num3, num2); } } [Serializable] public class IKSolverVR : IKSolver { [Serializable] public class Arm : BodyPart { [Serializable] public enum ShoulderRotationMode { YawPitch, FromTo } [Tooltip("The hand target. This should not be the hand controller itself, but a child GameObject parented to it so you could adjust it's position/rotation to match the orientation of the hand bone. The best practice for setup would be to move the hand controller to the avatar's hand as it it was held by the avatar, duplicate the avatar's hand bone and parent it to the hand controller. Then assign the duplicate to this slot.")] public Transform target; [Tooltip("The elbow will be bent towards this Transform if 'Bend Goal Weight' > 0.")] public Transform bendGoal; [Tooltip("Positional weight of the hand target. Note that if you have nulled the target, the hand will still be pulled to the last position of the target until you set this value to 0.")] [Range(0f, 1f)] public float positionWeight = 1f; [Tooltip("Rotational weight of the hand target. Note that if you have nulled the target, the hand will still be rotated to the last rotation of the target until you set this value to 0.")] [Range(0f, 1f)] public float rotationWeight = 1f; [Tooltip("Different techniques for shoulder bone rotation.")] public ShoulderRotationMode shoulderRotationMode = ShoulderRotationMode.YawPitch; [Tooltip("The weight of shoulder rotation")] [Range(0f, 1f)] public float shoulderRotationWeight = 1f; [Tooltip("The weight of twisting the shoulders backwards when arms are lifted up.")] [Range(0f, 1f)] public float shoulderTwistWeight = 1f; [Tooltip("If greater than 0, will bend the elbow towards the 'Bend Goal' Transform.")] [Range(0f, 1f)] public float bendGoalWeight; [Tooltip("Angular offset of the elbow bending direction.")] [Range(-180f, 180f)] public float swivelOffset; [Tooltip("Local axis of the hand bone that points from the wrist towards the palm. Used for defining hand bone orientation. If you have copied VRIK component from another avatar that has different bone orientations, right-click on VRIK header and select 'Guess Hand Orientations' from the context menu.")] public Vector3 wristToPalmAxis = Vector3.zero; [Tooltip("Local axis of the hand bone that points from the palm towards the thumb. Used for defining hand bone orientation. If you have copied VRIK component from another avatar that has different bone orientations, right-click on VRIK header and select 'Guess Hand Orientations' from the context menu.")] public Vector3 palmToThumbAxis = Vector3.zero; [Tooltip("Use this to make the arm shorter/longer. Works by displacement of hand and forearm localPosition.")] [Range(0.01f, 2f)] public float armLengthMlp = 1f; [Tooltip("Evaluates stretching of the arm by target distance relative to arm length. Value at time 1 represents stretching amount at the point where distance to the target is equal to arm length. Value at time 2 represents stretching amount at the point where distance to the target is double the arm length. Value represents the amount of stretching. Linear stretching would be achieved with a linear curve going up by 45 degrees. Increase the range of stretching by moving the last key up and right at the same amount. Smoothing in the curve can help reduce elbow snapping (start stretching the arm slightly before target distance reaches arm length). To get a good optimal value for this curve, please go to the 'VRIK (Basic)' demo scene and copy the stretch curve over from the Pilot character.")] public AnimationCurve stretchCurve = new AnimationCurve(); [NonSerialized] [HideInInspector] public Vector3 IKPosition; [NonSerialized] [HideInInspector] public Quaternion IKRotation = Quaternion.identity; [NonSerialized] [HideInInspector] public Vector3 bendDirection = Vector3.back; [NonSerialized] [HideInInspector] public Vector3 handPositionOffset; private bool hasShoulder; private Vector3 chestForwardAxis; private Vector3 chestUpAxis; private Quaternion chestRotation = Quaternion.identity; private Vector3 chestForward; private Vector3 chestUp; private Quaternion forearmRelToUpperArm = Quaternion.identity; private Vector3 upperArmBendAxis; private const float yawOffsetAngle = 45f; private const float pitchOffsetAngle = -30f; public Vector3 position { get; private set; } public Quaternion rotation { get; private set; } private VirtualBone shoulder => bones[0]; private VirtualBone upperArm => bones[hasShoulder ? 1 : 0]; private VirtualBone forearm => bones[(!hasShoulder) ? 1 : 2]; private VirtualBone hand => bones[(!hasShoulder) ? 2 : 3]; protected override void OnRead(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs, int rootIndex, int index) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) Vector3 val = positions[index]; Quaternion val2 = rotations[index]; Vector3 val3 = positions[index + 1]; Quaternion val4 = rotations[index + 1]; Vector3 val5 = positions[index + 2]; Quaternion val6 = rotations[index + 2]; Vector3 iKPosition = positions[index + 3]; Quaternion iKRotation = rotations[index + 3]; if (!initiated) { IKPosition = iKPosition; IKRotation = iKRotation; rotation = IKRotation; hasShoulder = hasShoulders; bones = new VirtualBone[(!hasShoulder) ? 3 : 4]; if (hasShoulder) { bones[0] = new VirtualBone(val, val2); bones[1] = new VirtualBone(val3, val4); bones[2] = new VirtualBone(val5, val6); bones[3] = new VirtualBone(iKPosition, iKRotation); } else { bones[0] = new VirtualBone(val3, val4); bones[1] = new VirtualBone(val5, val6); bones[2] = new VirtualBone(iKPosition, iKRotation); } Vector3 val7 = rotations[0] * Vector3.forward; chestForwardAxis = Quaternion.Inverse(rootRotation) * val7; chestUpAxis = Quaternion.Inverse(rootRotation) * (rotations[0] * Vector3.up); Vector3 val8 = AxisTools.GetAxisVectorToDirection(val4, val7); if (Vector3.Dot(val4 * val8, val7) < 0f) { val8 = -val8; } upperArmBendAxis = Vector3.Cross(Quaternion.Inverse(val4) * (val5 - val3), val8); if (upperArmBendAxis == Vector3.zero) { Debug.LogWarning((object)"VRIK can not calculate which way to bend the arms because the arms are perfectly straight. Please rotate the elbow bones slightly in their natural bending direction in the Editor."); } } if (hasShoulder) { bones[0].Read(val, val2); bones[1].Read(val3, val4); bones[2].Read(val5, val6); bones[3].Read(iKPosition, iKRotation); } else { bones[0].Read(val3, val4); bones[1].Read(val5, val6); bones[2].Read(iKPosition, iKRotation); } } public override void PreSolve() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)null) { IKPosition = target.position; IKRotation = target.rotation; } position = V3Tools.Lerp(hand.solverPosition, IKPosition, positionWeight); rotation = QuaTools.Lerp(hand.solverRotation, IKRotation, rotationWeight); shoulder.axis = ((Vector3)(ref shoulder.axis)).normalized; forearmRelToUpperArm = Quaternion.Inverse(upperArm.solverRotation) * forearm.solverRotation; } public override void ApplyOffsets(float scale) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) position += handPositionOffset; } private void Stretching() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) float num = upperArm.length + forearm.length; Vector3 zero = Vector3.zero; Vector3 zero2 = Vector3.zero; if (armLengthMlp != 1f) { num *= armLengthMlp; zero = (forearm.solverPosition - upperArm.solverPosition) * (armLengthMlp - 1f); zero2 = (hand.solverPosition - forearm.solverPosition) * (armLengthMlp - 1f); VirtualBone virtualBone = forearm; virtualBone.solverPosition += zero; VirtualBone virtualBone2 = hand; virtualBone2.solverPosition += zero + zero2; } float num2 = Vector3.Distance(upperArm.solverPosition, position); float num3 = num2 / num; float num4 = stretchCurve.Evaluate(num3); num4 *= positionWeight; zero = (forearm.solverPosition - upperArm.solverPosition) * num4; zero2 = (hand.solverPosition - forearm.solverPosition) * num4; VirtualBone virtualBone3 = forearm; virtualBone3.solverPosition += zero; VirtualBone virtualBone4 = hand; virtualBone4.solverPosition += zero + zero2; } public void Solve(bool isLeft) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_0735: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_0778: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_0756: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05c5: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_08c9: Unknown result type (might be due to invalid IL or missing references) //IL_08ce: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_07ca: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07dd: Unknown result type (might be due to invalid IL or missing references) //IL_07e2: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07e8: Unknown result type (might be due to invalid IL or missing references) //IL_081a: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_082f: Unknown result type (might be due to invalid IL or missing references) //IL_083a: Unknown result type (might be due to invalid IL or missing references) //IL_083f: Unknown result type (might be due to invalid IL or missing references) //IL_0844: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0855: Unknown result type (might be due to invalid IL or missing references) //IL_085a: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Unknown result type (might be due to invalid IL or missing references) //IL_0861: Unknown result type (might be due to invalid IL or missing references) //IL_0869: Unknown result type (might be due to invalid IL or missing references) //IL_086e: Unknown result type (might be due to invalid IL or missing references) //IL_0879: Unknown result type (might be due to invalid IL or missing references) //IL_0884: Unknown result type (might be due to invalid IL or missing references) //IL_0889: Unknown result type (might be due to invalid IL or missing references) //IL_088e: Unknown result type (might be due to invalid IL or missing references) //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_089c: Unknown result type (might be due to invalid IL or missing references) //IL_089e: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_066f: Unknown result type (might be due to invalid IL or missing references) //IL_08f6: Unknown result type (might be due to invalid IL or missing references) //IL_08fc: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_090c: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_069e: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Unknown result type (might be due to invalid IL or missing references) //IL_06b6: Unknown result type (might be due to invalid IL or missing references) //IL_06d7: Unknown result type (might be due to invalid IL or missing references) //IL_06dc: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06e1: Unknown result type (might be due to invalid IL or missing references) //IL_06e6: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_06fb: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) chestRotation = Quaternion.LookRotation(rootRotation * chestForwardAxis, rootRotation * chestUpAxis); chestForward = chestRotation * Vector3.forward; chestUp = chestRotation * Vector3.up; Vector3 val = Vector3.zero; if (hasShoulder && shoulderRotationWeight > 0f && LOD < 1) { switch (shoulderRotationMode) { case ShoulderRotationMode.YawPitch: { Vector3 val7 = position - shoulder.solverPosition; val7 = ((Vector3)(ref val7)).normalized; float num4 = ((!isLeft) ? (-45f) : 45f); Quaternion val8 = Quaternion.AngleAxis(((!isLeft) ? 90f : (-90f)) + num4, chestUp); Quaternion val9 = val8 * chestRotation; Vector3 val10 = Quaternion.Inverse(val9) * val7; float num5 = Mathf.Atan2(val10.x, val10.z) * 57.29578f; float num6 = Vector3.Dot(val10, Vector3.up); num6 = 1f - Mathf.Abs(num6); num5 *= num6; num5 -= num4; float num7 = ((!isLeft) ? (-50f) : (-20f)); float num8 = ((!isLeft) ? 20f : 50f); num5 = DamperValue(num5, num7 - num4, num8 - num4, 0.7f); Vector3 val11 = shoulder.solverRotation * shoulder.axis; Vector3 val12 = val9 * (Quaternion.AngleAxis(num5, Vector3.up) * Vector3.forward); Quaternion val13 = Quaternion.FromToRotation(val11, val12); Quaternion val14 = Quaternion.AngleAxis((!isLeft) ? 90f : (-90f), chestUp); val9 = val14 * chestRotation; val9 = Quaternion.AngleAxis((!isLeft) ? 30f : (-30f), chestForward) * val9; val7 = position - (shoulder.solverPosition + chestRotation * ((!isLeft) ? Vector3.left : Vector3.right) * base.mag); val10 = Quaternion.Inverse(val9) * val7; float num9 = Mathf.Atan2(val10.y, val10.z) * 57.29578f; num9 -= -30f; num9 = DamperValue(num9, -15f, 75f); Quaternion val15 = Quaternion.AngleAxis(0f - num9, val9 * Vector3.right); Quaternion val16 = val15 * val13; if (shoulderRotationWeight * positionWeight < 1f) { val16 = Quaternion.Lerp(Quaternion.identity, val16, shoulderRotationWeight * positionWeight); } VirtualBone.RotateBy(bones, val16); Stretching(); val = GetBendNormal(position - upperArm.solverPosition); VirtualBone.SolveTrigonometric(bones, 1, 2, 3, position, val, positionWeight); float num10 = Mathf.Clamp(num9 * positionWeight * shoulderRotationWeight * shoulderTwistWeight * 2f, 0f, 180f); shoulder.solverRotation = Quaternion.AngleAxis(num10, shoulder.solverRotation * ((!isLeft) ? (-shoulder.axis) : shoulder.axis)) * shoulder.solverRotation; upperArm.solverRotation = Quaternion.AngleAxis(num10, upperArm.solverRotation * ((!isLeft) ? (-upperArm.axis) : upperArm.axis)) * upperArm.solverRotation; break; } case ShoulderRotationMode.FromTo: { Quaternion solverRotation = shoulder.solverRotation; Vector3 val2 = upperArm.solverPosition - shoulder.solverPosition; Quaternion val3 = Quaternion.FromToRotation(((Vector3)(ref val2)).normalized + chestForward, position - shoulder.solverPosition); val3 = Quaternion.Slerp(Quaternion.identity, val3, 0.5f * shoulderRotationWeight * positionWeight); VirtualBone.RotateBy(bones, val3); Stretching(); VirtualBone.SolveTrigonometric(bones, 0, 2, 3, position, Vector3.Cross(forearm.solverPosition - shoulder.solverPosition, hand.solverPosition - shoulder.solverPosition), 0.5f * shoulderRotationWeight * positionWeight); val = GetBendNormal(position - upperArm.solverPosition); VirtualBone.SolveTrigonometric(bones, 1, 2, 3, position, val, positionWeight); Quaternion val4 = Quaternion.Inverse(Quaternion.LookRotation(chestUp, chestForward)); Vector3 val5 = val4 * (solverRotation * shoulder.axis); Vector3 val6 = val4 * (shoulder.solverRotation * shoulder.axis); float num = Mathf.Atan2(val5.x, val5.z) * 57.29578f; float num2 = Mathf.Atan2(val6.x, val6.z) * 57.29578f; float num3 = Mathf.DeltaAngle(num, num2); if (isLeft) { num3 = 0f - num3; } num3 = Mathf.Clamp(num3 * shoulderRotationWeight * shoulderTwistWeight * 2f * positionWeight, 0f, 180f); shoulder.solverRotation = Quaternion.AngleAxis(num3, shoulder.solverRotation * ((!isLeft) ? (-shoulder.axis) : shoulder.axis)) * shoulder.solverRotation; upperArm.solverRotation = Quaternion.AngleAxis(num3, upperArm.solverRotation * ((!isLeft) ? (-upperArm.axis) : upperArm.axis)) * upperArm.solverRotation; break; } } } else { if (LOD < 1) { Stretching(); } val = GetBendNormal(position - upperArm.solverPosition); if (hasShoulder) { VirtualBone.SolveTrigonometric(bones, 1, 2, 3, position, val, positionWeight); } else { VirtualBone.SolveTrigonometric(bones, 0, 1, 2, position, val, positionWeight); } } if (LOD < 1 && positionWeight > 0f) { Quaternion val17 = Quaternion.LookRotation(upperArm.solverRotation * upperArmBendAxis, forearm.solverPosition - upperArm.solverPosition); Vector3 val18 = Quaternion.Inverse(val17) * val; float num11 = Mathf.Atan2(val18.x, val18.z) * 57.29578f; upperArm.solverRotation = Quaternion.AngleAxis(num11 * positionWeight, forearm.solverPosition - upperArm.solverPosition) * upperArm.solverRotation; Quaternion val19 = upperArm.solverRotation * forearmRelToUpperArm; Quaternion val20 = Quaternion.FromToRotation(val19 * forearm.axis, hand.solverPosition - forearm.solverPosition); RotateTo(forearm, val20 * val19, positionWeight); } if (rotationWeight >= 1f) { hand.solverRotation = rotation; } else if (rotationWeight > 0f) { hand.solverRotation = Quaternion.Lerp(hand.solverRotation, rotation, rotationWeight); } } public override void ResetOffsets() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) handPositionOffset = Vector3.zero; } public override void Write(ref Vector3[] solvedPositions, ref Quaternion[] solvedRotations) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (hasShoulder) { ref Vector3 reference = ref solvedPositions[index]; reference = shoulder.solverPosition; ref Quaternion reference2 = ref solvedRotations[index]; reference2 = shoulder.solverRotation; } ref Vector3 reference3 = ref solvedPositions[index + 1]; reference3 = upperArm.solverPosition; ref Vector3 reference4 = ref solvedPositions[index + 2]; reference4 = forearm.solverPosition; ref Vector3 reference5 = ref solvedPositions[index + 3]; reference5 = hand.solverPosition; ref Quaternion reference6 = ref solvedRotations[index + 1]; reference6 = upperArm.solverRotation; ref Quaternion reference7 = ref solvedRotations[index + 2]; reference7 = forearm.solverRotation; ref Quaternion reference8 = ref solvedRotations[index + 3]; reference8 = hand.solverRotation; } private float DamperValue(float value, float min, float max, float weight = 1f) { float num = max - min; if (weight < 1f) { float num2 = max - num * 0.5f; float num3 = value - num2; num3 *= 0.5f; value = num2 + num3; } value -= min; float t = Mathf.Clamp(value / num, 0f, 1f); float num4 = Interp.Float(t, InterpolationMode.InOutQuintic); return Mathf.Lerp(min, max, num4); } private Vector3 GetBendNormal(Vector3 dir) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bendGoal != (Object)null) { bendDirection = bendGoal.position - bones[1].solverPosition; } Vector3 val = bones[0].solverRotation * bones[0].axis; Vector3 down = Vector3.down; Vector3 val2 = Quaternion.Inverse(chestRotation) * ((Vector3)(ref dir)).normalized + Vector3.forward; Quaternion val3 = Quaternion.FromToRotation(down, val2); Vector3 val4 = val3 * Vector3.back; down = Quaternion.Inverse(chestRotation) * val; val2 = Quaternion.Inverse(chestRotation) * dir; val3 = Quaternion.FromToRotation(down, val2); val4 = val3 * val4; val4 = chestRotation * val4; val4 += val; val4 -= rotation * wristToPalmAxis; val4 -= rotation * palmToThumbAxis * 0.5f; if (bendGoalWeight > 0f) { val4 = Vector3.Slerp(val4, bendDirection, bendGoalWeight); } if (swivelOffset != 0f) { val4 = Quaternion.AngleAxis(swivelOffset, -dir) * val4; } return Vector3.Cross(val4, dir); } private void Visualize(VirtualBone bone1, VirtualBone bone2, VirtualBone bone3, Color color) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Debug.DrawLine(bone1.solverPosition, bone2.solverPosition, color); Debug.DrawLine(bone2.solverPosition, bone3.solverPosition, color); } } [Serializable] public abstract class BodyPart { [HideInInspector] public VirtualBone[] bones = new VirtualBone[0]; protected bool initiated; protected Vector3 rootPosition; protected Quaternion rootRotation = Quaternion.identity; protected int index = -1; protected int LOD; public float sqrMag { get; private set; } public float mag { get; private set; } protected abstract void OnRead(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs, int rootIndex, int index); public abstract void PreSolve(); public abstract void Write(ref Vector3[] solvedPositions, ref Quaternion[] solvedRotations); public abstract void ApplyOffsets(float scale); public abstract void ResetOffsets(); public void SetLOD(int LOD) { this.LOD = LOD; } public void Read(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs, int rootIndex, int index) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) this.index = index; rootPosition = positions[rootIndex]; rootRotation = rotations[rootIndex]; OnRead(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, rootIndex, index); mag = VirtualBone.PreSolve(ref bones); sqrMag = mag * mag; initiated = true; } public void MovePosition(Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) Vector3 val = position - bones[0].solverPosition; VirtualBone[] array = bones; foreach (VirtualBone virtualBone in array) { virtualBone.solverPosition += val; } } public void MoveRotation(Quaternion rotation) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation2 = QuaTools.FromToRotation(bones[0].solverRotation, rotation); VirtualBone.RotateAroundPoint(bones, 0, bones[0].solverPosition, rotation2); } public void Translate(Vector3 position, Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) MovePosition(position); MoveRotation(rotation); } public void TranslateRoot(Vector3 newRootPos, Quaternion newRootRot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) Vector3 val = newRootPos - rootPosition; rootPosition = newRootPos; VirtualBone[] array = bones; foreach (VirtualBone virtualBone in array) { virtualBone.solverPosition += val; } Quaternion rotation = QuaTools.FromToRotation(rootRotation, newRootRot); rootRotation = newRootRot; VirtualBone.RotateAroundPoint(bones, 0, newRootPos, rotation); } public void RotateTo(VirtualBone bone, Quaternion rotation, float weight = 1f) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } Quaternion val = QuaTools.FromToRotation(bone.solverRotation, rotation); if (weight < 1f) { val = Quaternion.Slerp(Quaternion.identity, val, weight); } for (int i = 0; i < bones.Length; i++) { if (bones[i] == bone) { VirtualBone.RotateAroundPoint(bones, i, bones[i].solverPosition, val); break; } } } public void Visualize(Color color) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < bones.Length - 1; i++) { Debug.DrawLine(bones[i].solverPosition, bones[i + 1].solverPosition, color); } } public void Visualize() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) Visualize(Color.white); } } [Serializable] public class Footstep { public float stepSpeed = 3f; public Vector3 characterSpaceOffset; public Vector3 position; public Quaternion rotation = Quaternion.identity; public Quaternion stepToRootRot = Quaternion.identity; public bool isSupportLeg; public bool relaxFlag; public Vector3 stepFrom; public Vector3 stepTo; public Quaternion stepFromRot = Quaternion.identity; public Quaternion stepToRot = Quaternion.identity; private Quaternion footRelativeToRoot = Quaternion.identity; private float supportLegW; private float supportLegWV; public bool isStepping => stepProgress < 1f; public float stepProgress { get; private set; } public Footstep(Quaternion rootRotation, Vector3 footPosition, Quaternion footRotation, Vector3 characterSpaceOffset) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) this.characterSpaceOffset = characterSpaceOffset; Reset(rootRotation, footPosition, footRotation); footRelativeToRoot = Quaternion.Inverse(rootRotation) * rotation; } public void Reset(Quaternion rootRotation, Vector3 footPosition, Quaternion footRotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) position = footPosition; rotation = footRotation; stepFrom = position; stepTo = position; stepFromRot = rotation; stepToRot = rotation; stepToRootRot = rootRotation; stepProgress = 1f; } public void StepTo(Vector3 p, Quaternion rootRotation, float stepThreshold) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (relaxFlag) { stepThreshold = 0f; relaxFlag = false; } if (!(Vector3.Magnitude(p - stepTo) < stepThreshold) || !(Quaternion.Angle(rootRotation, stepToRootRot) < 25f)) { stepFrom = position; stepTo = p; stepFromRot = rotation; stepToRootRot = rootRotation; stepToRot = rootRotation * footRelativeToRoot; stepProgress = 0f; } } public void UpdateStepping(Vector3 p, Quaternion rootRotation, float speed) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) stepTo = Vector3.Lerp(stepTo, p, Time.deltaTime * speed); stepToRot = Quaternion.Lerp(stepToRot, rootRotation * footRelativeToRoot, Time.deltaTime * speed); stepToRootRot = stepToRot * Quaternion.Inverse(footRelativeToRoot); } public void UpdateStanding(Quaternion rootRotation, float minAngle, float speed) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (!(speed <= 0f) && !(minAngle >= 180f)) { Quaternion val = rootRotation * footRelativeToRoot; float num = Quaternion.Angle(rotation, val); if (num > minAngle) { rotation = Quaternion.RotateTowards(rotation, val, Mathf.Min(Time.deltaTime * speed * (1f - supportLegW), num - minAngle)); } } } public void Update(InterpolationMode interpolation, UnityEvent onStep) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) float num = ((!isSupportLeg) ? 0f : 1f); supportLegW = Mathf.SmoothDamp(supportLegW, num, ref supportLegWV, 0.2f); if (isStepping) { stepProgress = Mathf.MoveTowards(stepProgress, 1f, Time.deltaTime * stepSpeed); if (stepProgress >= 1f) { onStep.Invoke(); } float num2 = Interp.Float(stepProgress, interpolation); position = Vector3.Lerp(stepFrom, stepTo, num2); rotation = Quaternion.Lerp(stepFromRot, stepToRot, num2); } } } [Serializable] public class Leg : BodyPart { [Tooltip("The foot/toe target. This should not be the foot tracker itself, but a child GameObject parented to it so you could adjust it's position/rotation to match the orientation of the foot/toe bone. If a toe bone is assigned in the References, the solver will match the toe bone to this target. If no toe bone assigned, foot bone will be used instead.")] public Transform target; [Tooltip("The knee will be bent towards this Transform if 'Bend Goal Weight' > 0.")] public Transform bendGoal; [Tooltip("Positional weight of the toe/foot target. Note that if you have nulled the target, the foot will still be pulled to the last position of the target until you set this value to 0.")] [Range(0f, 1f)] public float positionWeight; [Tooltip("Rotational weight of the toe/foot target. Note that if you have nulled the target, the foot will still be rotated to the last rotation of the target until you set this value to 0.")] [Range(0f, 1f)] public float rotationWeight; [Tooltip("If greater than 0, will bend the knee towards the 'Bend Goal' Transform.")] [Range(0f, 1f)] public float bendGoalWeight; [Tooltip("Angular offset of knee bending direction.")] [Range(-180f, 180f)] public float swivelOffset; [Tooltip("If 0, the bend plane will be locked to the rotation of the pelvis and rotating the foot will have no effect on the knee direction. If 1, to the target rotation of the leg so that the knee will bend towards the forward axis of the foot. Values in between will be slerped between the two.")] [Range(0f, 1f)] public float bendToTargetWeight = 0.5f; [Tooltip("Use this to make the leg shorter/longer. Works by displacement of foot and calf localPosition.")] [Range(0.01f, 2f)] public float legLengthMlp = 1f; [Tooltip("Evaluates stretching of the leg by target distance relative to leg length. Value at time 1 represents stretching amount at the point where distance to the target is equal to leg length. Value at time 1 represents stretching amount at the point where distance to the target is double the leg length. Value represents the amount of stretching. Linear stretching would be achieved with a linear curve going up by 45 degrees. Increase the range of stretching by moving the last key up and right at the same amount. Smoothing in the curve can help reduce knee snapping (start stretching the arm slightly before target distance reaches leg length). To get a good optimal value for this curve, please go to the 'VRIK (Basic)' demo scene and copy the stretch curve over from the Pilot character.")] public AnimationCurve stretchCurve = new AnimationCurve(); [NonSerialized] [HideInInspector] public Vector3 IKPosition; [NonSerialized] [HideInInspector] public Quaternion IKRotation = Quaternion.identity; [NonSerialized] [HideInInspector] public Vector3 footPositionOffset; [NonSerialized] [HideInInspector] public Vector3 heelPositionOffset; [NonSerialized] [HideInInspector] public Quaternion footRotationOffset = Quaternion.identity; [NonSerialized] [HideInInspector] public float currentMag; [HideInInspector] public bool useAnimatedBendNormal; private Vector3 footPosition; private Quaternion footRotation = Quaternion.identity; private Vector3 bendNormal; private Quaternion calfRelToThigh = Quaternion.identity; private Quaternion thighRelToFoot = Quaternion.identity; private Vector3 bendNormalRelToPelvis; private Vector3 bendNormalRelToTarget; public Vector3 position { get; private set; } public Quaternion rotation { get; private set; } public bool hasToes { get; private set; } public VirtualBone thigh => bones[0]; private VirtualBone calf => bones[1]; private VirtualBone foot => bones[2]; private VirtualBone toes => bones[3]; public VirtualBone lastBone => bones[bones.Length - 1]; public Vector3 thighRelativeToPelvis { get; private set; } protected override void OnRead(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs, int rootIndex, int index) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) Vector3 val = positions[index]; Quaternion val2 = rotations[index]; Vector3 val3 = positions[index + 1]; Quaternion val4 = rotations[index + 1]; Vector3 val5 = positions[index + 2]; Quaternion iKRotation = rotations[index + 2]; Vector3 iKPosition = positions[index + 3]; Quaternion iKRotation2 = rotations[index + 3]; if (!initiated) { this.hasToes = hasToes; bones = new VirtualBone[(!hasToes) ? 3 : 4]; if (hasToes) { bones[0] = new VirtualBone(val, val2); bones[1] = new VirtualBone(val3, val4); bones[2] = new VirtualBone(val5, iKRotation); bones[3] = new VirtualBone(iKPosition, iKRotation2); IKPosition = iKPosition; IKRotation = iKRotation2; } else { bones[0] = new VirtualBone(val, val2); bones[1] = new VirtualBone(val3, val4); bones[2] = new VirtualBone(val5, iKRotation); IKPosition = val5; IKRotation = iKRotation; } bendNormal = Vector3.Cross(val3 - val, val5 - val3); bendNormalRelToPelvis = Quaternion.Inverse(rootRotation) * bendNormal; bendNormalRelToTarget = Quaternion.Inverse(IKRotation) * bendNormal; rotation = IKRotation; } if (hasToes) { bones[0].Read(val, val2); bones[1].Read(val3, val4); bones[2].Read(val5, iKRotation); bones[3].Read(iKPosition, iKRotation2); } else { bones[0].Read(val, val2); bones[1].Read(val3, val4); bones[2].Read(val5, iKRotation); } } public override void PreSolve() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)null) { IKPosition = target.position; IKRotation = target.rotation; } footPosition = foot.solverPosition; footRotation = foot.solverRotation; position = lastBone.solverPosition; rotation = lastBone.solverRotation; if (rotationWeight > 0f) { ApplyRotationOffset(QuaTools.FromToRotation(rotation, IKRotation), rotationWeight); } if (positionWeight > 0f) { ApplyPositionOffset(IKPosition - position, positionWeight); } thighRelativeToPelvis = Quaternion.Inverse(rootRotation) * (thigh.solverPosition - rootPosition); calfRelToThigh = Quaternion.Inverse(thigh.solverRotation) * calf.solverRotation; thighRelToFoot = Quaternion.Inverse(lastBone.solverRotation) * thigh.solverRotation; if (useAnimatedBendNormal) { bendNormal = Vector3.Cross(calf.solverPosition - thigh.solverPosition, foot.solverPosition - calf.solverPosition); } else if (bendToTargetWeight <= 0f) { bendNormal = rootRotation * bendNormalRelToPelvis; } else if (bendToTargetWeight >= 1f) { bendNormal = rotation * bendNormalRelToTarget; } else { bendNormal = Vector3.Slerp(rootRotation * bendNormalRelToPelvis, rotation * bendNormalRelToTarget, bendToTargetWeight); } bendNormal = ((Vector3)(ref bendNormal)).normalized; } public override void ApplyOffsets(float scale) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) ApplyPositionOffset(footPositionOffset, 1f); ApplyRotationOffset(footRotationOffset, 1f); Quaternion val = Quaternion.FromToRotation(footPosition - position, footPosition + heelPositionOffset - position); footPosition = position + val * (footPosition - position); footRotation = val * footRotation; float num = 0f; if ((Object)(object)bendGoal != (Object)null && bendGoalWeight > 0f) { Vector3 val2 = Vector3.Cross(bendGoal.position - thigh.solverPosition, position - thigh.solverPosition); Quaternion val3 = Quaternion.LookRotation(bendNormal, thigh.solverPosition - foot.solverPosition); Vector3 val4 = Quaternion.Inverse(val3) * val2; num = Mathf.Atan2(val4.x, val4.z) * 57.29578f * bendGoalWeight; } float num2 = swivelOffset + num; if (num2 != 0f) { bendNormal = Quaternion.AngleAxis(num2, thigh.solverPosition - lastBone.solverPosition) * bendNormal; thigh.solverRotation = Quaternion.AngleAxis(0f - num2, thigh.solverRotation * thigh.axis) * thigh.solverRotation; } } private void ApplyPositionOffset(Vector3 offset, float weight) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { offset *= weight; footPosition += offset; position += offset; } } private void ApplyRotationOffset(Quaternion offset, float weight) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { if (weight < 1f) { offset = Quaternion.Lerp(Quaternion.identity, offset, weight); } footRotation = offset * footRotation; rotation = offset * rotation; bendNormal = offset * bendNormal; footPosition = position + offset * (footPosition - position); } } public void Solve(bool stretch) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) if (stretch && LOD < 1) { Stretching(); } VirtualBone.SolveTrigonometric(bones, 0, 1, 2, footPosition, bendNormal, 1f); RotateTo(foot, footRotation); if (!hasToes) { FixTwistRotations(); return; } Vector3 val = Vector3.Cross(foot.solverPosition - thigh.solverPosition, toes.solverPosition - foot.solverPosition); Vector3 normalized = ((Vector3)(ref val)).normalized; VirtualBone.SolveTrigonometric(bones, 0, 2, 3, position, normalized, 1f); FixTwistRotations(); toes.solverRotation = rotation; } private void FixTwistRotations() { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (LOD >= 1) { return; } if (bendToTargetWeight > 0f) { Quaternion val = rotation * thighRelToFoot; Quaternion val2 = Quaternion.FromToRotation(val * thigh.axis, calf.solverPosition - thigh.solverPosition); if (bendToTargetWeight < 1f) { thigh.solverRotation = Quaternion.Slerp(thigh.solverRotation, val2 * val, bendToTargetWeight); } else { thigh.solverRotation = val2 * val; } } Quaternion val3 = thigh.solverRotation * calfRelToThigh; Quaternion val4 = Quaternion.FromToRotation(val3 * calf.axis, foot.solverPosition - calf.solverPosition); calf.solverRotation = val4 * val3; } private void Stretching() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) float num = thigh.length + calf.length; Vector3 zero = Vector3.zero; Vector3 zero2 = Vector3.zero; if (legLengthMlp != 1f) { num *= legLengthMlp; zero = (calf.solverPosition - thigh.solverPosition) * (legLengthMlp - 1f) * positionWeight; zero2 = (foot.solverPosition - calf.solverPosition) * (legLengthMlp - 1f) * positionWeight; VirtualBone virtualBone = calf; virtualBone.solverPosition += zero; VirtualBone virtualBone2 = foot; virtualBone2.solverPosition += zero + zero2; if (hasToes) { VirtualBone virtualBone3 = toes; virtualBone3.solverPosition += zero + zero2; } } float num2 = Vector3.Distance(thigh.solverPosition, footPosition); float num3 = num2 / num; float num4 = stretchCurve.Evaluate(num3) * positionWeight; zero = (calf.solverPosition - thigh.solverPosition) * num4; zero2 = (foot.solverPosition - calf.solverPosition) * num4; VirtualBone virtualBone4 = calf; virtualBone4.solverPosition += zero; VirtualBone virtualBone5 = foot; virtualBone5.solverPosition += zero + zero2; if (hasToes) { VirtualBone virtualBone6 = toes; virtualBone6.solverPosition += zero + zero2; } } public override void Write(ref Vector3[] solvedPositions, ref Quaternion[] solvedRotations) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) ref Quaternion reference = ref solvedRotations[index]; reference = thigh.solverRotation; ref Quaternion reference2 = ref solvedRotations[index + 1]; reference2 = calf.solverRotation; ref Quaternion reference3 = ref solvedRotations[index + 2]; reference3 = foot.solverRotation; ref Vector3 reference4 = ref solvedPositions[index]; reference4 = thigh.solverPosition; ref Vector3 reference5 = ref solvedPositions[index + 1]; reference5 = calf.solverPosition; ref Vector3 reference6 = ref solvedPositions[index + 2]; reference6 = foot.solverPosition; if (hasToes) { ref Quaternion reference7 = ref solvedRotations[index + 3]; reference7 = toes.solverRotation; ref Vector3 reference8 = ref solvedPositions[index + 3]; reference8 = toes.solverPosition; } } public override void ResetOffsets() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) footPositionOffset = Vector3.zero; footRotationOffset = Quaternion.identity; heelPositionOffset = Vector3.zero; } } [Serializable] public class Locomotion { [Tooltip("Used for blending in/out of procedural locomotion.")] [Range(0f, 1f)] public float weight = 1f; [Tooltip("Tries to maintain this distance between the legs.")] public float footDistance = 0.3f; [Tooltip("Makes a step only if step target position is at least this far from the current footstep or the foot does not reach the current footstep anymore or footstep angle is past the 'Angle Threshold'.")] public float stepThreshold = 0.4f; [Tooltip("Makes a step only if step target position is at least 'Step Threshold' far from the current footstep or the foot does not reach the current footstep anymore or footstep angle is past this value.")] public float angleThreshold = 60f; [Tooltip("Multiplies angle of the center of mass - center of pressure vector. Larger value makes the character step sooner if losing balance.")] public float comAngleMlp = 1f; [Tooltip("Maximum magnitude of head/hand target velocity used in prediction.")] public float maxVelocity = 0.4f; [Tooltip("The amount of head/hand target velocity prediction.")] public float velocityFactor = 0.4f; [Tooltip("How much can a leg be extended before it is forced to step to another position? 1 means fully stretched.")] [Range(0.9f, 1f)] public float maxLegStretch = 1f; [Tooltip("The speed of lerping the root of the character towards the horizontal mid-point of the footsteps.")] public float rootSpeed = 20f; [Tooltip("The speed of moving a foot to the next position.")] public float stepSpeed = 3f; [Tooltip("The height of the foot by normalized step progress (0 - 1).")] public AnimationCurve stepHeight; [Tooltip("Reduce this value if locomotion makes the head bob too much.")] public float maxBodyYOffset = 0.05f; [Tooltip("The height offset of the heel by normalized step progress (0 - 1).")] public AnimationCurve heelHeight; [Tooltip("Rotates the foot while the leg is not stepping to relax the twist rotation of the leg if ideal rotation is past this angle.")] [Range(0f, 180f)] public float relaxLegTwistMinAngle = 20f; [Tooltip("The speed of rotating the foot while the leg is not stepping to relax the twist rotation of the leg.")] public float relaxLegTwistSpeed = 400f; [Tooltip("Interpolation mode of the step.")] public InterpolationMode stepInterpolation = InterpolationMode.InOutSine; [Tooltip("Offset for the approximated center of mass.")] public Vector3 offset; [HideInInspector] public bool blockingEnabled; [HideInInspector] public LayerMask blockingLayers; [HideInInspector] public float raycastRadius = 0.2f; [HideInInspector] public float raycastHeight = 0.2f; [Tooltip("Called when the left foot has finished a step.")] public UnityEvent onLeftFootstep = new UnityEvent(); [Tooltip("Called when the right foot has finished a step")] public UnityEvent onRightFootstep = new UnityEvent(); private Footstep[] footsteps = new Footstep[0]; private Vector3 lastComPosition; private Vector3 comVelocity; private int leftFootIndex; private int rightFootIndex; public Vector3 centerOfMass { get; private set; } public Vector3 leftFootstepPosition => footsteps[0].position; public Vector3 rightFootstepPosition => footsteps[1].position; public Quaternion leftFootstepRotation => footsteps[0].rotation; public Quaternion rightFootstepRotation => footsteps[1].rotation; public void Initiate(Vector3[] positions, Quaternion[] rotations, bool hasToes, float scale) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) leftFootIndex = ((!hasToes) ? 16 : 17); rightFootIndex = ((!hasToes) ? 20 : 21); footsteps = new Footstep[2] { new Footstep(rotations[0], positions[leftFootIndex], rotations[leftFootIndex], footDistance * scale * Vector3.left), new Footstep(rotations[0], positions[rightFootIndex], rotations[rightFootIndex], footDistance * scale * Vector3.right) }; } public void Reset(Vector3[] positions, Quaternion[] rotations) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) lastComPosition = Vector3.Lerp(positions[1], positions[5], 0.25f) + rotations[0] * offset; comVelocity = Vector3.zero; footsteps[0].Reset(rotations[0], positions[leftFootIndex], rotations[leftFootIndex]); footsteps[1].Reset(rotations[0], positions[rightFootIndex], rotations[rightFootIndex]); } public void Relax() { footsteps[0].relaxFlag = true; footsteps[1].relaxFlag = true; } public void AddDeltaRotation(Quaternion delta, Vector3 pivot) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) Vector3 val = lastComPosition - pivot; lastComPosition = pivot + delta * val; Footstep[] array = footsteps; foreach (Footstep footstep in array) { footstep.rotation = delta * footstep.rotation; footstep.stepFromRot = delta * footstep.stepFromRot; footstep.stepToRot = delta * footstep.stepToRot; footstep.stepToRootRot = delta * footstep.stepToRootRot; Vector3 val2 = footstep.position - pivot; footstep.position = pivot + delta * val2; Vector3 val3 = footstep.stepFrom - pivot; footstep.stepFrom = pivot + delta * val3; Vector3 val4 = footstep.stepTo - pivot; footstep.stepTo = pivot + delta * val4; } } public void AddDeltaPosition(Vector3 delta) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) lastComPosition += delta; Footstep[] array = footsteps; foreach (Footstep footstep in array) { footstep.position += delta; footstep.stepFrom += delta; footstep.stepTo += delta; } } public void Solve(VirtualBone rootBone, Spine spine, Leg leftLeg, Leg rightLeg, Arm leftArm, Arm rightArm, int supportLegIndex, out Vector3 leftFootPosition, out Vector3 rightFootPosition, out Quaternion leftFootRotation, out Quaternion rightFootRotation, out float leftFootOffset, out float rightFootOffset, out float leftHeelOffset, out float rightHeelOffset, float scale) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_079a: Unknown result type (might be due to invalid IL or missing references) //IL_079f: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Unknown result type (might be due to invalid IL or missing references) //IL_07b3: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07c7: Unknown result type (might be due to invalid IL or missing references) //IL_07cc: Unknown result type (might be due to invalid IL or missing references) //IL_07cd: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07e7: Unknown result type (might be due to invalid IL or missing references) //IL_07ec: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_0879: Unknown result type (might be due to invalid IL or missing references) //IL_087e: Unknown result type (might be due to invalid IL or missing references) //IL_088d: Unknown result type (might be due to invalid IL or missing references) //IL_0892: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_06fa: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_070b: Unknown result type (might be due to invalid IL or missing references) //IL_0710: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_071a: Unknown result type (might be due to invalid IL or missing references) //IL_074a: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04e2: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { leftFootPosition = Vector3.zero; rightFootPosition = Vector3.zero; leftFootRotation = Quaternion.identity; rightFootRotation = Quaternion.identity; leftFootOffset = 0f; rightFootOffset = 0f; leftHeelOffset = 0f; rightHeelOffset = 0f; return; } Vector3 val = rootBone.solverRotation * Vector3.up; Vector3 val2 = spine.pelvis.solverPosition + spine.pelvis.solverRotation * leftLeg.thighRelativeToPelvis; Vector3 val3 = spine.pelvis.solverPosition + spine.pelvis.solverRotation * rightLeg.thighRelativeToPelvis; footsteps[0].characterSpaceOffset = footDistance * Vector3.left * scale; footsteps[1].characterSpaceOffset = footDistance * Vector3.right * scale; Vector3 faceDirection = spine.faceDirection; Vector3 val4 = V3Tools.ExtractVertical(faceDirection, val, 1f); faceDirection -= val4; Quaternion val5 = Quaternion.LookRotation(faceDirection, val); if (spine.rootHeadingOffset != 0f) { val5 = Quaternion.AngleAxis(spine.rootHeadingOffset, val) * val5; } float num = 1f; float num2 = 1f; float num3 = 0.2f; float num4 = num + num2 + 2f * num3; centerOfMass = Vector3.zero; centerOfMass += spine.pelvis.solverPosition * num; centerOfMass += spine.head.solverPosition * num2; centerOfMass += leftArm.position * num3; centerOfMass += rightArm.position * num3; centerOfMass /= num4; centerOfMass += rootBone.solverRotation * offset; comVelocity = ((!(Time.deltaTime > 0f)) ? Vector3.zero : ((centerOfMass - lastComPosition) / Time.deltaTime)); lastComPosition = centerOfMass; comVelocity = Vector3.ClampMagnitude(comVelocity, maxVelocity) * velocityFactor * scale; Vector3 val6 = centerOfMass + comVelocity; Vector3 val7 = V3Tools.PointToPlane(spine.pelvis.solverPosition, rootBone.solverPosition, val); Vector3 val8 = V3Tools.PointToPlane(val6, rootBone.solverPosition, val); Vector3 val9 = Vector3.Lerp(footsteps[0].position, footsteps[1].position, 0.5f); Vector3 val10 = val6 - val9; float num5 = Vector3.Angle(val10, rootBone.solverRotation * Vector3.up) * comAngleMlp; for (int i = 0; i < footsteps.Length; i++) { footsteps[i].isSupportLeg = supportLegIndex == i; } for (int j = 0; j < footsteps.Length; j++) { if (footsteps[j].isStepping) { Vector3 val11 = val8 + rootBone.solverRotation * footsteps[j].characterSpaceOffset; if (!StepBlocked(footsteps[j].stepFrom, val11, rootBone.solverPosition)) { footsteps[j].UpdateStepping(val11, val5, 10f); } } else { footsteps[j].UpdateStanding(val5, relaxLegTwistMinAngle, relaxLegTwistSpeed); } } if (CanStep()) { int num6 = -1; float num7 = float.NegativeInfinity; for (int k = 0; k < footsteps.Length; k++) { if (footsteps[k].isStepping) { continue; } Vector3 val12 = val8 + rootBone.solverRotation * footsteps[k].characterSpaceOffset; float num8 = ((k != 0) ? rightLeg.mag : leftLeg.mag); Vector3 val13 = ((k != 0) ? val3 : val2); float num9 = Vector3.Distance(footsteps[k].position, val13); bool flag = false; if (num9 >= num8 * maxLegStretch) { val12 = val7 + rootBone.solverRotation * footsteps[k].characterSpaceOffset; flag = true; } bool flag2 = false; for (int l = 0; l < footsteps.Length; l++) { if (l == k || flag) { continue; } if (Vector3.Distance(footsteps[k].position, footsteps[l].position) < 0.25f * scale) { Vector3 val14 = footsteps[k].position - val12; float sqrMagnitude = ((Vector3)(ref val14)).sqrMagnitude; Vector3 val15 = footsteps[l].position - val12; if (sqrMagnitude < ((Vector3)(ref val15)).sqrMagnitude) { goto IL_05b7; } } flag2 = GetLineSphereCollision(footsteps[k].position, val12, footsteps[l].position, 0.25f * scale); goto IL_05b7; IL_05b7: if (flag2) { break; } } float num10 = Quaternion.Angle(val5, footsteps[k].stepToRootRot); if (flag2 && !(num10 > angleThreshold)) { continue; } float num11 = Vector3.Distance(footsteps[k].position, val12); float num12 = stepThreshold * scale; if (footsteps[k].relaxFlag) { num12 = 0f; } float num13 = Mathf.Lerp(num12, num12 * 0.1f, num5 * 0.015f); if (flag) { num13 *= 0.5f; } if (k == 0) { num13 *= 0.9f; } if (!StepBlocked(footsteps[k].position, val12, rootBone.solverPosition) && (num11 > num13 || num10 > angleThreshold)) { float num14 = 0f; num14 -= num11; if (num14 > num7) { num6 = k; num7 = num14; } } } if (num6 != -1) { Vector3 p = val8 + rootBone.solverRotation * footsteps[num6].characterSpaceOffset; footsteps[num6].stepSpeed = Random.Range(stepSpeed, stepSpeed * 1.5f); footsteps[num6].StepTo(p, val5, stepThreshold * scale); } } footsteps[0].Update(stepInterpolation, onLeftFootstep); footsteps[1].Update(stepInterpolation, onRightFootstep); leftFootPosition = footsteps[0].position; rightFootPosition = footsteps[1].position; leftFootPosition = V3Tools.PointToPlane(leftFootPosition, leftLeg.lastBone.readPosition, val); rightFootPosition = V3Tools.PointToPlane(rightFootPosition, rightLeg.lastBone.readPosition, val); leftFootOffset = stepHeight.Evaluate(footsteps[0].stepProgress) * scale; rightFootOffset = stepHeight.Evaluate(footsteps[1].stepProgress) * scale; leftHeelOffset = heelHeight.Evaluate(footsteps[0].stepProgress) * scale; rightHeelOffset = heelHeight.Evaluate(footsteps[1].stepProgress) * scale; leftFootRotation = footsteps[0].rotation; rightFootRotation = footsteps[1].rotation; } private bool StepBlocked(Vector3 fromPosition, Vector3 toPosition, Vector3 rootPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (LayerMask.op_Implicit(blockingLayers) == -1 || !blockingEnabled) { return false; } Vector3 val = fromPosition; val.y = rootPosition.y + raycastHeight + raycastRadius; Vector3 val2 = toPosition - val; val2.y = 0f; RaycastHit val3 = default(RaycastHit); if (raycastRadius <= 0f) { return Physics.Raycast(val, val2, ref val3, ((Vector3)(ref val2)).magnitude, LayerMask.op_Implicit(blockingLayers)); } return Physics.SphereCast(val, raycastRadius, val2, ref val3, ((Vector3)(ref val2)).magnitude, LayerMask.op_Implicit(blockingLayers)); } private bool CanStep() { Footstep[] array = footsteps; foreach (Footstep footstep in array) { if (footstep.isStepping && footstep.stepProgress < 0.8f) { return false; } } return true; } private static bool GetLineSphereCollision(Vector3 lineStart, Vector3 lineEnd, Vector3 sphereCenter, float sphereRadius) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Vector3 val = lineEnd - lineStart; Vector3 val2 = sphereCenter - lineStart; float magnitude = ((Vector3)(ref val2)).magnitude; float num = magnitude - sphereRadius; if (num > ((Vector3)(ref val)).magnitude) { return false; } Quaternion val3 = Quaternion.LookRotation(val, val2); Vector3 val4 = Quaternion.Inverse(val3) * val2; if (val4.z < 0f) { return num < 0f; } return val4.y - sphereRadius < 0f; } } [Serializable] public class Spine : BodyPart { [Tooltip("The head target. This should not be the camera Transform itself, but a child GameObject parented to it so you could adjust it's position/rotation to match the orientation of the head bone. The best practice for setup would be to move the camera to the avatar's eyes, duplicate the avatar's head bone and parent it to the camera. Then assign the duplicate to this slot.")] public Transform headTarget; [Tooltip("The pelvis target (optional), useful for seated rigs or if you had an additional tracker on the backpack or belt are. The best practice for setup would be to duplicate the avatar's pelvis bone and parenting it to the pelvis tracker. Then assign the duplicate to this slot.")] public Transform pelvisTarget; [Tooltip("Positional weight of the head target. Note that if you have nulled the headTarget, the head will still be pulled to the last position of the headTarget until you set this value to 0.")] [Range(0f, 1f)] public float positionWeight = 1f; [Tooltip("Rotational weight of the head target. Note that if you have nulled the headTarget, the head will still be rotated to the last rotation of the headTarget until you set this value to 0.")] [Range(0f, 1f)] public float rotationWeight = 1f; [Tooltip("Positional weight of the pelvis target. Note that if you have nulled the pelvisTarget, the pelvis will still be pulled to the last position of the pelvisTarget until you set this value to 0.")] [Range(0f, 1f)] public float pelvisPositionWeight; [Tooltip("Rotational weight of the pelvis target. Note that if you have nulled the pelvisTarget, the pelvis will still be rotated to the last rotation of the pelvisTarget until you set this value to 0.")] [Range(0f, 1f)] public float pelvisRotationWeight; [Tooltip("If 'Chest Goal Weight' is greater than 0, the chest will be turned towards this Transform.")] public Transform chestGoal; [Tooltip("Weight of turning the chest towards the 'Chest Goal'.")] [Range(0f, 1f)] public float chestGoalWeight; [Tooltip("Minimum height of the head from the root of the character.")] public float minHeadHeight = 0.8f; [Tooltip("Determines how much the body will follow the position of the head.")] [Range(0f, 1f)] public float bodyPosStiffness = 0.55f; [Tooltip("Determines how much the body will follow the rotation of the head.")] [Range(0f, 1f)] public float bodyRotStiffness = 0.1f; [Tooltip("Determines how much the chest will rotate to the rotation of the head.")] [FormerlySerializedAs("chestRotationWeight")] [Range(0f, 1f)] public float neckStiffness = 0.2f; [Tooltip("The amount of rotation applied to the chest based on hand positions.")] [Range(0f, 1f)] public float rotateChestByHands = 1f; [Tooltip("Clamps chest rotation. Value of 0.5 allows 90 degrees of rotation for the chest relative to the head. Value of 0 allows 180 degrees and value of 1 means the chest will be locked relative to the head.")] [Range(0f, 1f)] public float chestClampWeight = 0.5f; [Tooltip("Clamps head rotation. Value of 0.5 allows 90 degrees of rotation for the head relative to the headTarget. Value of 0 allows 180 degrees and value of 1 means head rotation will be locked to the target.")] [Range(0f, 1f)] public float headClampWeight = 0.6f; [Tooltip("Moves the body horizontally along -character.forward axis by that value when the player is crouching.")] public float moveBodyBackWhenCrouching = 0.5f; [Tooltip("How much will the pelvis maintain it's animated position?")] [Range(0f, 1f)] public float maintainPelvisPosition = 0.2f; [Tooltip("Will automatically rotate the root of the character if the head target has turned past this angle.")] [Range(0f, 180f)] public float maxRootAngle = 25f; [Tooltip("Angular offset for root heading. Adjust this value to turn the root relative to the HMD around the vertical axis. Usefulf for fighting or shooting games where you would sometimes want the avatar to stand at an angled stance.")] [Range(-180f, 180f)] public float rootHeadingOffset; [NonSerialized] [HideInInspector] public Vector3 IKPositionHead; [NonSerialized] [HideInInspector] public Quaternion IKRotationHead = Quaternion.identity; [NonSerialized] [HideInInspector] public Vector3 IKPositionPelvis; [NonSerialized] [HideInInspector] public Quaternion IKRotationPelvis = Quaternion.identity; [NonSerialized] [HideInInspector] public Vector3 goalPositionChest; [NonSerialized] [HideInInspector] public Vector3 pelvisPositionOffset; [NonSerialized] [HideInInspector] public Vector3 chestPositionOffset; [NonSerialized] [HideInInspector] public Vector3 headPositionOffset; [NonSerialized] [HideInInspector] public Quaternion pelvisRotationOffset = Quaternion.identity; [NonSerialized] [HideInInspector] public Quaternion chestRotationOffset = Quaternion.identity; [NonSerialized] [HideInInspector] public Quaternion headRotationOffset = Quaternion.identity; [NonSerialized] [HideInInspector] public Vector3 faceDirection; [NonSerialized] [HideInInspector] public Vector3 locomotionHeadPositionOffset; [NonSerialized] [HideInInspector] public Vector3 headPosition; private Quaternion headRotation = Quaternion.identity; private Quaternion pelvisRotation = Quaternion.identity; private Quaternion anchorRelativeToPelvis = Quaternion.identity; private Quaternion pelvisRelativeRotation = Quaternion.identity; private Quaternion chestRelativeRotation = Quaternion.identity; private Vector3 headDeltaPosition; private Quaternion pelvisDeltaRotation = Quaternion.identity; private Quaternion chestTargetRotation = Quaternion.identity; private int pelvisIndex = 0; private int spineIndex = 1; private int chestIndex = -1; private int neckIndex = -1; private int headIndex = -1; private float length; private bool hasChest; private bool hasNeck; private bool hasLegs; public float headHeight; private float sizeMlp; private Vector3 chestForward; public VirtualBone pelvis => bones[pelvisIndex]; public VirtualBone firstSpineBone => bones[spineIndex]; public VirtualBone chest { get { if (hasChest) { return bones[chestIndex]; } return bones[spineIndex]; } } private VirtualBone neck => bones[neckIndex]; public VirtualBone head => bones[headIndex]; public Quaternion anchorRotation { get; private set; } public Quaternion anchorRelativeToHead { get; private set; } protected override void OnRead(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs, int rootIndex, int index) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) Vector3 val = positions[index]; Quaternion val2 = rotations[index]; Vector3 val3 = positions[index + 1]; Quaternion val4 = rotations[index + 1]; Vector3 val5 = positions[index + 2]; Quaternion val6 = rotations[index + 2]; Vector3 position = positions[index + 3]; Quaternion rotation = rotations[index + 3]; Vector3 val7 = positions[index + 4]; Quaternion val8 = rotations[index + 4]; this.hasLegs = hasLegs; if (!hasChest) { val5 = val3; val6 = val4; } if (!initiated) { this.hasChest = hasChest; this.hasNeck = hasNeck; Vector3 val9 = V3Tools.ExtractVertical(val7 - positions[0], rotations[0] * Vector3.up, 1f); headHeight = ((Vector3)(ref val9)).magnitude; int num = 3; if (hasChest) { num++; } if (hasNeck) { num++; } bones = new VirtualBone[num]; chestIndex = ((!hasChest) ? 1 : 2); neckIndex = 1; if (hasChest) { neckIndex++; } if (hasNeck) { neckIndex++; } headIndex = 2; if (hasChest) { headIndex++; } if (hasNeck) { headIndex++; } bones[0] = new VirtualBone(val, val2); bones[1] = new VirtualBone(val3, val4); if (hasChest) { bones[chestIndex] = new VirtualBone(val5, val6); } if (hasNeck) { bones[neckIndex] = new VirtualBone(position, rotation); } bones[headIndex] = new VirtualBone(val7, val8); pelvisRotationOffset = Quaternion.identity; chestRotationOffset = Quaternion.identity; headRotationOffset = Quaternion.identity; anchorRelativeToHead = Quaternion.Inverse(val8) * rotations[0]; anchorRelativeToPelvis = Quaternion.Inverse(val2) * rotations[0]; faceDirection = rotations[0] * Vector3.forward; IKPositionHead = val7; IKRotationHead = val8; IKPositionPelvis = val; IKRotationPelvis = val2; goalPositionChest = val5 + rotations[0] * Vector3.forward; } pelvisRelativeRotation = Quaternion.Inverse(val8) * val2; chestRelativeRotation = Quaternion.Inverse(val8) * val6; chestForward = Quaternion.Inverse(val6) * (rotations[0] * Vector3.forward); bones[0].Read(val, val2); bones[1].Read(val3, val4); if (hasChest) { bones[chestIndex].Read(val5, val6); } if (hasNeck) { bones[neckIndex].Read(position, rotation); } bones[headIndex].Read(val7, val8); float num2 = Vector3.Distance(val, val7); sizeMlp = num2 / 0.7f; } public override void PreSolve() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)headTarget != (Object)null) { IKPositionHead = headTarget.position; IKRotationHead = headTarget.rotation; } if ((Object)(object)chestGoal != (Object)null) { goalPositionChest = chestGoal.position; } if ((Object)(object)pelvisTarget != (Object)null) { IKPositionPelvis = pelvisTarget.position; IKRotationPelvis = pelvisTarget.rotation; } headPosition = V3Tools.Lerp(head.solverPosition, IKPositionHead, positionWeight); headRotation = QuaTools.Lerp(head.solverRotation, IKRotationHead, rotationWeight); pelvisRotation = QuaTools.Lerp(pelvis.solverRotation, IKRotationPelvis, rotationWeight); } public override void ApplyOffsets(float scale) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) headPosition += headPositionOffset; float num = minHeadHeight * scale; Vector3 val = rootRotation * Vector3.up; if (val == Vector3.up) { headPosition.y = Math.Max(rootPosition.y + num, headPosition.y); } else { Vector3 val2 = headPosition - rootPosition; Vector3 val3 = V3Tools.ExtractHorizontal(val2, val, 1f); Vector3 val4 = val2 - val3; float num2 = Vector3.Dot(val4, val); if (num2 > 0f) { if (((Vector3)(ref val4)).magnitude < num) { val4 = ((Vector3)(ref val4)).normalized * num; } } else { val4 = -((Vector3)(ref val4)).normalized * num; } headPosition = rootPosition + val3 + val4; } headRotation = headRotationOffset * headRotation; headDeltaPosition = headPosition - head.solverPosition; pelvisDeltaRotation = QuaTools.FromToRotation(pelvis.solverRotation, headRotation * pelvisRelativeRotation); if (pelvisRotationWeight <= 0f) { anchorRotation = headRotation * anchorRelativeToHead; } else if (pelvisRotationWeight > 0f && pelvisRotationWeight < 1f) { anchorRotation = Quaternion.Lerp(headRotation * anchorRelativeToHead, pelvisRotation * anchorRelativeToPelvis, pelvisRotationWeight); } else if (pelvisRotationWeight >= 1f) { anchorRotation = pelvisRotation * anchorRelativeToPelvis; } } private void CalculateChestTargetRotation(VirtualBone rootBone, Arm[] arms) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) chestTargetRotation = headRotation * chestRelativeRotation; AdjustChestByHands(ref chestTargetRotation, arms); faceDirection = Vector3.Cross(anchorRotation * Vector3.right, rootBone.readRotation * Vector3.up) + anchorRotation * Vector3.forward; } public void Solve(VirtualBone rootBone, Leg[] legs, Arm[] arms, float scale) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) CalculateChestTargetRotation(rootBone, arms); if (maxRootAngle < 180f) { Vector3 val = faceDirection; if (rootHeadingOffset != 0f) { val = Quaternion.AngleAxis(rootHeadingOffset, Vector3.up) * val; } Vector3 val2 = Quaternion.Inverse(rootBone.solverRotation) * val; float num = Mathf.Atan2(val2.x, val2.z) * 57.29578f; float num2 = 0f; float num3 = maxRootAngle; if (num > num3) { num2 = num - num3; } if (num < 0f - num3) { num2 = num + num3; } rootBone.solverRotation = Quaternion.AngleAxis(num2, rootBone.readRotation * Vector3.up) * rootBone.solverRotation; } Vector3 solverPosition = pelvis.solverPosition; Vector3 rootUp = rootBone.solverRotation * Vector3.up; TranslatePelvis(legs, headDeltaPosition, pelvisDeltaRotation, scale); FABRIKPass(solverPosition, rootUp, positionWeight); Bend(bones, pelvisIndex, chestIndex, chestTargetRotation, chestRotationOffset, chestClampWeight, uniformWeight: false, neckStiffness * rotationWeight); if (LOD < 1 && chestGoalWeight > 0f) { Quaternion targetRotation = Quaternion.FromToRotation(bones[chestIndex].solverRotation * chestForward, goalPositionChest - bones[chestIndex].solverPosition) * bones[chestIndex].solverRotation; Bend(bones, pelvisIndex, chestIndex, targetRotation, chestRotationOffset, chestClampWeight, uniformWeight: false, chestGoalWeight * rotationWeight); } InverseTranslateToHead(legs, limited: false, useCurrentLegMag: false, Vector3.zero, positionWeight); if (LOD < 1) { FABRIKPass(solverPosition, rootUp, positionWeight); } Bend(bones, neckIndex, headIndex, headRotation, headClampWeight, uniformWeight: true, rotationWeight); SolvePelvis(); } private void FABRIKPass(Vector3 animatedPelvisPos, Vector3 rootUp, float weight) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) Vector3 startPosition = Vector3.Lerp(pelvis.solverPosition, animatedPelvisPos, maintainPelvisPosition) + pelvisPositionOffset; Vector3 targetPosition = headPosition - chestPositionOffset; Vector3 zero = Vector3.zero; float num = Vector3.Distance(bones[0].solverPosition, bones[bones.Length - 1].solverPosition); VirtualBone.SolveFABRIK(bones, startPosition, targetPosition, weight, 1f, 1, num, zero); } private void SolvePelvis() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) if (pelvisPositionWeight > 0f) { Quaternion solverRotation = head.solverRotation; Vector3 val = (IKPositionPelvis + pelvisPositionOffset - pelvis.solverPosition) * pelvisPositionWeight; VirtualBone[] array = bones; foreach (VirtualBone virtualBone in array) { virtualBone.solverPosition += val; } Vector3 bendNormal = anchorRotation * Vector3.right; if (hasChest && hasNeck) { VirtualBone.SolveTrigonometric(bones, spineIndex, chestIndex, headIndex, headPosition, bendNormal, pelvisPositionWeight * 0.9f); VirtualBone.SolveTrigonometric(bones, chestIndex, neckIndex, headIndex, headPosition, bendNormal, pelvisPositionWeight); } else if (hasChest && !hasNeck) { VirtualBone.SolveTrigonometric(bones, spineIndex, chestIndex, headIndex, headPosition, bendNormal, pelvisPositionWeight); } else if (!hasChest && hasNeck) { VirtualBone.SolveTrigonometric(bones, spineIndex, neckIndex, headIndex, headPosition, bendNormal, pelvisPositionWeight); } else if (!hasNeck && !hasChest) { VirtualBone.SolveTrigonometric(bones, pelvisIndex, spineIndex, headIndex, headPosition, bendNormal, pelvisPositionWeight); } head.solverRotation = solverRotation; } } public override void Write(ref Vector3[] solvedPositions, ref Quaternion[] solvedRotations) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) ref Vector3 reference = ref solvedPositions[index]; reference = bones[0].solverPosition; ref Quaternion reference2 = ref solvedRotations[index]; reference2 = bones[0].solverRotation; ref Quaternion reference3 = ref solvedRotations[index + 1]; reference3 = bones[1].solverRotation; if (hasChest) { ref Quaternion reference4 = ref solvedRotations[index + 2]; reference4 = bones[chestIndex].solverRotation; } if (hasNeck) { ref Quaternion reference5 = ref solvedRotations[index + 3]; reference5 = bones[neckIndex].solverRotation; } ref Quaternion reference6 = ref solvedRotations[index + 4]; reference6 = bones[headIndex].solverRotation; } public override void ResetOffsets() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) pelvisPositionOffset = Vector3.zero; chestPositionOffset = Vector3.zero; headPositionOffset = locomotionHeadPositionOffset; pelvisRotationOffset = Quaternion.identity; chestRotationOffset = Quaternion.identity; headRotationOffset = Quaternion.identity; } private void AdjustChestByHands(ref Quaternion chestTargetRotation, Arm[] arms) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) if (LOD <= 0) { Quaternion val = Quaternion.Inverse(anchorRotation); Vector3 val2 = val * (arms[0].position - headPosition) / sizeMlp; Vector3 val3 = val * (arms[1].position - headPosition) / sizeMlp; Vector3 forward = Vector3.forward; forward.x += val2.x * Mathf.Abs(val2.x); forward.x += val2.z * Mathf.Abs(val2.z); forward.x += val3.x * Mathf.Abs(val3.x); forward.x -= val3.z * Mathf.Abs(val3.z); forward.x *= 5f * rotateChestByHands; float num = Mathf.Atan2(forward.x, forward.z) * 57.29578f; Quaternion val4 = Quaternion.AngleAxis(num, rootRotation * Vector3.up); chestTargetRotation = val4 * chestTargetRotation; Vector3 up = Vector3.up; up.x += val2.y; up.x -= val3.y; up.x *= 0.5f * rotateChestByHands; num = Mathf.Atan2(up.x, up.y) * 57.29578f; val4 = Quaternion.AngleAxis(num, rootRotation * Vector3.back); chestTargetRotation = val4 * chestTargetRotation; } } public void InverseTranslateToHead(Leg[] legs, bool limited, bool useCurrentLegMag, Vector3 offset, float w) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (headPosition + offset - head.solverPosition) * w; Vector3 val2 = pelvis.solverPosition + val; MovePosition((!limited) ? val2 : LimitPelvisPosition(legs, val2, useCurrentLegMag)); } private void TranslatePelvis(Leg[] legs, Vector3 deltaPosition, Quaternion deltaRotation, float scale) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) Vector3 solverPosition = head.solverPosition; deltaRotation = QuaTools.ClampRotation(deltaRotation, chestClampWeight, 2); Quaternion val = Quaternion.Slerp(Quaternion.identity, deltaRotation, bodyRotStiffness * rotationWeight); val = Quaternion.Slerp(val, QuaTools.FromToRotation(pelvis.solverRotation, IKRotationPelvis), pelvisRotationWeight); VirtualBone.RotateAroundPoint(bones, 0, pelvis.solverPosition, pelvisRotationOffset * val); deltaPosition -= head.solverPosition - solverPosition; Vector3 val2 = rootRotation * Vector3.forward; Vector3 val3 = V3Tools.ExtractVertical(deltaPosition, rootRotation * Vector3.up, 1f); float num = ((Vector3)(ref val3)).magnitude; if (scale > 0f) { num /= scale; } float num2 = num * (0f - moveBodyBackWhenCrouching) * headHeight; deltaPosition += val2 * num2; MovePosition(LimitPelvisPosition(legs, pelvis.solverPosition + deltaPosition * bodyPosStiffness * positionWeight, useCurrentLegMag: false)); } private Vector3 LimitPelvisPosition(Leg[] legs, Vector3 pelvisPosition, bool useCurrentLegMag, int it = 2) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) if (!hasLegs) { return pelvisPosition; } if (useCurrentLegMag) { foreach (Leg leg in legs) { leg.currentMag = Vector3.Distance(leg.thigh.solverPosition, leg.lastBone.solverPosition); } } for (int j = 0; j < it; j++) { foreach (Leg leg2 in legs) { Vector3 val = pelvisPosition - pelvis.solverPosition; Vector3 val2 = leg2.thigh.solverPosition + val; Vector3 val3 = val2 - leg2.position; float num = ((!useCurrentLegMag) ? leg2.mag : leg2.currentMag); Vector3 val4 = leg2.position + Vector3.ClampMagnitude(val3, num); pelvisPosition += val4 - val2; } } return pelvisPosition; } private void Bend(VirtualBone[] bones, int firstIndex, int lastIndex, Quaternion targetRotation, float clampWeight, bool uniformWeight, float w) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (w <= 0f || bones.Length == 0) { return; } int num = lastIndex + 1 - firstIndex; if (num < 1) { return; } Quaternion rotation = QuaTools.FromToRotation(bones[lastIndex].solverRotation, targetRotation); rotation = QuaTools.ClampRotation(rotation, clampWeight, 2); float num2 = ((!uniformWeight) ? 0f : (1f / (float)num)); for (int i = firstIndex; i < lastIndex + 1; i++) { if (!uniformWeight) { num2 = Mathf.Clamp((float)((i - firstIndex + 1) / num), 0f, 1f); } VirtualBone.RotateAroundPoint(bones, i, bones[i].solverPosition, Quaternion.Slerp(Quaternion.identity, rotation, num2 * w)); } } private void Bend(VirtualBone[] bones, int firstIndex, int lastIndex, Quaternion targetRotation, Quaternion rotationOffset, float clampWeight, bool uniformWeight, float w) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) if (w <= 0f || bones.Length == 0) { return; } int num = lastIndex + 1 - firstIndex; if (num < 1) { return; } Quaternion rotation = QuaTools.FromToRotation(bones[lastIndex].solverRotation, targetRotation); rotation = QuaTools.ClampRotation(rotation, clampWeight, 2); float num2 = ((!uniformWeight) ? 0f : (1f / (float)num)); for (int i = firstIndex; i < lastIndex + 1; i++) { if (!uniformWeight) { if (num == 1) { num2 = 1f; } else if (num == 2) { num2 = ((i != 0) ? 0.8f : 0.2f); } else if (num == 3) { num2 = i switch { 0 => 0.15f, 1 => 0.4f, _ => 0.45f, }; } else if (num > 3) { num2 = 1f / (float)num; } } VirtualBone.RotateAroundPoint(bones, i, bones[i].solverPosition, Quaternion.Slerp(Quaternion.Slerp(Quaternion.identity, rotationOffset, num2), rotation, num2 * w)); } } } [Serializable] public enum PositionOffset { Pelvis, Chest, Head, LeftHand, RightHand, LeftFoot, RightFoot, LeftHeel, RightHeel } [Serializable] public enum RotationOffset { Pelvis, Chest, Head } [Serializable] public class VirtualBone { public Vector3 readPosition; public Quaternion readRotation; public Vector3 solverPosition; public Quaternion solverRotation; public float length; public float sqrMag; public Vector3 axis; public VirtualBone(Vector3 position, Quaternion rotation) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Read(position, rotation); } public void Read(Vector3 position, Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) readPosition = position; readRotation = rotation; solverPosition = position; solverRotation = rotation; } public static void SwingRotation(VirtualBone[] bones, int index, Vector3 swingTarget, float weight = 1f) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { Quaternion val = Quaternion.FromToRotation(bones[index].solverRotation * bones[index].axis, swingTarget - bones[index].solverPosition); if (weight < 1f) { val = Quaternion.Lerp(Quaternion.identity, val, weight); } for (int i = index; i < bones.Length; i++) { bones[i].solverRotation = val * bones[i].solverRotation; } } } public static float PreSolve(ref VirtualBone[] bones) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) float num = 0f; for (int i = 0; i < bones.Length; i++) { if (i < bones.Length - 1) { VirtualBone obj = bones[i]; Vector3 val = bones[i + 1].solverPosition - bones[i].solverPosition; obj.sqrMag = ((Vector3)(ref val)).sqrMagnitude; bones[i].length = Mathf.Sqrt(bones[i].sqrMag); num += bones[i].length; bones[i].axis = Quaternion.Inverse(bones[i].solverRotation) * (bones[i + 1].solverPosition - bones[i].solverPosition); } else { bones[i].sqrMag = 0f; bones[i].length = 0f; } } return num; } public static void RotateAroundPoint(VirtualBone[] bones, int index, Vector3 point, Quaternion rotation) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) for (int i = index; i < bones.Length; i++) { if (bones[i] != null) { Vector3 val = bones[i].solverPosition - point; bones[i].solverPosition = point + rotation * val; bones[i].solverRotation = rotation * bones[i].solverRotation; } } } public static void RotateBy(VirtualBone[] bones, int index, Quaternion rotation) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) for (int i = index; i < bones.Length; i++) { if (bones[i] != null) { Vector3 val = bones[i].solverPosition - bones[index].solverPosition; bones[i].solverPosition = bones[index].solverPosition + rotation * val; bones[i].solverRotation = rotation * bones[i].solverRotation; } } } public static void RotateBy(VirtualBone[] bones, Quaternion rotation) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < bones.Length; i++) { if (bones[i] != null) { if (i > 0) { Vector3 val = bones[i].solverPosition - bones[0].solverPosition; bones[i].solverPosition = bones[0].solverPosition + rotation * val; } bones[i].solverRotation = rotation * bones[i].solverRotation; } } } public static void RotateTo(VirtualBone[] bones, int index, Quaternion rotation) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation2 = QuaTools.FromToRotation(bones[index].solverRotation, rotation); RotateAroundPoint(bones, index, bones[index].solverPosition, rotation2); } public static void SolveTrigonometric(VirtualBone[] bones, int first, int second, int third, Vector3 targetPosition, Vector3 bendNormal, float weight) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } targetPosition = Vector3.Lerp(bones[third].solverPosition, targetPosition, weight); Vector3 val = targetPosition - bones[first].solverPosition; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude != 0f) { float directionMag = Mathf.Sqrt(sqrMagnitude); Vector3 val2 = bones[second].solverPosition - bones[first].solverPosition; float sqrMagnitude2 = ((Vector3)(ref val2)).sqrMagnitude; Vector3 val3 = bones[third].solverPosition - bones[second].solverPosition; float sqrMagnitude3 = ((Vector3)(ref val3)).sqrMagnitude; Vector3 bendDirection = Vector3.Cross(val, bendNormal); Vector3 directionToBendPoint = GetDirectionToBendPoint(val, directionMag, bendDirection, sqrMagnitude2, sqrMagnitude3); Quaternion val4 = Quaternion.FromToRotation(bones[second].solverPosition - bones[first].solverPosition, directionToBendPoint); if (weight < 1f) { val4 = Quaternion.Lerp(Quaternion.identity, val4, weight); } RotateAroundPoint(bones, first, bones[first].solverPosition, val4); Quaternion val5 = Quaternion.FromToRotation(bones[third].solverPosition - bones[second].solverPosition, targetPosition - bones[second].solverPosition); if (weight < 1f) { val5 = Quaternion.Lerp(Quaternion.identity, val5, weight); } RotateAroundPoint(bones, second, bones[second].solverPosition, val5); } } private static Vector3 GetDirectionToBendPoint(Vector3 direction, float directionMag, Vector3 bendDirection, float sqrMag1, float sqrMag2) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) float num = (directionMag * directionMag + (sqrMag1 - sqrMag2)) / 2f / directionMag; float num2 = (float)Math.Sqrt(Mathf.Clamp(sqrMag1 - num * num, 0f, float.PositiveInfinity)); if (direction == Vector3.zero) { return Vector3.zero; } return Quaternion.LookRotation(direction, bendDirection) * new Vector3(0f, num2, num); } public static void SolveFABRIK(VirtualBone[] bones, Vector3 startPosition, Vector3 targetPosition, float weight, float minNormalizedTargetDistance, int iterations, float length, Vector3 startOffset) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } if (minNormalizedTargetDistance > 0f) { Vector3 val = targetPosition - startPosition; float magnitude = ((Vector3)(ref val)).magnitude; Vector3 val2 = startPosition + val / magnitude * Mathf.Max(length * minNormalizedTargetDistance, magnitude); targetPosition = Vector3.Lerp(targetPosition, val2, weight); } for (int i = 0; i < iterations; i++) { bones[^1].solverPosition = Vector3.Lerp(bones[^1].solverPosition, targetPosition, weight); for (int num = bones.Length - 2; num > -1; num--) { bones[num].solverPosition = SolveFABRIKJoint(bones[num].solverPosition, bones[num + 1].solverPosition, bones[num].length); } if (i == 0) { foreach (VirtualBone virtualBone in bones) { virtualBone.solverPosition += startOffset; } } bones[0].solverPosition = startPosition; for (int k = 1; k < bones.Length; k++) { bones[k].solverPosition = SolveFABRIKJoint(bones[k].solverPosition, bones[k - 1].solverPosition, bones[k - 1].length); } } for (int l = 0; l < bones.Length - 1; l++) { SwingRotation(bones, l, bones[l + 1].solverPosition); } } private static Vector3 SolveFABRIKJoint(Vector3 pos1, Vector3 pos2, float length) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos1 - pos2; return pos2 + ((Vector3)(ref val)).normalized * length; } public static void SolveCCD(VirtualBone[] bones, Vector3 targetPosition, float weight, int iterations) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } for (int i = 0; i < iterations; i++) { for (int num = bones.Length - 2; num > -1; num--) { Vector3 val = bones[^1].solverPosition - bones[num].solverPosition; Vector3 val2 = targetPosition - bones[num].solverPosition; Quaternion val3 = Quaternion.FromToRotation(val, val2); if (weight >= 1f) { RotateBy(bones, num, val3); } else { RotateBy(bones, num, Quaternion.Lerp(Quaternion.identity, val3, weight)); } } } } } private Transform[] solverTransforms = (Transform[])(object)new Transform[0]; private bool hasChest; private bool hasNeck; private bool hasShoulders; private bool hasToes; private bool hasLegs; private Vector3[] readPositions = (Vector3[])(object)new Vector3[0]; private Quaternion[] readRotations = (Quaternion[])(object)new Quaternion[0]; private Vector3[] solvedPositions = (Vector3[])(object)new Vector3[22]; private Quaternion[] solvedRotations = (Quaternion[])(object)new Quaternion[22]; private Quaternion[] defaultLocalRotations = (Quaternion[])(object)new Quaternion[21]; private Vector3[] defaultLocalPositions = (Vector3[])(object)new Vector3[21]; private Vector3 rootV; private Vector3 rootVelocity; private Vector3 bodyOffset; private int supportLegIndex; private int lastLOD; [Tooltip("LOD 0: Full quality solving. LOD 1: Shoulder solving, stretching plant feet disabled, spine solving quality reduced. This provides about 30% of performance gain. LOD 2: Culled, but updating root position and rotation if locomotion is enabled.")] [Range(0f, 2f)] public int LOD = 0; [Tooltip("Scale of the character. Value of 1 means normal adult human size.")] public float scale = 1f; [Tooltip("If true, will keep the toes planted even if head target is out of reach, so this can cause the camera to exit the head if it is too high for the model to reach. Enabling this increases the cost of the solver as the legs will have to be solved multiple times.")] public bool plantFeet = true; [Tooltip("The spine solver.")] public Spine spine = new Spine(); [Tooltip("The left arm solver.")] public Arm leftArm = new Arm(); [Tooltip("The right arm solver.")] public Arm rightArm = new Arm(); [Tooltip("The left leg solver.")] public Leg leftLeg = new Leg(); [Tooltip("The right leg solver.")] public Leg rightLeg = new Leg(); [Tooltip("Procedural leg shuffling for stationary VR games. Not designed for roomscale and thumbstick locomotion. For those it would be better to use a strafing locomotion blend tree to make the character follow the horizontal direction towards the HMD by root motion or script.")] public Locomotion locomotion = new Locomotion(); private Leg[] legs = new Leg[2]; private Arm[] arms = new Arm[2]; private Vector3 headPosition; private Vector3 headDeltaPosition; private Vector3 raycastOriginPelvis; private Vector3 lastOffset; private Vector3 debugPos1; private Vector3 debugPos2; private Vector3 debugPos3; private Vector3 debugPos4; [HideInInspector] public VirtualBone rootBone { get; private set; } public void SetToReferences(VRIK.References references) { if (!references.isFilled) { Debug.LogError((object)"Invalid references, one or more Transforms are missing."); return; } solverTransforms = references.GetTransforms(); hasChest = (Object)(object)solverTransforms[3] != (Object)null; hasNeck = (Object)(object)solverTransforms[4] != (Object)null; hasShoulders = (Object)(object)solverTransforms[6] != (Object)null && (Object)(object)solverTransforms[10] != (Object)null; hasToes = (Object)(object)solverTransforms[17] != (Object)null && (Object)(object)solverTransforms[21] != (Object)null; hasLegs = (Object)(object)solverTransforms[14] != (Object)null; readPositions = (Vector3[])(object)new Vector3[solverTransforms.Length]; readRotations = (Quaternion[])(object)new Quaternion[solverTransforms.Length]; DefaultAnimationCurves(); GuessHandOrientations(references, onlyIfZero: true); } public void GuessHandOrientations(VRIK.References references, bool onlyIfZero) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) if (!references.isFilled) { Debug.LogWarning((object)"VRIK References are not filled in, can not guess hand orientations. Right-click on VRIK header and slect 'Guess Hand Orientations' when you have filled in the References.", (Object)(object)references.root); return; } if (leftArm.wristToPalmAxis == Vector3.zero || !onlyIfZero) { leftArm.wristToPalmAxis = VRIKCalibrator.GuessWristToPalmAxis(references.leftHand, references.leftForearm); } if (leftArm.palmToThumbAxis == Vector3.zero || !onlyIfZero) { leftArm.palmToThumbAxis = VRIKCalibrator.GuessPalmToThumbAxis(references.leftHand, references.leftForearm); } if (rightArm.wristToPalmAxis == Vector3.zero || !onlyIfZero) { rightArm.wristToPalmAxis = VRIKCalibrator.GuessWristToPalmAxis(references.rightHand, references.rightForearm); } if (rightArm.palmToThumbAxis == Vector3.zero || !onlyIfZero) { rightArm.palmToThumbAxis = VRIKCalibrator.GuessPalmToThumbAxis(references.rightHand, references.rightForearm); } } public void DefaultAnimationCurves() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown if (locomotion.stepHeight == null) { locomotion.stepHeight = new AnimationCurve(); } if (locomotion.heelHeight == null) { locomotion.heelHeight = new AnimationCurve(); } if (locomotion.stepHeight.keys.Length == 0) { locomotion.stepHeight.keys = GetSineKeyframes(0.03f); } if (locomotion.heelHeight.keys.Length == 0) { locomotion.heelHeight.keys = GetSineKeyframes(0.03f); } } public void AddPositionOffset(PositionOffset positionOffset, Vector3 value) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) switch (positionOffset) { case PositionOffset.Pelvis: { Spine obj3 = spine; obj3.pelvisPositionOffset += value; break; } case PositionOffset.Chest: { Spine obj2 = spine; obj2.chestPositionOffset += value; break; } case PositionOffset.Head: { Spine obj = spine; obj.headPositionOffset += value; break; } case PositionOffset.LeftHand: { Arm arm2 = leftArm; arm2.handPositionOffset += value; break; } case PositionOffset.RightHand: { Arm arm = rightArm; arm.handPositionOffset += value; break; } case PositionOffset.LeftFoot: { Leg leg4 = leftLeg; leg4.footPositionOffset += value; break; } case PositionOffset.RightFoot: { Leg leg3 = rightLeg; leg3.footPositionOffset += value; break; } case PositionOffset.LeftHeel: { Leg leg2 = leftLeg; leg2.heelPositionOffset += value; break; } case PositionOffset.RightHeel: { Leg leg = rightLeg; leg.heelPositionOffset += value; break; } } } public void AddRotationOffset(RotationOffset rotationOffset, Vector3 value) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) AddRotationOffset(rotationOffset, Quaternion.Euler(value)); } public void AddRotationOffset(RotationOffset rotationOffset, Quaternion value) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) switch (rotationOffset) { case RotationOffset.Pelvis: spine.pelvisRotationOffset = value * spine.pelvisRotationOffset; break; case RotationOffset.Chest: spine.chestRotationOffset = value * spine.chestRotationOffset; break; case RotationOffset.Head: spine.headRotationOffset = value * spine.headRotationOffset; break; } } public void AddPlatformMotion(Vector3 deltaPosition, Quaternion deltaRotation, Vector3 platformPivot) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) locomotion.AddDeltaPosition(deltaPosition); raycastOriginPelvis += deltaPosition; locomotion.AddDeltaRotation(deltaRotation, platformPivot); spine.faceDirection = deltaRotation * spine.faceDirection; } public void Reset() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (base.initiated) { UpdateSolverTransforms(); Read(readPositions, readRotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs); spine.faceDirection = rootBone.readRotation * Vector3.forward; if (hasLegs) { locomotion.Reset(readPositions, readRotations); raycastOriginPelvis = spine.pelvis.readPosition; } } } public override void StoreDefaultLocalState() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) for (int i = 1; i < solverTransforms.Length; i++) { if ((Object)(object)solverTransforms[i] != (Object)null) { ref Vector3 reference = ref defaultLocalPositions[i - 1]; reference = solverTransforms[i].localPosition; ref Quaternion reference2 = ref defaultLocalRotations[i - 1]; reference2 = solverTransforms[i].localRotation; } } } public override void FixTransforms() { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) if (!base.initiated || LOD >= 2) { return; } for (int i = 1; i < solverTransforms.Length; i++) { if ((Object)(object)solverTransforms[i] != (Object)null) { bool flag = i == 1; bool flag2 = i == 8 || i == 9 || i == 12 || i == 13; bool flag3 = (i >= 15 && i <= 17) || (i >= 19 && i <= 21); if (flag || flag2 || flag3) { solverTransforms[i].localPosition = defaultLocalPositions[i - 1]; } solverTransforms[i].localRotation = defaultLocalRotations[i - 1]; } } } public override Point[] GetPoints() { Debug.LogError((object)"GetPoints() is not applicable to IKSolverVR."); return null; } public override Point GetPoint(Transform transform) { Debug.LogError((object)"GetPoint is not applicable to IKSolverVR."); return null; } public override bool IsValid(ref string message) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if (solverTransforms == null || solverTransforms.Length == 0) { message = "Trying to initiate IKSolverVR with invalid bone references."; return false; } if (leftArm.wristToPalmAxis == Vector3.zero) { message = "Left arm 'Wrist To Palm Axis' needs to be set in VRIK. Please select the hand bone, set it to the axis that points from the wrist towards the palm. If the arrow points away from the palm, axis must be negative."; return false; } if (rightArm.wristToPalmAxis == Vector3.zero) { message = "Right arm 'Wrist To Palm Axis' needs to be set in VRIK. Please select the hand bone, set it to the axis that points from the wrist towards the palm. If the arrow points away from the palm, axis must be negative."; return false; } if (leftArm.palmToThumbAxis == Vector3.zero) { message = "Left arm 'Palm To Thumb Axis' needs to be set in VRIK. Please select the hand bone, set it to the axis that points from the palm towards the thumb. If the arrow points away from the thumb, axis must be negative."; return false; } if (rightArm.palmToThumbAxis == Vector3.zero) { message = "Right arm 'Palm To Thumb Axis' needs to be set in VRIK. Please select the hand bone, set it to the axis that points from the palm towards the thumb. If the arrow points away from the thumb, axis must be negative."; return false; } return true; } private Vector3 GetNormal(Transform[] transforms) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; Vector3 val2 = Vector3.zero; for (int i = 0; i < transforms.Length; i++) { val2 += transforms[i].position; } val2 /= (float)transforms.Length; for (int j = 0; j < transforms.Length - 1; j++) { Vector3 val3 = val; Vector3 val4 = Vector3.Cross(transforms[j].position - val2, transforms[j + 1].position - val2); val = val3 + ((Vector3)(ref val4)).normalized; } return val; } private static Keyframe[] GetSineKeyframes(float mag) { Keyframe[] array = (Keyframe[])(object)new Keyframe[3]; ((Keyframe)(ref array[0])).time = 0f; ((Keyframe)(ref array[0])).value = 0f; ((Keyframe)(ref array[1])).time = 0.5f; ((Keyframe)(ref array[1])).value = mag; ((Keyframe)(ref array[2])).time = 1f; ((Keyframe)(ref array[2])).value = 0f; return array; } private void UpdateSolverTransforms() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < solverTransforms.Length; i++) { if ((Object)(object)solverTransforms[i] != (Object)null) { ref Vector3 reference = ref readPositions[i]; reference = solverTransforms[i].position; ref Quaternion reference2 = ref readRotations[i]; reference2 = solverTransforms[i].rotation; } } } protected override void OnInitiate() { UpdateSolverTransforms(); Read(readPositions, readRotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs); } protected override void OnUpdate() { //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight > 0f) { if (LOD < 2) { bool flag = false; if (lastLOD != LOD && lastLOD == 2) { spine.faceDirection = rootBone.readRotation * Vector3.forward; if (hasLegs) { if (locomotion.weight > 0f) { root.position = new Vector3(spine.headTarget.position.x, root.position.y, spine.headTarget.position.z); Vector3 faceDirection = spine.faceDirection; faceDirection.y = 0f; root.rotation = Quaternion.LookRotation(faceDirection, root.up); UpdateSolverTransforms(); Read(readPositions, readRotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs); flag = true; locomotion.Reset(readPositions, readRotations); } raycastOriginPelvis = spine.pelvis.readPosition; } } if (!flag) { UpdateSolverTransforms(); Read(readPositions, readRotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs); } Solve(); Write(); WriteTransforms(); } else if (locomotion.weight > 0f) { root.position = new Vector3(spine.headTarget.position.x, root.position.y, spine.headTarget.position.z); Vector3 val = spine.headTarget.rotation * spine.anchorRelativeToHead * Vector3.forward; val.y = 0f; root.rotation = Quaternion.LookRotation(val, root.up); } } lastLOD = LOD; } private void WriteTransforms() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < solverTransforms.Length; i++) { if (!((Object)(object)solverTransforms[i] != (Object)null)) { continue; } bool flag = i < 2; bool flag2 = i == 8 || i == 9 || i == 12 || i == 13; bool flag3 = (i >= 15 && i <= 17) || (i >= 19 && i <= 21); if (LOD > 0) { flag2 = false; flag3 = false; } if (flag) { solverTransforms[i].position = V3Tools.Lerp(solverTransforms[i].position, GetPosition(i), IKPositionWeight); } if (flag2 || flag3) { if (IKPositionWeight < 1f) { Vector3 localPosition = solverTransforms[i].localPosition; solverTransforms[i].position = V3Tools.Lerp(solverTransforms[i].position, GetPosition(i), IKPositionWeight); solverTransforms[i].localPosition = Vector3.Project(solverTransforms[i].localPosition, localPosition); } else { solverTransforms[i].position = V3Tools.Lerp(solverTransforms[i].position, GetPosition(i), IKPositionWeight); } } solverTransforms[i].rotation = QuaTools.Lerp(solverTransforms[i].rotation, GetRotation(i), IKPositionWeight); } } private void Read(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) if (rootBone == null) { rootBone = new VirtualBone(positions[0], rotations[0]); } else { rootBone.Read(positions[0], rotations[0]); } spine.Read(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, 0, 1); leftArm.Read(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, (!hasChest) ? 2 : 3, 6); rightArm.Read(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, (!hasChest) ? 2 : 3, 10); if (hasLegs) { leftLeg.Read(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, 1, 14); rightLeg.Read(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, 1, 18); } for (int i = 0; i < rotations.Length; i++) { ref Vector3 reference = ref solvedPositions[i]; reference = positions[i]; ref Quaternion reference2 = ref solvedRotations[i]; reference2 = rotations[i]; } if (!base.initiated) { if (hasLegs) { legs = new Leg[2] { leftLeg, rightLeg }; } arms = new Arm[2] { leftArm, rightArm }; if (hasLegs) { locomotion.Initiate(positions, rotations, hasToes, scale); } raycastOriginPelvis = spine.pelvis.readPosition; spine.faceDirection = readRotations[0] * Vector3.forward; } } private void Solve() { //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05c5: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_060c: Unknown result type (might be due to invalid IL or missing references) //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_083d: Unknown result type (might be due to invalid IL or missing references) //IL_084d: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Unknown result type (might be due to invalid IL or missing references) //IL_06d7: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_0788: Unknown result type (might be due to invalid IL or missing references) //IL_0798: Unknown result type (might be due to invalid IL or missing references) //IL_0928: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_0933: Unknown result type (might be due to invalid IL or missing references) //IL_0938: Unknown result type (might be due to invalid IL or missing references) //IL_0944: Unknown result type (might be due to invalid IL or missing references) //IL_094f: Unknown result type (might be due to invalid IL or missing references) //IL_0954: Unknown result type (might be due to invalid IL or missing references) //IL_0959: Unknown result type (might be due to invalid IL or missing references) //IL_0996: Unknown result type (might be due to invalid IL or missing references) //IL_09ab: Unknown result type (might be due to invalid IL or missing references) //IL_09b0: Unknown result type (might be due to invalid IL or missing references) if (scale <= 0f) { Debug.LogError((object)"VRIK solver scale <= 0, can not solve!"); return; } spine.SetLOD(LOD); Arm[] array = arms; foreach (Arm arm in array) { arm.SetLOD(LOD); } if (hasLegs) { Leg[] array2 = legs; foreach (Leg leg in array2) { leg.SetLOD(LOD); } } spine.PreSolve(); Arm[] array3 = arms; foreach (Arm arm2 in array3) { arm2.PreSolve(); } if (hasLegs) { Leg[] array4 = legs; foreach (Leg leg2 in array4) { leg2.PreSolve(); } } Arm[] array5 = arms; foreach (Arm arm3 in array5) { arm3.ApplyOffsets(scale); } spine.ApplyOffsets(scale); spine.Solve(rootBone, legs, arms, scale); if (hasLegs && spine.pelvisPositionWeight > 0f && plantFeet) { Warning.Log("If VRIK 'Pelvis Position Weight' is > 0, 'Plant Feet' should be disabled to improve performance and stability.", root); } if (hasLegs && locomotion.weight > 0f) { Vector3 leftFootPosition = Vector3.zero; Vector3 rightFootPosition = Vector3.zero; Quaternion leftFootRotation = Quaternion.identity; Quaternion rightFootRotation = Quaternion.identity; float leftFootOffset = 0f; float rightFootOffset = 0f; float leftHeelOffset = 0f; float rightHeelOffset = 0f; locomotion.Solve(rootBone, spine, leftLeg, rightLeg, leftArm, rightArm, supportLegIndex, out leftFootPosition, out rightFootPosition, out leftFootRotation, out rightFootRotation, out leftFootOffset, out rightFootOffset, out leftHeelOffset, out rightHeelOffset, scale); leftFootPosition += root.up * leftFootOffset; rightFootPosition += root.up * rightFootOffset; Leg leg3 = leftLeg; leg3.footPositionOffset += (leftFootPosition - leftLeg.lastBone.solverPosition) * IKPositionWeight * (1f - leftLeg.positionWeight) * locomotion.weight; Leg leg4 = rightLeg; leg4.footPositionOffset += (rightFootPosition - rightLeg.lastBone.solverPosition) * IKPositionWeight * (1f - rightLeg.positionWeight) * locomotion.weight; Leg leg5 = leftLeg; leg5.heelPositionOffset += root.up * leftHeelOffset * locomotion.weight; Leg leg6 = rightLeg; leg6.heelPositionOffset += root.up * rightHeelOffset * locomotion.weight; Quaternion val = QuaTools.FromToRotation(leftLeg.lastBone.solverRotation, leftFootRotation); Quaternion val2 = QuaTools.FromToRotation(rightLeg.lastBone.solverRotation, rightFootRotation); val = Quaternion.Lerp(Quaternion.identity, val, IKPositionWeight * (1f - leftLeg.rotationWeight) * locomotion.weight); val2 = Quaternion.Lerp(Quaternion.identity, val2, IKPositionWeight * (1f - rightLeg.rotationWeight) * locomotion.weight); leftLeg.footRotationOffset = val * leftLeg.footRotationOffset; rightLeg.footRotationOffset = val2 * rightLeg.footRotationOffset; Vector3 point = Vector3.Lerp(leftLeg.position + leftLeg.footPositionOffset, rightLeg.position + rightLeg.footPositionOffset, 0.5f); point = V3Tools.PointToPlane(point, rootBone.solverPosition, root.up); Vector3 val3 = rootBone.solverPosition + rootVelocity * Time.deltaTime * 2f * locomotion.weight; val3 = Vector3.Lerp(val3, point, Time.deltaTime * locomotion.rootSpeed * locomotion.weight); rootBone.solverPosition = val3; rootVelocity += (point - rootBone.solverPosition) * Time.deltaTime * 10f; Vector3 val4 = V3Tools.ExtractVertical(rootVelocity, root.up, 1f); rootVelocity -= val4; float num = Mathf.Min(leftFootOffset + rightFootOffset, locomotion.maxBodyYOffset * scale); bodyOffset = Vector3.Lerp(bodyOffset, root.up * num, Time.deltaTime * 3f); bodyOffset = Vector3.Lerp(Vector3.zero, bodyOffset, locomotion.weight); } if (hasLegs) { Leg[] array6 = legs; foreach (Leg leg7 in array6) { leg7.ApplyOffsets(scale); } if (!plantFeet || LOD > 0) { spine.InverseTranslateToHead(legs, limited: false, useCurrentLegMag: false, bodyOffset, 1f); Leg[] array7 = legs; foreach (Leg leg8 in array7) { leg8.TranslateRoot(spine.pelvis.solverPosition, spine.pelvis.solverRotation); } Leg[] array8 = legs; foreach (Leg leg9 in array8) { leg9.Solve(stretch: true); } } else { for (int num4 = 0; num4 < 2; num4++) { spine.InverseTranslateToHead(legs, limited: true, useCurrentLegMag: true, bodyOffset, 1f); Leg[] array9 = legs; foreach (Leg leg10 in array9) { leg10.TranslateRoot(spine.pelvis.solverPosition, spine.pelvis.solverRotation); } Leg[] array10 = legs; foreach (Leg leg11 in array10) { leg11.Solve(num4 == 0); } } } } else { spine.InverseTranslateToHead(legs, limited: false, useCurrentLegMag: false, bodyOffset, 1f); } for (int num7 = 0; num7 < arms.Length; num7++) { arms[num7].TranslateRoot(spine.chest.solverPosition, spine.chest.solverRotation); } for (int num8 = 0; num8 < arms.Length; num8++) { arms[num8].Solve(num8 == 0); } spine.ResetOffsets(); if (hasLegs) { Leg[] array11 = legs; foreach (Leg leg12 in array11) { leg12.ResetOffsets(); } } Arm[] array12 = arms; foreach (Arm arm4 in array12) { arm4.ResetOffsets(); } if (hasLegs) { Spine obj = spine; obj.pelvisPositionOffset += GetPelvisOffset(); Spine obj2 = spine; obj2.chestPositionOffset += spine.pelvisPositionOffset; } Write(); if (!hasLegs) { return; } supportLegIndex = -1; float num11 = float.PositiveInfinity; for (int num12 = 0; num12 < legs.Length; num12++) { float num13 = Vector3.SqrMagnitude(legs[num12].lastBone.solverPosition - legs[num12].bones[0].solverPosition); if (num13 < num11) { supportLegIndex = num12; num11 = num13; } } } private Vector3 GetPosition(int index) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) return solvedPositions[index]; } private Quaternion GetRotation(int index) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) return solvedRotations[index]; } private void Write() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) ref Vector3 reference = ref solvedPositions[0]; reference = rootBone.solverPosition; ref Quaternion reference2 = ref solvedRotations[0]; reference2 = rootBone.solverRotation; spine.Write(ref solvedPositions, ref solvedRotations); if (hasLegs) { Leg[] array = legs; foreach (Leg leg in array) { leg.Write(ref solvedPositions, ref solvedRotations); } } Arm[] array2 = arms; foreach (Arm arm in array2) { arm.Write(ref solvedPositions, ref solvedRotations); } } private Vector3 GetPelvisOffset() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) if (locomotion.weight <= 0f) { return Vector3.zero; } if (LayerMask.op_Implicit(locomotion.blockingLayers) == -1) { return Vector3.zero; } Vector3 val = raycastOriginPelvis; val.y = spine.pelvis.solverPosition.y; Vector3 val2 = spine.pelvis.readPosition; val2.y = spine.pelvis.solverPosition.y; Vector3 val3 = val2 - val; RaycastHit val4 = default(RaycastHit); if (locomotion.raycastRadius <= 0f) { if (Physics.Raycast(val, val3, ref val4, ((Vector3)(ref val3)).magnitude * 1.1f, LayerMask.op_Implicit(locomotion.blockingLayers))) { val2 = ((RaycastHit)(ref val4)).point; } } else if (Physics.SphereCast(val, locomotion.raycastRadius * 1.1f, val3, ref val4, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(locomotion.blockingLayers))) { val2 = val + ((Vector3)(ref val3)).normalized * ((RaycastHit)(ref val4)).distance / 1.1f; } Vector3 val5 = spine.pelvis.solverPosition; val3 = val5 - val2; if (locomotion.raycastRadius <= 0f) { if (Physics.Raycast(val2, val3, ref val4, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(locomotion.blockingLayers))) { val5 = ((RaycastHit)(ref val4)).point; } } else if (Physics.SphereCast(val2, locomotion.raycastRadius, val3, ref val4, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(locomotion.blockingLayers))) { val5 = val2 + ((Vector3)(ref val3)).normalized * ((RaycastHit)(ref val4)).distance; } lastOffset = Vector3.Lerp(lastOffset, Vector3.zero, Time.deltaTime * 3f); val5 += Vector3.ClampMagnitude(lastOffset, 0.75f); val5.y = spine.pelvis.solverPosition.y; lastOffset = Vector3.Lerp(lastOffset, val5 - spine.pelvis.solverPosition, Time.deltaTime * 15f); return lastOffset; } } public class TwistRelaxer : MonoBehaviour { public IK ik; [Tooltip("If using multiple solvers, add them in inverse hierarchical order - first forearm roll bone, then forearm bone and upper arm bone.")] public TwistSolver[] twistSolvers = new TwistSolver[0]; public void Start() { if (twistSolvers.Length == 0) { Debug.LogError((object)"TwistRelaxer has no TwistSolvers. TwistRelaxer.cs was restructured for FIK v2.0 to support multiple relaxers on the same body part and TwistRelaxer components need to be set up again, sorry for the inconvenience!", (Object)(object)((Component)this).transform); return; } TwistSolver[] array = twistSolvers; foreach (TwistSolver twistSolver in array) { twistSolver.Initiate(); } if ((Object)(object)ik != (Object)null) { IKSolver iKSolver = ik.GetIKSolver(); iKSolver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostUpdate)); } } private void OnPostUpdate() { if ((Object)(object)ik != (Object)null) { TwistSolver[] array = twistSolvers; foreach (TwistSolver twistSolver in array) { twistSolver.Relax(); } } } private void LateUpdate() { if ((Object)(object)ik == (Object)null) { TwistSolver[] array = twistSolvers; foreach (TwistSolver twistSolver in array) { twistSolver.Relax(); } } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolver iKSolver = ik.GetIKSolver(); iKSolver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostUpdate)); } } } [Serializable] public class TwistSolver { [Tooltip("The transform that this solver operates on.")] public Transform transform; [Tooltip("If this is the forearm roll bone, the parent should be the forearm bone. If null, will be found automatically.")] public Transform parent; [Tooltip("If this is the forearm roll bone, the child should be the hand bone. If null, will attempt to find automatically. Assign the hand manually if the hand bone is not a child of the roll bone.")] public Transform[] children = (Transform[])(object)new Transform[0]; [Tooltip("The weight of relaxing the twist of this Transform")] [Range(0f, 1f)] public float weight = 1f; [Tooltip("If 0.5, this Transform will be twisted half way from parent to child. If 1, the twist angle will be locked to the child and will rotate with along with it.")] [Range(0f, 1f)] public float parentChildCrossfade = 0.5f; [Tooltip("Rotation offset around the twist axis.")] [Range(-180f, 180f)] public float twistAngleOffset; private Vector3 twistAxis = Vector3.right; private Vector3 axis = Vector3.forward; private Vector3 axisRelativeToParentDefault; private Vector3 axisRelativeToChildDefault; private Quaternion[] childRotations; private bool inititated; public TwistSolver() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) weight = 1f; parentChildCrossfade = 0.5f; } public void Initiate() { //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)transform == (Object)null) { Debug.LogError((object)"TwistRelaxer solver has unassigned Transform. TwistRelaxer.cs was restructured for FIK v2.0 to support multiple relaxers on the same body part and TwistRelaxer components need to be set up again, sorry for the inconvenience!", (Object)(object)transform); return; } if ((Object)(object)parent == (Object)null) { parent = transform.parent; } if (children.Length == 0) { if (transform.childCount == 0) { Transform[] componentsInChildren = ((Component)parent).GetComponentsInChildren(); for (int i = 1; i < componentsInChildren.Length; i++) { if ((Object)(object)componentsInChildren[i] != (Object)(object)transform) { componentsInChildren = (Transform[])(object)new Transform[1] { componentsInChildren[i] }; break; } } } else { children = (Transform[])(object)new Transform[1] { transform.GetChild(0) }; } } if (children.Length == 0 || (Object)(object)children[0] == (Object)null) { Debug.LogError((object)"TwistRelaxer has no children assigned.", (Object)(object)transform); return; } twistAxis = transform.InverseTransformDirection(children[0].position - transform.position); axis = new Vector3(twistAxis.y, twistAxis.z, twistAxis.x); Vector3 val = transform.rotation * axis; axisRelativeToParentDefault = Quaternion.Inverse(parent.rotation) * val; axisRelativeToChildDefault = Quaternion.Inverse(children[0].rotation) * val; childRotations = (Quaternion[])(object)new Quaternion[children.Length]; inititated = true; } public void Relax() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) if (inititated && !(weight <= 0f)) { Quaternion rotation = transform.rotation; Quaternion val = Quaternion.AngleAxis(twistAngleOffset, rotation * twistAxis); rotation = val * rotation; Vector3 val2 = val * parent.rotation * axisRelativeToParentDefault; Vector3 val3 = val * children[0].rotation * axisRelativeToChildDefault; Vector3 val4 = Vector3.Slerp(val2, val3, parentChildCrossfade); Quaternion val5 = Quaternion.LookRotation(rotation * axis, rotation * twistAxis); val4 = Quaternion.Inverse(val5) * val4; float num = Mathf.Atan2(val4.x, val4.z) * 57.29578f; for (int i = 0; i < children.Length; i++) { ref Quaternion reference = ref childRotations[i]; reference = children[i].rotation; } transform.rotation = Quaternion.AngleAxis(num * weight, rotation * twistAxis) * rotation; for (int j = 0; j < children.Length; j++) { children[j].rotation = childRotations[j]; } } } } [Serializable] public class InteractionEffector { private Poser poser; private IKEffector effector; private float timer; private float length; private float weight; private float fadeInSpeed; private float defaultPositionWeight; private float defaultRotationWeight; private float defaultPull; private float defaultReach; private float defaultPush; private float defaultPushParent; private float defaultBendGoalWeight; private float resetTimer; private bool positionWeightUsed; private bool rotationWeightUsed; private bool pullUsed; private bool reachUsed; private bool pushUsed; private bool pushParentUsed; private bool bendGoalWeightUsed; private bool pickedUp; private bool defaults; private bool pickUpOnPostFBBIK; private Vector3 pickUpPosition; private Vector3 pausePositionRelative; private Quaternion pickUpRotation; private Quaternion pauseRotationRelative; private InteractionTarget interactionTarget; private Transform target; private List triggered = new List(); private InteractionSystem interactionSystem; private bool started; public FullBodyBipedEffector effectorType { get; private set; } public bool isPaused { get; private set; } public InteractionObject interactionObject { get; private set; } public bool inInteraction => (Object)(object)interactionObject != (Object)null; public float progress { get { if (!inInteraction) { return 0f; } if (length == 0f) { return 0f; } return timer / length; } } public InteractionEffector(FullBodyBipedEffector effectorType) { this.effectorType = effectorType; } public void Initiate(InteractionSystem interactionSystem) { this.interactionSystem = interactionSystem; effector = interactionSystem.ik.solver.GetEffector(effectorType); poser = ((Component)effector.bone).GetComponent(); StoreDefaults(); } private void StoreDefaults() { defaultPositionWeight = interactionSystem.ik.solver.GetEffector(effectorType).positionWeight; defaultRotationWeight = interactionSystem.ik.solver.GetEffector(effectorType).rotationWeight; defaultPull = interactionSystem.ik.solver.GetChain(effectorType).pull; defaultReach = interactionSystem.ik.solver.GetChain(effectorType).reach; defaultPush = interactionSystem.ik.solver.GetChain(effectorType).push; defaultPushParent = interactionSystem.ik.solver.GetChain(effectorType).pushParent; defaultBendGoalWeight = interactionSystem.ik.solver.GetChain(effectorType).bendConstraint.weight; } public bool ResetToDefaults(float speed) { if (inInteraction) { return false; } if (isPaused) { return false; } if (defaults) { return false; } resetTimer = Mathf.MoveTowards(resetTimer, 0f, Time.deltaTime * speed); if (effector.isEndEffector) { if (pullUsed) { interactionSystem.ik.solver.GetChain(effectorType).pull = Mathf.Lerp(defaultPull, interactionSystem.ik.solver.GetChain(effectorType).pull, resetTimer); } if (reachUsed) { interactionSystem.ik.solver.GetChain(effectorType).reach = Mathf.Lerp(defaultReach, interactionSystem.ik.solver.GetChain(effectorType).reach, resetTimer); } if (pushUsed) { interactionSystem.ik.solver.GetChain(effectorType).push = Mathf.Lerp(defaultPush, interactionSystem.ik.solver.GetChain(effectorType).push, resetTimer); } if (pushParentUsed) { interactionSystem.ik.solver.GetChain(effectorType).pushParent = Mathf.Lerp(defaultPushParent, interactionSystem.ik.solver.GetChain(effectorType).pushParent, resetTimer); } if (bendGoalWeightUsed) { interactionSystem.ik.solver.GetChain(effectorType).bendConstraint.weight = Mathf.Lerp(defaultBendGoalWeight, interactionSystem.ik.solver.GetChain(effectorType).bendConstraint.weight, resetTimer); } } if (positionWeightUsed) { effector.positionWeight = Mathf.Lerp(defaultPositionWeight, effector.positionWeight, resetTimer); } if (rotationWeightUsed) { effector.rotationWeight = Mathf.Lerp(defaultRotationWeight, effector.rotationWeight, resetTimer); } if (resetTimer <= 0f) { pullUsed = false; reachUsed = false; pushUsed = false; pushParentUsed = false; positionWeightUsed = false; rotationWeightUsed = false; bendGoalWeightUsed = false; defaults = true; } return true; } public bool Pause() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (!inInteraction) { return false; } isPaused = true; pausePositionRelative = target.InverseTransformPoint(effector.position); pauseRotationRelative = Quaternion.Inverse(target.rotation) * effector.rotation; if (interactionSystem.OnInteractionPause != null) { interactionSystem.OnInteractionPause(effectorType, interactionObject); } return true; } public bool Resume() { if (!inInteraction) { return false; } isPaused = false; if (interactionSystem.OnInteractionResume != null) { interactionSystem.OnInteractionResume(effectorType, interactionObject); } return true; } public bool Start(InteractionObject interactionObject, string tag, float fadeInTime, bool interrupt) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) if (!inInteraction) { effector.position = effector.bone.position; effector.rotation = effector.bone.rotation; } else { if (!interrupt) { return false; } defaults = false; } target = interactionObject.GetTarget(effectorType, tag); if ((Object)(object)target == (Object)null) { return false; } interactionTarget = ((Component)target).GetComponent(); this.interactionObject = interactionObject; if (interactionSystem.OnInteractionStart != null) { interactionSystem.OnInteractionStart(effectorType, interactionObject); } interactionObject.OnStartInteraction(interactionSystem); triggered.Clear(); for (int i = 0; i < interactionObject.events.Length; i++) { triggered.Add(item: false); } if ((Object)(object)poser != (Object)null) { if ((Object)(object)poser.poseRoot == (Object)null) { poser.weight = 0f; } if ((Object)(object)interactionTarget != (Object)null) { poser.poseRoot = ((Component)target).transform; } else { poser.poseRoot = null; } poser.AutoMapping(); } positionWeightUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.PositionWeight); rotationWeightUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.RotationWeight); pullUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.Pull); reachUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.Reach); pushUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.Push); pushParentUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.PushParent); bendGoalWeightUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.BendGoalWeight); if (defaults) { StoreDefaults(); } timer = 0f; weight = 0f; fadeInSpeed = ((!(fadeInTime > 0f)) ? 1000f : (1f / fadeInTime)); length = interactionObject.length; isPaused = false; pickedUp = false; pickUpPosition = Vector3.zero; pickUpRotation = Quaternion.identity; if ((Object)(object)interactionTarget != (Object)null) { interactionTarget.RotateTo(effector.bone); } started = true; return true; } public void Update(Transform root, float speed) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) if (!inInteraction) { if (started) { isPaused = false; pickedUp = false; defaults = false; resetTimer = 1f; started = false; } return; } if ((Object)(object)interactionTarget != (Object)null && !interactionTarget.rotateOnce) { interactionTarget.RotateTo(effector.bone); } if (isPaused) { effector.position = target.TransformPoint(pausePositionRelative); effector.rotation = target.rotation * pauseRotationRelative; interactionObject.Apply(interactionSystem.ik.solver, effectorType, interactionTarget, timer, weight); return; } timer += Time.deltaTime * speed * ((!((Object)(object)interactionTarget != (Object)null)) ? 1f : interactionTarget.interactionSpeedMlp); weight = Mathf.Clamp(weight + Time.deltaTime * fadeInSpeed * speed, 0f, 1f); bool pickUp = false; bool pause = false; TriggerUntriggeredEvents(checkTime: true, out pickUp, out pause); Vector3 val = ((!pickedUp) ? target.position : ((Component)interactionSystem).transform.TransformPoint(pickUpPosition)); Quaternion val2 = ((!pickedUp) ? target.rotation : (((Component)interactionSystem).transform.rotation * pickUpRotation)); effector.position = Vector3.Lerp(effector.bone.position, val, weight); effector.rotation = Quaternion.Lerp(effector.bone.rotation, val2, weight); interactionObject.Apply(interactionSystem.ik.solver, effectorType, interactionTarget, timer, weight); if (pickUp) { PickUp(root); } if (pause) { Pause(); } float value = interactionObject.GetValue(InteractionObject.WeightCurve.Type.PoserWeight, interactionTarget, timer); if ((Object)(object)poser != (Object)null) { poser.weight = Mathf.Lerp(poser.weight, value, weight); } else if (value > 0f) { Warning.Log("InteractionObject " + ((Object)interactionObject).name + " has a curve/multipler for Poser Weight, but the bone of effector " + effectorType.ToString() + " has no HandPoser/GenericPoser attached.", effector.bone); } if (timer >= length) { Stop(); } } private void TriggerUntriggeredEvents(bool checkTime, out bool pickUp, out bool pause) { pickUp = false; pause = false; for (int i = 0; i < triggered.Count; i++) { if (triggered[i] || (checkTime && !(interactionObject.events[i].time < timer))) { continue; } interactionObject.events[i].Activate(effector.bone); if (interactionObject.events[i].pickUp) { if (timer >= interactionObject.events[i].time) { timer = interactionObject.events[i].time; } pickUp = true; } if (interactionObject.events[i].pause) { if (timer >= interactionObject.events[i].time) { timer = interactionObject.events[i].time; } pause = true; } if (interactionSystem.OnInteractionEvent != null) { interactionSystem.OnInteractionEvent(effectorType, interactionObject, interactionObject.events[i]); } triggered[i] = true; } } private void PickUp(Transform root) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) pickUpPosition = root.InverseTransformPoint(effector.position); pickUpRotation = Quaternion.Inverse(((Component)interactionSystem).transform.rotation) * effector.rotation; pickUpOnPostFBBIK = true; pickedUp = true; Rigidbody component = ((Component)interactionObject.targetsRoot).GetComponent(); if ((Object)(object)component != (Object)null) { if (!component.isKinematic) { component.isKinematic = true; } Collider component2 = ((Component)root).GetComponent(); if ((Object)(object)component2 != (Object)null) { Collider[] componentsInChildren = ((Component)interactionObject.targetsRoot).GetComponentsInChildren(); Collider[] array = componentsInChildren; foreach (Collider val in array) { if (!val.isTrigger && val.enabled) { Physics.IgnoreCollision(component2, val); } } } } if (interactionSystem.OnInteractionPickUp != null) { interactionSystem.OnInteractionPickUp(effectorType, interactionObject); } } public bool Stop() { if (!inInteraction) { return false; } bool pickUp = false; bool pause = false; TriggerUntriggeredEvents(checkTime: false, out pickUp, out pause); if (interactionSystem.OnInteractionStop != null) { interactionSystem.OnInteractionStop(effectorType, interactionObject); } if ((Object)(object)interactionTarget != (Object)null) { interactionTarget.ResetRotation(); } interactionObject = null; weight = 0f; timer = 0f; isPaused = false; target = null; defaults = false; resetTimer = 1f; if ((Object)(object)poser != (Object)null && !pickedUp) { poser.weight = 0f; } pickedUp = false; started = false; return true; } public void OnPostFBBIK() { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (inInteraction) { float num = interactionObject.GetValue(InteractionObject.WeightCurve.Type.RotateBoneWeight, interactionTarget, timer) * weight; if (num > 0f) { Quaternion val = ((!pickedUp) ? effector.rotation : (((Component)interactionSystem).transform.rotation * pickUpRotation)); Quaternion val2 = Quaternion.Slerp(effector.bone.rotation, val, num * num); effector.bone.localRotation = Quaternion.Inverse(effector.bone.parent.rotation) * val2; } if (pickUpOnPostFBBIK) { Vector3 position = effector.bone.position; effector.bone.position = ((Component)interactionSystem).transform.TransformPoint(pickUpPosition); interactionObject.targetsRoot.parent = effector.bone; effector.bone.position = position; pickUpOnPostFBBIK = false; } } } } [Serializable] public class InteractionLookAt { [Tooltip("(Optional) reference to the LookAtIK component that will be used to make the character look at the objects that it is interacting with.")] public LookAtIK ik; [Tooltip("Interpolation speed of the LookAtIK target.")] public float lerpSpeed = 5f; [Tooltip("Interpolation speed of the LookAtIK weight.")] public float weightSpeed = 1f; [HideInInspector] public bool isPaused; private Transform lookAtTarget; private float stopLookTime; private float weight; private bool firstFBBIKSolve; public void Look(Transform target, float time) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ik == (Object)null)) { if (ik.solver.IKPositionWeight <= 0f) { ik.solver.IKPosition = ik.solver.GetRoot().position + ik.solver.GetRoot().forward * 3f; } lookAtTarget = target; stopLookTime = time; } } public void OnFixTransforms() { if (!((Object)(object)ik == (Object)null) && ik.fixTransforms) { ik.solver.FixTransforms(); } } public void Update() { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik == (Object)null) { return; } if (((Behaviour)ik).enabled) { ((Behaviour)ik).enabled = false; } if (!((Object)(object)lookAtTarget == (Object)null)) { if (isPaused) { stopLookTime += Time.deltaTime; } float num = ((!(Time.time < stopLookTime)) ? (0f - weightSpeed) : weightSpeed); weight = Mathf.Clamp(weight + num * Time.deltaTime, 0f, 1f); ik.solver.IKPositionWeight = Interp.Float(weight, InterpolationMode.InOutQuintic); ik.solver.IKPosition = Vector3.Lerp(ik.solver.IKPosition, lookAtTarget.position, lerpSpeed * Time.deltaTime); if (weight <= 0f) { lookAtTarget = null; } firstFBBIKSolve = true; } } public void SolveSpine() { if (!((Object)(object)ik == (Object)null) && firstFBBIKSolve) { float headWeight = ik.solver.headWeight; float eyesWeight = ik.solver.eyesWeight; ik.solver.headWeight = 0f; ik.solver.eyesWeight = 0f; ik.solver.Update(); ik.solver.headWeight = headWeight; ik.solver.eyesWeight = eyesWeight; } } public void SolveHead() { if (!((Object)(object)ik == (Object)null) && firstFBBIKSolve) { float bodyWeight = ik.solver.bodyWeight; ik.solver.bodyWeight = 0f; ik.solver.Update(); ik.solver.bodyWeight = bodyWeight; firstFBBIKSolve = false; } } } [HelpURL("https://www.youtube.com/watch?v=r5jiZnsDH3M")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Interaction System/Interaction Object")] public class InteractionObject : MonoBehaviour { [Serializable] public class InteractionEvent { [Tooltip("The time of the event since interaction start.")] public float time; [Tooltip("If true, the interaction will be paused on this event. The interaction can be resumed by InteractionSystem.ResumeInteraction() or InteractionSystem.ResumeAll;")] public bool pause; [Tooltip("If true, the object will be parented to the effector bone on this event. Note that picking up like this can be done by only a single effector at a time. If you wish to pick up an object with both hands, see the Interaction PickUp2Handed demo scene.")] public bool pickUp; [Tooltip("The animations called on this event.")] public AnimatorEvent[] animations; [Tooltip("The messages sent on this event using GameObject.SendMessage().")] public Message[] messages; [Tooltip("The UnityEvent to invoke on this event.")] public UnityEvent unityEvent; public void Activate(Transform t) { unityEvent.Invoke(); AnimatorEvent[] array = animations; foreach (AnimatorEvent animatorEvent in array) { animatorEvent.Activate(pickUp); } Message[] array2 = messages; foreach (Message message in array2) { message.Send(t); } } } [Serializable] public class Message { [Tooltip("The name of the function called.")] public string function; [Tooltip("The recipient game object.")] public GameObject recipient; private const string empty = ""; public void Send(Transform t) { if (!((Object)(object)recipient == (Object)null) && !(function == string.Empty) && !(function == "")) { recipient.SendMessage(function, (object)t, (SendMessageOptions)0); } } } [Serializable] public class AnimatorEvent { [Tooltip("The Animator component that will receive the AnimatorEvents.")] public Animator animator; [Tooltip("The Animation component that will receive the AnimatorEvents (Legacy).")] public Animation animation; [Tooltip("The name of the animation state.")] public string animationState; [Tooltip("The crossfading time.")] public float crossfadeTime = 0.3f; [Tooltip("The layer of the animation state (if using Legacy, the animation state will be forced to this layer).")] public int layer; [Tooltip("Should the animation always start from 0 normalized time?")] public bool resetNormalizedTime; private const string empty = ""; public void Activate(bool pickUp) { if ((Object)(object)animator != (Object)null) { if (pickUp) { animator.applyRootMotion = false; } Activate(animator); } if ((Object)(object)animation != (Object)null) { Activate(animation); } } private void Activate(Animator animator) { if (!(animationState == "")) { if (resetNormalizedTime) { animator.CrossFade(animationState, crossfadeTime, layer, 0f); } else { animator.CrossFade(animationState, crossfadeTime, layer); } } } private void Activate(Animation animation) { if (!(animationState == "")) { if (resetNormalizedTime) { animation[animationState].normalizedTime = 0f; } animation[animationState].layer = layer; animation.CrossFade(animationState, crossfadeTime); } } } [Serializable] public class WeightCurve { [Serializable] public enum Type { PositionWeight, RotationWeight, PositionOffsetX, PositionOffsetY, PositionOffsetZ, Pull, Reach, RotateBoneWeight, Push, PushParent, PoserWeight, BendGoalWeight } [Tooltip("The type of the curve (InteractionObject.WeightCurve.Type).")] public Type type; [Tooltip("The weight curve.")] public AnimationCurve curve; public float GetValue(float timer) { return curve.Evaluate(timer); } } [Serializable] public class Multiplier { [Tooltip("The curve type to multiply.")] public WeightCurve.Type curve; [Tooltip("The multiplier of the curve's value.")] public float multiplier = 1f; [Tooltip("The resulting value will be applied to this channel.")] public WeightCurve.Type result; public float GetValue(WeightCurve weightCurve, float timer) { return weightCurve.GetValue(timer) * multiplier; } } [Tooltip("If the Interaction System has a 'Look At' LookAtIK component assigned, will use it to make the character look at the specified Transform. If unassigned, will look at this GameObject.")] public Transform otherLookAtTarget; [Tooltip("The root Transform of the InteractionTargets. If null, will use this GameObject. GetComponentsInChildren() will be used at initiation to find all InteractionTargets associated with this InteractionObject.")] public Transform otherTargetsRoot; [Tooltip("If assigned, all PositionOffset channels will be applied in the rotation space of this Transform. If not, they will be in the rotation space of the character.")] public Transform positionOffsetSpace; public WeightCurve[] weightCurves; public Multiplier[] multipliers; public InteractionEvent[] events; private InteractionTarget[] targets = new InteractionTarget[0]; public float length { get; private set; } public InteractionSystem lastUsedInteractionSystem { get; private set; } public Transform lookAtTarget { get { if ((Object)(object)otherLookAtTarget != (Object)null) { return otherLookAtTarget; } return ((Component)this).transform; } } public Transform targetsRoot { get { if ((Object)(object)otherTargetsRoot != (Object)null) { return otherTargetsRoot; } return ((Component)this).transform; } } [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page10.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_interaction_object.html"); } [ContextMenu("TUTORIAL VIDEO (PART 1: BASICS)")] private void OpenTutorial1() { Application.OpenURL("https://www.youtube.com/watch?v=r5jiZnsDH3M"); } [ContextMenu("TUTORIAL VIDEO (PART 2: PICKING UP...)")] private void OpenTutorial2() { Application.OpenURL("https://www.youtube.com/watch?v=eP9-zycoHLk"); } [ContextMenu("TUTORIAL VIDEO (PART 3: ANIMATION)")] private void OpenTutorial3() { Application.OpenURL("https://www.youtube.com/watch?v=sQfB2RcT1T4&index=14&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("TUTORIAL VIDEO (PART 4: TRIGGERS)")] private void OpenTutorial4() { Application.OpenURL("https://www.youtube.com/watch?v=-TDZpNjt2mk&index=15&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public void Initiate() { for (int i = 0; i < weightCurves.Length; i++) { if (weightCurves[i].curve.length > 0) { float time = ((Keyframe)(ref weightCurves[i].curve.keys[weightCurves[i].curve.length - 1])).time; length = Mathf.Clamp(length, time, length); } } for (int j = 0; j < events.Length; j++) { length = Mathf.Clamp(length, events[j].time, length); } targets = ((Component)targetsRoot).GetComponentsInChildren(); } public InteractionTarget GetTarget(FullBodyBipedEffector effectorType, InteractionSystem interactionSystem) { if (((Component)interactionSystem).CompareTag(string.Empty) || ((Component)interactionSystem).CompareTag("")) { InteractionTarget[] array = targets; foreach (InteractionTarget interactionTarget in array) { if (interactionTarget.effectorType == effectorType) { return interactionTarget; } } return null; } InteractionTarget[] array2 = targets; foreach (InteractionTarget interactionTarget2 in array2) { if (interactionTarget2.effectorType == effectorType && ((Component)interactionTarget2).CompareTag(((Component)interactionSystem).tag)) { return interactionTarget2; } } return null; } public bool CurveUsed(WeightCurve.Type type) { WeightCurve[] array = weightCurves; foreach (WeightCurve weightCurve in array) { if (weightCurve.type == type) { return true; } } Multiplier[] array2 = multipliers; foreach (Multiplier multiplier in array2) { if (multiplier.result == type) { return true; } } return false; } public InteractionTarget[] GetTargets() { return targets; } public Transform GetTarget(FullBodyBipedEffector effectorType, string tag) { if (tag == string.Empty || tag == "") { return GetTarget(effectorType); } for (int i = 0; i < targets.Length; i++) { if (targets[i].effectorType == effectorType && ((Component)targets[i]).CompareTag(tag)) { return ((Component)targets[i]).transform; } } return ((Component)this).transform; } public void OnStartInteraction(InteractionSystem interactionSystem) { lastUsedInteractionSystem = interactionSystem; } public void Apply(IKSolverFullBodyBiped solver, FullBodyBipedEffector effector, InteractionTarget target, float timer, float weight) { for (int i = 0; i < weightCurves.Length; i++) { float num = ((!((Object)(object)target == (Object)null)) ? target.GetValue(weightCurves[i].type) : 1f); Apply(solver, effector, weightCurves[i].type, weightCurves[i].GetValue(timer), weight * num); } for (int j = 0; j < multipliers.Length; j++) { if (multipliers[j].curve == multipliers[j].result && !Warning.logged) { Warning.Log("InteractionObject Multiplier 'Curve' " + multipliers[j].curve.ToString() + "and 'Result' are the same.", ((Component)this).transform); } int weightCurveIndex = GetWeightCurveIndex(multipliers[j].curve); if (weightCurveIndex != -1) { float num2 = ((!((Object)(object)target == (Object)null)) ? target.GetValue(multipliers[j].result) : 1f); Apply(solver, effector, multipliers[j].result, multipliers[j].GetValue(weightCurves[weightCurveIndex], timer), weight * num2); } else if (!Warning.logged) { Warning.Log("InteractionObject Multiplier curve " + multipliers[j].curve.ToString() + "does not exist.", ((Component)this).transform); } } } public float GetValue(WeightCurve.Type weightCurveType, InteractionTarget target, float timer) { int weightCurveIndex = GetWeightCurveIndex(weightCurveType); if (weightCurveIndex != -1) { float num = ((!((Object)(object)target == (Object)null)) ? target.GetValue(weightCurveType) : 1f); return weightCurves[weightCurveIndex].GetValue(timer) * num; } for (int i = 0; i < multipliers.Length; i++) { if (multipliers[i].result == weightCurveType) { int weightCurveIndex2 = GetWeightCurveIndex(multipliers[i].curve); if (weightCurveIndex2 != -1) { float num2 = ((!((Object)(object)target == (Object)null)) ? target.GetValue(multipliers[i].result) : 1f); return multipliers[i].GetValue(weightCurves[weightCurveIndex2], timer) * num2; } } } return 0f; } private void Start() { Initiate(); } private void Apply(IKSolverFullBodyBiped solver, FullBodyBipedEffector effector, WeightCurve.Type type, float value, float weight) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) switch (type) { case WeightCurve.Type.PositionWeight: solver.GetEffector(effector).positionWeight = Mathf.Lerp(solver.GetEffector(effector).positionWeight, value, weight); break; case WeightCurve.Type.RotationWeight: solver.GetEffector(effector).rotationWeight = Mathf.Lerp(solver.GetEffector(effector).rotationWeight, value, weight); break; case WeightCurve.Type.PositionOffsetX: { IKEffector effector3 = solver.GetEffector(effector); effector3.position += ((!((Object)(object)positionOffsetSpace != (Object)null)) ? solver.GetRoot().rotation : positionOffsetSpace.rotation) * Vector3.right * value * weight; break; } case WeightCurve.Type.PositionOffsetY: { IKEffector effector4 = solver.GetEffector(effector); effector4.position += ((!((Object)(object)positionOffsetSpace != (Object)null)) ? solver.GetRoot().rotation : positionOffsetSpace.rotation) * Vector3.up * value * weight; break; } case WeightCurve.Type.PositionOffsetZ: { IKEffector effector2 = solver.GetEffector(effector); effector2.position += ((!((Object)(object)positionOffsetSpace != (Object)null)) ? solver.GetRoot().rotation : positionOffsetSpace.rotation) * Vector3.forward * value * weight; break; } case WeightCurve.Type.Pull: solver.GetChain(effector).pull = Mathf.Lerp(solver.GetChain(effector).pull, value, weight); break; case WeightCurve.Type.Reach: solver.GetChain(effector).reach = Mathf.Lerp(solver.GetChain(effector).reach, value, weight); break; case WeightCurve.Type.Push: solver.GetChain(effector).push = Mathf.Lerp(solver.GetChain(effector).push, value, weight); break; case WeightCurve.Type.PushParent: solver.GetChain(effector).pushParent = Mathf.Lerp(solver.GetChain(effector).pushParent, value, weight); break; case WeightCurve.Type.BendGoalWeight: solver.GetChain(effector).bendConstraint.weight = Mathf.Lerp(solver.GetChain(effector).bendConstraint.weight, value, weight); break; case WeightCurve.Type.RotateBoneWeight: case WeightCurve.Type.PoserWeight: break; } } private Transform GetTarget(FullBodyBipedEffector effectorType) { for (int i = 0; i < targets.Length; i++) { if (targets[i].effectorType == effectorType) { return ((Component)targets[i]).transform; } } return ((Component)this).transform; } private int GetWeightCurveIndex(WeightCurve.Type weightCurveType) { for (int i = 0; i < weightCurves.Length; i++) { if (weightCurves[i].type == weightCurveType) { return i; } } return -1; } private int GetMultiplierIndex(WeightCurve.Type weightCurveType) { for (int i = 0; i < multipliers.Length; i++) { if (multipliers[i].result == weightCurveType) { return i; } } return -1; } } [HelpURL("https://www.youtube.com/watch?v=r5jiZnsDH3M")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Interaction System/Interaction System")] public class InteractionSystem : MonoBehaviour { public delegate void InteractionDelegate(FullBodyBipedEffector effectorType, InteractionObject interactionObject); public delegate void InteractionEventDelegate(FullBodyBipedEffector effectorType, InteractionObject interactionObject, InteractionObject.InteractionEvent interactionEvent); [Tooltip("If not empty, only the targets with the specified tag will be used by this Interaction System.")] public string targetTag = ""; [Tooltip("The fade in time of the interaction.")] public float fadeInTime = 0.3f; [Tooltip("The master speed for all interactions.")] public float speed = 1f; [Tooltip("If > 0, lerps all the FBBIK channels used by the Interaction System back to their default or initial values when not in interaction.")] public float resetToDefaultsSpeed = 1f; [Header("Triggering")] [Tooltip("The collider that registers OnTriggerEnter and OnTriggerExit events with InteractionTriggers.")] [FormerlySerializedAs("collider")] public Collider characterCollider; [Tooltip("Will be used by Interaction Triggers that need the camera's position. Assign the first person view character camera.")] [FormerlySerializedAs("camera")] public Transform FPSCamera; [Tooltip("The layers that will be raycasted from the camera (along camera.forward). All InteractionTrigger look at target colliders should be included.")] public LayerMask camRaycastLayers; [Tooltip("Max distance of raycasting from the camera.")] public float camRaycastDistance = 1f; private List inContact = new List(); private List bestRangeIndexes = new List(); public InteractionDelegate OnInteractionStart; public InteractionDelegate OnInteractionPause; public InteractionDelegate OnInteractionPickUp; public InteractionDelegate OnInteractionResume; public InteractionDelegate OnInteractionStop; public InteractionEventDelegate OnInteractionEvent; public RaycastHit raycastHit; [Space(10f)] [Tooltip("Reference to the FBBIK component.")] [SerializeField] private FullBodyBipedIK fullBody; [Tooltip("Handles looking at the interactions.")] public InteractionLookAt lookAt = new InteractionLookAt(); private InteractionEffector[] interactionEffectors = new InteractionEffector[9] { new InteractionEffector(FullBodyBipedEffector.Body), new InteractionEffector(FullBodyBipedEffector.LeftFoot), new InteractionEffector(FullBodyBipedEffector.LeftHand), new InteractionEffector(FullBodyBipedEffector.LeftShoulder), new InteractionEffector(FullBodyBipedEffector.LeftThigh), new InteractionEffector(FullBodyBipedEffector.RightFoot), new InteractionEffector(FullBodyBipedEffector.RightHand), new InteractionEffector(FullBodyBipedEffector.RightShoulder), new InteractionEffector(FullBodyBipedEffector.RightThigh) }; private Collider lastCollider; private Collider c; public bool inInteraction { get { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].inInteraction && !interactionEffectors[i].isPaused) { return true; } } return false; } } public FullBodyBipedIK ik { get { return fullBody; } set { fullBody = value; } } public List triggersInRange { get; private set; } public bool initiated { get; private set; } [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page10.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_interaction_system.html"); } [ContextMenu("TUTORIAL VIDEO (PART 1: BASICS)")] private void OpenTutorial1() { Application.OpenURL("https://www.youtube.com/watch?v=r5jiZnsDH3M"); } [ContextMenu("TUTORIAL VIDEO (PART 2: PICKING UP...)")] private void OpenTutorial2() { Application.OpenURL("https://www.youtube.com/watch?v=eP9-zycoHLk"); } [ContextMenu("TUTORIAL VIDEO (PART 3: ANIMATION)")] private void OpenTutorial3() { Application.OpenURL("https://www.youtube.com/watch?v=sQfB2RcT1T4&index=14&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("TUTORIAL VIDEO (PART 4: TRIGGERS)")] private void OpenTutorial4() { Application.OpenURL("https://www.youtube.com/watch?v=-TDZpNjt2mk&index=15&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("Support")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public bool IsInInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].inInteraction && !interactionEffectors[i].isPaused; } } return false; } public bool IsPaused(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].inInteraction && interactionEffectors[i].isPaused; } } return false; } public bool IsPaused() { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].inInteraction && interactionEffectors[i].isPaused) { return true; } } return false; } public bool IsInSync() { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (!interactionEffectors[i].isPaused) { continue; } for (int j = 0; j < interactionEffectors.Length; j++) { if (j != i && interactionEffectors[j].inInteraction && !interactionEffectors[j].isPaused) { return false; } } } return true; } public bool StartInteraction(FullBodyBipedEffector effectorType, InteractionObject interactionObject, bool interrupt) { if (!IsValid(log: true)) { return false; } if ((Object)(object)interactionObject == (Object)null) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Start(interactionObject, targetTag, fadeInTime, interrupt); } } return false; } public bool PauseInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Pause(); } } return false; } public bool ResumeInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Resume(); } } return false; } public bool StopInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Stop(); } } return false; } public void PauseAll() { if (IsValid(log: true)) { for (int i = 0; i < interactionEffectors.Length; i++) { interactionEffectors[i].Pause(); } } } public void ResumeAll() { if (IsValid(log: true)) { for (int i = 0; i < interactionEffectors.Length; i++) { interactionEffectors[i].Resume(); } } } public void StopAll() { for (int i = 0; i < interactionEffectors.Length; i++) { interactionEffectors[i].Stop(); } } public InteractionObject GetInteractionObject(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return null; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].interactionObject; } } return null; } public float GetProgress(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return 0f; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].progress; } } return 0f; } public float GetMinActiveProgress() { if (!IsValid(log: true)) { return 0f; } float num = 1f; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].inInteraction) { float progress = interactionEffectors[i].progress; if (progress > 0f && progress < num) { num = progress; } } } return num; } public bool TriggerInteraction(int index, bool interrupt) { if (!IsValid(log: true)) { return false; } if (!TriggerIndexIsValid(index)) { return false; } bool result = true; InteractionTrigger.Range range = triggersInRange[index].ranges[bestRangeIndexes[index]]; for (int i = 0; i < range.interactions.Length; i++) { for (int j = 0; j < range.interactions[i].effectors.Length; j++) { if (!StartInteraction(range.interactions[i].effectors[j], range.interactions[i].interactionObject, interrupt)) { result = false; } } } return result; } public bool TriggerInteraction(int index, bool interrupt, out InteractionObject interactionObject) { interactionObject = null; if (!IsValid(log: true)) { return false; } if (!TriggerIndexIsValid(index)) { return false; } bool result = true; InteractionTrigger.Range range = triggersInRange[index].ranges[bestRangeIndexes[index]]; for (int i = 0; i < range.interactions.Length; i++) { for (int j = 0; j < range.interactions[i].effectors.Length; j++) { interactionObject = range.interactions[i].interactionObject; if (!StartInteraction(range.interactions[i].effectors[j], interactionObject, interrupt)) { result = false; } } } return result; } public bool TriggerInteraction(int index, bool interrupt, out InteractionTarget interactionTarget) { interactionTarget = null; if (!IsValid(log: true)) { return false; } if (!TriggerIndexIsValid(index)) { return false; } bool result = true; InteractionTrigger.Range range = triggersInRange[index].ranges[bestRangeIndexes[index]]; for (int i = 0; i < range.interactions.Length; i++) { for (int j = 0; j < range.interactions[i].effectors.Length; j++) { InteractionObject interactionObject = range.interactions[i].interactionObject; Transform target = interactionObject.GetTarget(range.interactions[i].effectors[j], ((Component)this).tag); if ((Object)(object)target != (Object)null) { interactionTarget = ((Component)target).GetComponent(); } if (!StartInteraction(range.interactions[i].effectors[j], interactionObject, interrupt)) { result = false; } } } return result; } public InteractionTrigger.Range GetClosestInteractionRange() { if (!IsValid(log: true)) { return null; } int closestTriggerIndex = GetClosestTriggerIndex(); if (closestTriggerIndex < 0 || closestTriggerIndex >= triggersInRange.Count) { return null; } return triggersInRange[closestTriggerIndex].ranges[bestRangeIndexes[closestTriggerIndex]]; } public InteractionObject GetClosestInteractionObjectInRange() { InteractionTrigger.Range closestInteractionRange = GetClosestInteractionRange(); if (closestInteractionRange == null) { return null; } return closestInteractionRange.interactions[0].interactionObject; } public InteractionTarget GetClosestInteractionTargetInRange() { InteractionTrigger.Range closestInteractionRange = GetClosestInteractionRange(); if (closestInteractionRange == null) { return null; } return closestInteractionRange.interactions[0].interactionObject.GetTarget(closestInteractionRange.interactions[0].effectors[0], this); } public InteractionObject[] GetClosestInteractionObjectsInRange() { InteractionTrigger.Range closestInteractionRange = GetClosestInteractionRange(); if (closestInteractionRange == null) { return new InteractionObject[0]; } InteractionObject[] array = new InteractionObject[closestInteractionRange.interactions.Length]; for (int i = 0; i < closestInteractionRange.interactions.Length; i++) { array[i] = closestInteractionRange.interactions[i].interactionObject; } return array; } public InteractionTarget[] GetClosestInteractionTargetsInRange() { InteractionTrigger.Range closestInteractionRange = GetClosestInteractionRange(); if (closestInteractionRange == null) { return new InteractionTarget[0]; } List list = new List(); InteractionTrigger.Range.Interaction[] interactions = closestInteractionRange.interactions; foreach (InteractionTrigger.Range.Interaction interaction in interactions) { FullBodyBipedEffector[] effectors = interaction.effectors; foreach (FullBodyBipedEffector effectorType in effectors) { list.Add(interaction.interactionObject.GetTarget(effectorType, this)); } } return list.ToArray(); } public bool TriggerEffectorsReady(int index) { if (!IsValid(log: true)) { return false; } if (!TriggerIndexIsValid(index)) { return false; } for (int i = 0; i < triggersInRange[index].ranges.Length; i++) { InteractionTrigger.Range range = triggersInRange[index].ranges[i]; for (int j = 0; j < range.interactions.Length; j++) { for (int k = 0; k < range.interactions[j].effectors.Length; k++) { if (IsInInteraction(range.interactions[j].effectors[k])) { return false; } } } for (int l = 0; l < range.interactions.Length; l++) { for (int m = 0; m < range.interactions[l].effectors.Length; m++) { if (!IsPaused(range.interactions[l].effectors[m])) { continue; } for (int n = 0; n < range.interactions[l].effectors.Length; n++) { if (n != m && !IsPaused(range.interactions[l].effectors[n])) { return false; } } } } } return true; } public InteractionTrigger.Range GetTriggerRange(int index) { if (!IsValid(log: true)) { return null; } if (index < 0 || index >= bestRangeIndexes.Count) { Warning.Log("Index out of range.", ((Component)this).transform); return null; } return triggersInRange[index].ranges[bestRangeIndexes[index]]; } public int GetClosestTriggerIndex() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (!IsValid(log: true)) { return -1; } if (triggersInRange.Count == 0) { return -1; } if (triggersInRange.Count == 1) { return 0; } int result = -1; float num = float.PositiveInfinity; for (int i = 0; i < triggersInRange.Count; i++) { if ((Object)(object)triggersInRange[i] != (Object)null) { float num2 = Vector3.SqrMagnitude(((Component)triggersInRange[i]).transform.position - ((Component)this).transform.position); if (num2 < num) { result = i; num = num2; } } } return result; } public void Start() { if ((Object)(object)fullBody == (Object)null) { fullBody = ((Component)this).GetComponent(); } if ((Object)(object)fullBody == (Object)null) { Warning.Log("InteractionSystem can not find a FullBodyBipedIK component", ((Component)this).transform); return; } IKSolverFullBodyBiped solver = fullBody.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreUpdate, new IKSolver.UpdateDelegate(OnPreFBBIK)); IKSolverFullBodyBiped solver2 = fullBody.solver; solver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostFBBIK)); IKSolverFullBodyBiped solver3 = fullBody.solver; solver3.OnFixTransforms = (IKSolver.UpdateDelegate)Delegate.Combine(solver3.OnFixTransforms, new IKSolver.UpdateDelegate(OnFixTransforms)); OnInteractionStart = (InteractionDelegate)Delegate.Combine(OnInteractionStart, new InteractionDelegate(LookAtInteraction)); OnInteractionPause = (InteractionDelegate)Delegate.Combine(OnInteractionPause, new InteractionDelegate(InteractionPause)); OnInteractionResume = (InteractionDelegate)Delegate.Combine(OnInteractionResume, new InteractionDelegate(InteractionResume)); OnInteractionStop = (InteractionDelegate)Delegate.Combine(OnInteractionStop, new InteractionDelegate(InteractionStop)); InteractionEffector[] array = interactionEffectors; foreach (InteractionEffector interactionEffector in array) { interactionEffector.Initiate(this); } triggersInRange = new List(); c = ((Component)this).GetComponent(); UpdateTriggerEventBroadcasting(); initiated = true; } private void InteractionPause(FullBodyBipedEffector effector, InteractionObject interactionObject) { lookAt.isPaused = true; } private void InteractionResume(FullBodyBipedEffector effector, InteractionObject interactionObject) { lookAt.isPaused = false; } private void InteractionStop(FullBodyBipedEffector effector, InteractionObject interactionObject) { lookAt.isPaused = false; } private void LookAtInteraction(FullBodyBipedEffector effector, InteractionObject interactionObject) { lookAt.Look(interactionObject.lookAtTarget, Time.time + interactionObject.length * 0.5f); } public void OnTriggerEnter(Collider c) { if (!((Object)(object)fullBody == (Object)null)) { InteractionTrigger component = ((Component)c).GetComponent(); if (!((Object)(object)component == (Object)null) && !inContact.Contains(component)) { inContact.Add(component); } } } public void OnTriggerExit(Collider c) { if (!((Object)(object)fullBody == (Object)null)) { InteractionTrigger component = ((Component)c).GetComponent(); if (!((Object)(object)component == (Object)null)) { inContact.Remove(component); } } } private bool ContactIsInRange(int index, out int bestRangeIndex) { //IL_0092: Unknown result type (might be due to invalid IL or missing references) bestRangeIndex = -1; if (!IsValid(log: true)) { return false; } if (index < 0 || index >= inContact.Count) { Warning.Log("Index out of range.", ((Component)this).transform); return false; } if ((Object)(object)inContact[index] == (Object)null) { Warning.Log("The InteractionTrigger in the list 'inContact' has been destroyed", ((Component)this).transform); return false; } bestRangeIndex = inContact[index].GetBestRangeIndex(((Component)this).transform, FPSCamera, raycastHit); if (bestRangeIndex == -1) { return false; } return true; } private void OnDrawGizmosSelected() { if (!Application.isPlaying) { if ((Object)(object)fullBody == (Object)null) { fullBody = ((Component)this).GetComponent(); } if ((Object)(object)characterCollider == (Object)null) { characterCollider = ((Component)this).GetComponent(); } } } public void Update() { if ((Object)(object)fullBody == (Object)null) { return; } UpdateTriggerEventBroadcasting(); Raycasting(); triggersInRange.Clear(); bestRangeIndexes.Clear(); for (int i = 0; i < inContact.Count; i++) { int bestRangeIndex = -1; if ((Object)(object)inContact[i] != (Object)null && ((Component)inContact[i]).gameObject.activeInHierarchy && ContactIsInRange(i, out bestRangeIndex)) { triggersInRange.Add(inContact[i]); bestRangeIndexes.Add(bestRangeIndex); } } lookAt.Update(); } private void Raycasting() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (LayerMask.op_Implicit(camRaycastLayers) != -1 && !((Object)(object)FPSCamera == (Object)null)) { Physics.Raycast(FPSCamera.position, FPSCamera.forward, ref raycastHit, camRaycastDistance, LayerMask.op_Implicit(camRaycastLayers)); } } private void UpdateTriggerEventBroadcasting() { if ((Object)(object)characterCollider == (Object)null) { characterCollider = c; } if ((Object)(object)characterCollider != (Object)null && (Object)(object)characterCollider != (Object)(object)c) { if ((Object)(object)((Component)characterCollider).GetComponent() == (Object)null) { TriggerEventBroadcaster triggerEventBroadcaster = ((Component)characterCollider).gameObject.AddComponent(); triggerEventBroadcaster.target = ((Component)this).gameObject; } if ((Object)(object)lastCollider != (Object)null && (Object)(object)lastCollider != (Object)(object)c && (Object)(object)lastCollider != (Object)(object)characterCollider) { TriggerEventBroadcaster component = ((Component)lastCollider).GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } } lastCollider = characterCollider; } private void UpdateEffectors() { if (!((Object)(object)fullBody == (Object)null)) { for (int i = 0; i < interactionEffectors.Length; i++) { interactionEffectors[i].Update(((Component)this).transform, speed); } for (int j = 0; j < interactionEffectors.Length; j++) { interactionEffectors[j].ResetToDefaults(resetToDefaultsSpeed * speed); } } } private void OnPreFBBIK() { if (!((Object)(object)fullBody == (Object)null)) { lookAt.SolveSpine(); UpdateEffectors(); } } private void OnPostFBBIK() { if (!((Object)(object)fullBody == (Object)null)) { for (int i = 0; i < interactionEffectors.Length; i++) { interactionEffectors[i].OnPostFBBIK(); } lookAt.SolveHead(); } } private void OnFixTransforms() { lookAt.OnFixTransforms(); } private void OnDestroy() { if (!((Object)(object)fullBody == (Object)null)) { IKSolverFullBodyBiped solver = fullBody.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreUpdate, new IKSolver.UpdateDelegate(OnPreFBBIK)); IKSolverFullBodyBiped solver2 = fullBody.solver; solver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostFBBIK)); IKSolverFullBodyBiped solver3 = fullBody.solver; solver3.OnFixTransforms = (IKSolver.UpdateDelegate)Delegate.Remove(solver3.OnFixTransforms, new IKSolver.UpdateDelegate(OnFixTransforms)); OnInteractionStart = (InteractionDelegate)Delegate.Remove(OnInteractionStart, new InteractionDelegate(LookAtInteraction)); OnInteractionPause = (InteractionDelegate)Delegate.Remove(OnInteractionPause, new InteractionDelegate(InteractionPause)); OnInteractionResume = (InteractionDelegate)Delegate.Remove(OnInteractionResume, new InteractionDelegate(InteractionResume)); OnInteractionStop = (InteractionDelegate)Delegate.Remove(OnInteractionStop, new InteractionDelegate(InteractionStop)); } } private bool IsValid(bool log) { if ((Object)(object)fullBody == (Object)null) { if (log) { Warning.Log("FBBIK is null. Will not update the InteractionSystem", ((Component)this).transform); } return false; } if (!initiated) { if (log) { Warning.Log("The InteractionSystem has not been initiated yet.", ((Component)this).transform); } return false; } return true; } private bool TriggerIndexIsValid(int index) { if (index < 0 || index >= triggersInRange.Count) { Warning.Log("Index out of range.", ((Component)this).transform); return false; } if ((Object)(object)triggersInRange[index] == (Object)null) { Warning.Log("The InteractionTrigger in the list 'inContact' has been destroyed", ((Component)this).transform); return false; } return true; } } [HelpURL("https://www.youtube.com/watch?v=r5jiZnsDH3M")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Interaction System/Interaction Target")] public class InteractionTarget : MonoBehaviour { [Serializable] public enum RotationMode { TwoDOF, ThreeDOF } [Serializable] public class Multiplier { [Tooltip("The curve type (InteractionObject.WeightCurve.Type).")] public InteractionObject.WeightCurve.Type curve; [Tooltip("Multiplier of the curve's value.")] public float multiplier; } [Tooltip("The type of the FBBIK effector.")] public FullBodyBipedEffector effectorType; [Tooltip("InteractionObject weight curve multipliers for this effector target.")] public Multiplier[] multipliers; [Tooltip("The interaction speed multiplier for this effector. This can be used to make interactions faster/slower for specific effectors.")] public float interactionSpeedMlp = 1f; [Tooltip("The pivot to twist/swing this interaction target about. For symmetric objects that can be interacted with from a certain angular range.")] public Transform pivot; [Tooltip("2 or 3 degrees of freedom to match this InteractionTarget's rotation to the effector bone rotation.")] public RotationMode rotationMode; [Tooltip("The axis of twisting the interaction target (blue line).")] public Vector3 twistAxis = Vector3.up; [Tooltip("The weight of twisting the interaction target towards the effector bone in the start of the interaction.")] public float twistWeight = 1f; [Tooltip("The weight of swinging the interaction target towards the effector bone in the start of the interaction. Swing is defined as a 3-DOF rotation around any axis, while twist is only around the twist axis.")] public float swingWeight; [Tooltip("The weight of rotating this InteractionTarget to the effector bone in the start of the interaction (and during if 'Rotate Once' is disabled")] [Range(0f, 1f)] public float threeDOFWeight = 1f; [Tooltip("If true, will twist/swing around the pivot only once at the start of the interaction. If false, will continue rotating throuout the whole interaction.")] public bool rotateOnce = true; private Quaternion defaultLocalRotation; private Transform lastPivot; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page10.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_interaction_target.html"); } [ContextMenu("TUTORIAL VIDEO (PART 1: BASICS)")] private void OpenTutorial1() { Application.OpenURL("https://www.youtube.com/watch?v=r5jiZnsDH3M"); } [ContextMenu("TUTORIAL VIDEO (PART 2: PICKING UP...)")] private void OpenTutorial2() { Application.OpenURL("https://www.youtube.com/watch?v=eP9-zycoHLk"); } [ContextMenu("TUTORIAL VIDEO (PART 3: ANIMATION)")] private void OpenTutorial3() { Application.OpenURL("https://www.youtube.com/watch?v=sQfB2RcT1T4&index=14&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("TUTORIAL VIDEO (PART 4: TRIGGERS)")] private void OpenTutorial4() { Application.OpenURL("https://www.youtube.com/watch?v=-TDZpNjt2mk&index=15&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public float GetValue(InteractionObject.WeightCurve.Type curveType) { for (int i = 0; i < multipliers.Length; i++) { if (multipliers[i].curve == curveType) { return multipliers[i].multiplier; } } return 1f; } public void ResetRotation() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pivot != (Object)null) { pivot.localRotation = defaultLocalRotation; } } public void RotateTo(Transform bone) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pivot == (Object)null) { return; } if ((Object)(object)pivot != (Object)(object)lastPivot) { defaultLocalRotation = pivot.localRotation; lastPivot = pivot; } pivot.localRotation = defaultLocalRotation; switch (rotationMode) { case RotationMode.TwoDOF: if (twistWeight > 0f) { Vector3 fromDirection = ((Component)this).transform.position - pivot.position; Vector3 val2 = pivot.rotation * twistAxis; Vector3 val3 = val2; Vector3.OrthoNormalize(ref val3, ref fromDirection); val3 = val2; Vector3 toDirection = bone.position - pivot.position; Vector3.OrthoNormalize(ref val3, ref toDirection); Quaternion val4 = QuaTools.FromToAroundAxis(fromDirection, toDirection, val2); pivot.rotation = Quaternion.Lerp(Quaternion.identity, val4, twistWeight) * pivot.rotation; } if (swingWeight > 0f) { Quaternion val5 = Quaternion.FromToRotation(((Component)this).transform.position - pivot.position, bone.position - pivot.position); pivot.rotation = Quaternion.Lerp(Quaternion.identity, val5, swingWeight) * pivot.rotation; } break; case RotationMode.ThreeDOF: if (!(threeDOFWeight <= 0f)) { Quaternion val = QuaTools.FromToRotation(((Component)this).transform.rotation, bone.rotation); if (threeDOFWeight >= 1f) { pivot.rotation = val * pivot.rotation; } else { pivot.rotation = Quaternion.Slerp(Quaternion.identity, val, threeDOFWeight) * pivot.rotation; } } break; } } } [HelpURL("https://www.youtube.com/watch?v=-TDZpNjt2mk&index=15&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Interaction System/Interaction Trigger")] public class InteractionTrigger : MonoBehaviour { [Serializable] public class CharacterPosition { [Tooltip("If false, will not care where the character stands, as long as it is in contact with the trigger collider.")] public bool use; [Tooltip("The offset of the character's position relative to the trigger in XZ plane. Y position of the character is unlimited as long as it is contact with the collider.")] public Vector2 offset; [Tooltip("Angle offset from the default forward direction.")] [Range(-180f, 180f)] public float angleOffset; [Tooltip("Max angular offset of the character's forward from the direction of this trigger.")] [Range(0f, 180f)] public float maxAngle = 45f; [Tooltip("Max offset of the character's position from this range's center.")] public float radius = 0.5f; [Tooltip("If true, will rotate the trigger around it's Y axis relative to the position of the character, so the object can be interacted with from all sides.")] public bool orbit; [Tooltip("Fixes the Y axis of the trigger to Vector3.up. This makes the trigger symmetrical relative to the object. For example a gun will be able to be picked up from the same direction relative to the barrel no matter which side the gun is resting on.")] public bool fixYAxis; public Vector3 offset3D => new Vector3(offset.x, 0f, offset.y); public Vector3 direction3D => Quaternion.AngleAxis(angleOffset, Vector3.up) * Vector3.forward; public bool IsInRange(Transform character, Transform trigger, out float error) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) error = 0f; if (!use) { return true; } error = 180f; if (radius <= 0f) { return false; } if (maxAngle <= 0f) { return false; } Vector3 forward = trigger.forward; if (fixYAxis) { forward.y = 0f; } if (forward == Vector3.zero) { return false; } Vector3 val = ((!fixYAxis) ? trigger.up : Vector3.up); Quaternion val2 = Quaternion.LookRotation(forward, val); Vector3 val3 = trigger.position + val2 * offset3D; Vector3 val4 = ((!orbit) ? val3 : trigger.position); Vector3 val5 = character.position - val4; Vector3.OrthoNormalize(ref val, ref val5); Vector3 val6 = val5; Vector3 val7 = Vector3.Project(character.position - val4, val5); val5 = val6 * ((Vector3)(ref val7)).magnitude; if (orbit) { float magnitude = ((Vector2)(ref offset)).magnitude; float magnitude2 = ((Vector3)(ref val5)).magnitude; if (magnitude2 < magnitude - radius || magnitude2 > magnitude + radius) { return false; } } else if (((Vector3)(ref val5)).magnitude > radius) { return false; } Vector3 val8 = val2 * direction3D; Vector3.OrthoNormalize(ref val, ref val8); if (orbit) { Vector3 val9 = val3 - trigger.position; if (val9 == Vector3.zero) { val9 = Vector3.forward; } Quaternion val10 = Quaternion.LookRotation(val9, val); val5 = Quaternion.Inverse(val10) * val5; float num = Mathf.Atan2(val5.x, val5.z) * 57.29578f; val8 = Quaternion.AngleAxis(num, val) * val8; } float num2 = Vector3.Angle(val8, character.forward); if (num2 > maxAngle) { return false; } error = num2 / maxAngle * 180f; return true; } } [Serializable] public class CameraPosition { [Tooltip("What the camera should be looking at to trigger the interaction? If null, this camera position will not be used.")] public Collider lookAtTarget; [Tooltip("The direction from the lookAtTarget towards the camera (in lookAtTarget's space).")] public Vector3 direction = -Vector3.forward; [Tooltip("Max distance from the lookAtTarget to the camera.")] public float maxDistance = 0.5f; [Tooltip("Max angle between the direction and the direction towards the camera.")] [Range(0f, 180f)] public float maxAngle = 45f; [Tooltip("Fixes the Y axis of the trigger to Vector3.up. This makes the trigger symmetrical relative to the object.")] public bool fixYAxis; public Quaternion GetRotation() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) Vector3 forward = ((Component)lookAtTarget).transform.forward; if (fixYAxis) { forward.y = 0f; } if (forward == Vector3.zero) { return Quaternion.identity; } Vector3 val = ((!fixYAxis) ? ((Component)lookAtTarget).transform.up : Vector3.up); return Quaternion.LookRotation(forward, val); } public bool IsInRange(Transform raycastFrom, RaycastHit hit, Transform trigger, out float error) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) error = 0f; if ((Object)(object)lookAtTarget == (Object)null) { return true; } error = 180f; if ((Object)(object)raycastFrom == (Object)null) { return false; } if ((Object)(object)((RaycastHit)(ref hit)).collider != (Object)(object)lookAtTarget) { return false; } if (((RaycastHit)(ref hit)).distance > maxDistance) { return false; } if (direction == Vector3.zero) { return false; } if (maxDistance <= 0f) { return false; } if (maxAngle <= 0f) { return false; } Vector3 val = GetRotation() * direction; float num = Vector3.Angle(raycastFrom.position - ((RaycastHit)(ref hit)).point, val); if (num > maxAngle) { return false; } error = num / maxAngle * 180f; return true; } } [Serializable] public class Range { [Serializable] public class Interaction { [Tooltip("The InteractionObject to interact with.")] public InteractionObject interactionObject; [Tooltip("The effectors to interact with.")] public FullBodyBipedEffector[] effectors; } [HideInInspector] public string name; [HideInInspector] public bool show = true; [Tooltip("The range for the character's position and rotation.")] public CharacterPosition characterPosition; [Tooltip("The range for the character camera's position and rotation.")] public CameraPosition cameraPosition; [Tooltip("Definitions of the interactions associated with this range.")] public Interaction[] interactions; public bool IsInRange(Transform character, Transform raycastFrom, RaycastHit raycastHit, Transform trigger, out float maxError) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) maxError = 0f; float error = 0f; float error2 = 0f; if (!characterPosition.IsInRange(character, trigger, out error)) { return false; } if (!cameraPosition.IsInRange(raycastFrom, raycastHit, trigger, out error2)) { return false; } maxError = Mathf.Max(error, error2); return true; } } [Tooltip("The valid ranges of the character's and/or it's camera's position for triggering interaction when the character is in contact with the collider of this trigger.")] public Range[] ranges = new Range[0]; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page10.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_interaction_trigger.html"); } [ContextMenu("TUTORIAL VIDEO")] private void OpenTutorial4() { Application.OpenURL("https://www.youtube.com/watch?v=-TDZpNjt2mk&index=15&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public int GetBestRangeIndex(Transform character, Transform raycastFrom, RaycastHit raycastHit) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)this).GetComponent() == (Object)null) { Warning.Log("Using the InteractionTrigger requires a Collider component.", ((Component)this).transform); return -1; } int result = -1; float num = 180f; float maxError = 0f; for (int i = 0; i < ranges.Length; i++) { if (ranges[i].IsInRange(character, raycastFrom, raycastHit, ((Component)this).transform, out maxError) && maxError <= num) { num = maxError; result = i; } } return result; } } public class GenericPoser : Poser { [Serializable] public class Map { public Transform bone; public Transform target; private Vector3 defaultLocalPosition; private Quaternion defaultLocalRotation; public Map(Transform bone, Transform target) { this.bone = bone; this.target = target; StoreDefaultState(); } public void StoreDefaultState() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) defaultLocalPosition = bone.localPosition; defaultLocalRotation = bone.localRotation; } public void FixTransform() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) bone.localPosition = defaultLocalPosition; bone.localRotation = defaultLocalRotation; } public void Update(float localRotationWeight, float localPositionWeight) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) bone.localRotation = Quaternion.Lerp(bone.localRotation, target.localRotation, localRotationWeight); bone.localPosition = Vector3.Lerp(bone.localPosition, target.localPosition, localPositionWeight); } } public Map[] maps; [ContextMenu("Auto-Mapping")] public override void AutoMapping() { if ((Object)(object)poseRoot == (Object)null) { maps = new Map[0]; return; } maps = new Map[0]; Transform[] componentsInChildren = ((Component)((Component)this).transform).GetComponentsInChildren(); Transform[] componentsInChildren2 = ((Component)poseRoot).GetComponentsInChildren(); for (int i = 1; i < componentsInChildren.Length; i++) { Transform targetNamed = GetTargetNamed(((Object)componentsInChildren[i]).name, componentsInChildren2); if ((Object)(object)targetNamed != (Object)null) { Array.Resize(ref maps, maps.Length + 1); maps[maps.Length - 1] = new Map(componentsInChildren[i], targetNamed); } } StoreDefaultState(); } protected override void InitiatePoser() { StoreDefaultState(); } protected override void UpdatePoser() { if (!(weight <= 0f) && (!(localPositionWeight <= 0f) || !(localRotationWeight <= 0f)) && !((Object)(object)poseRoot == (Object)null)) { float num = localRotationWeight * weight; float num2 = localPositionWeight * weight; for (int i = 0; i < maps.Length; i++) { maps[i].Update(num, num2); } } } protected override void FixPoserTransforms() { for (int i = 0; i < maps.Length; i++) { maps[i].FixTransform(); } } private void StoreDefaultState() { for (int i = 0; i < maps.Length; i++) { maps[i].StoreDefaultState(); } } private Transform GetTargetNamed(string tName, Transform[] array) { for (int i = 0; i < array.Length; i++) { if (((Object)array[i]).name == tName) { return array[i]; } } return null; } } public class HandPoser : Poser { protected Transform[] children; private Transform _poseRoot; private Transform[] poseChildren; private Vector3[] defaultLocalPositions; private Quaternion[] defaultLocalRotations; public override void AutoMapping() { if ((Object)(object)poseRoot == (Object)null) { poseChildren = (Transform[])(object)new Transform[0]; } else { poseChildren = ((Component)poseRoot).GetComponentsInChildren(); } _poseRoot = poseRoot; } protected override void InitiatePoser() { children = ((Component)this).GetComponentsInChildren(); StoreDefaultState(); } protected override void FixPoserTransforms() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < children.Length; i++) { children[i].localPosition = defaultLocalPositions[i]; children[i].localRotation = defaultLocalRotations[i]; } } protected override void UpdatePoser() { //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f || (localPositionWeight <= 0f && localRotationWeight <= 0f)) { return; } if ((Object)(object)_poseRoot != (Object)(object)poseRoot) { AutoMapping(); } if ((Object)(object)poseRoot == (Object)null) { return; } if (children.Length != poseChildren.Length) { Warning.Log("Number of children does not match with the pose", ((Component)this).transform); return; } float num = localRotationWeight * weight; float num2 = localPositionWeight * weight; for (int i = 0; i < children.Length; i++) { if ((Object)(object)children[i] != (Object)(object)((Component)this).transform) { children[i].localRotation = Quaternion.Lerp(children[i].localRotation, poseChildren[i].localRotation, num); children[i].localPosition = Vector3.Lerp(children[i].localPosition, poseChildren[i].localPosition, num2); } } } protected void StoreDefaultState() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) defaultLocalPositions = (Vector3[])(object)new Vector3[children.Length]; defaultLocalRotations = (Quaternion[])(object)new Quaternion[children.Length]; for (int i = 0; i < children.Length; i++) { ref Vector3 reference = ref defaultLocalPositions[i]; reference = children[i].localPosition; ref Quaternion reference2 = ref defaultLocalRotations[i]; reference2 = children[i].localRotation; } } } public abstract class Poser : SolverManager { public Transform poseRoot; [Range(0f, 1f)] public float weight = 1f; [Range(0f, 1f)] public float localRotationWeight = 1f; [Range(0f, 1f)] public float localPositionWeight; private bool initiated; public abstract void AutoMapping(); public void UpdateManual() { UpdatePoser(); } protected abstract void InitiatePoser(); protected abstract void UpdatePoser(); protected abstract void FixPoserTransforms(); protected override void UpdateSolver() { if (!initiated) { InitiateSolver(); } if (initiated) { UpdatePoser(); } } protected override void InitiateSolver() { if (!initiated) { InitiatePoser(); initiated = true; } } protected override void FixTransforms() { if (initiated) { FixPoserTransforms(); } } } public class RagdollUtility : MonoBehaviour { public class Rigidbone { public Rigidbody r; public Transform t; public Collider collider; public Joint joint; public Rigidbody c; public bool updateAnchor; public Vector3 deltaPosition; public Quaternion deltaRotation; public float deltaTime; public Vector3 lastPosition; public Quaternion lastRotation; public Rigidbone(Rigidbody r) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) this.r = r; t = ((Component)r).transform; joint = ((Component)t).GetComponent(); collider = ((Component)t).GetComponent(); if ((Object)(object)joint != (Object)null) { c = joint.connectedBody; updateAnchor = (Object)(object)c != (Object)null; } lastPosition = t.position; lastRotation = t.rotation; } public void RecordVelocity() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) deltaPosition = t.position - lastPosition; lastPosition = t.position; deltaRotation = QuaTools.FromToRotation(lastRotation, t.rotation); lastRotation = t.rotation; deltaTime = Time.deltaTime; } public void WakeUp(float velocityWeight, float angularVelocityWeight) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) if (updateAnchor) { joint.connectedAnchor = t.InverseTransformPoint(c.position); } r.isKinematic = false; if (velocityWeight != 0f) { r.velocity = deltaPosition / deltaTime * velocityWeight; } if (angularVelocityWeight != 0f) { float num = 0f; Vector3 zero = Vector3.zero; ((Quaternion)(ref deltaRotation)).ToAngleAxis(ref num, ref zero); num *= (float)Math.PI / 180f; num /= deltaTime; zero *= num * angularVelocityWeight; r.angularVelocity = Vector3.ClampMagnitude(zero, r.maxAngularVelocity); } r.WakeUp(); } } public class Child { public Transform t; public Vector3 localPosition; public Quaternion localRotation; public Child(Transform transform) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) t = transform; localPosition = t.localPosition; localRotation = t.localRotation; } public void FixTransform(float weight) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { if (weight >= 1f) { t.localPosition = localPosition; t.localRotation = localRotation; } else { t.localPosition = Vector3.Lerp(t.localPosition, localPosition, weight); t.localRotation = Quaternion.Lerp(t.localRotation, localRotation, weight); } } } public void StoreLocalState() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) localPosition = t.localPosition; localRotation = t.localRotation; } } [Tooltip("If you have multiple IK components, then this should be the one that solves last each frame.")] public IK ik; [Tooltip("How long does it take to blend from ragdoll to animation?")] public float ragdollToAnimationTime = 0.2f; [Tooltip("If true, IK can be used on top of physical ragdoll simulation.")] public bool applyIkOnRagdoll; [Tooltip("How much velocity transfer from animation to ragdoll?")] public float applyVelocity = 1f; [Tooltip("How much angular velocity to transfer from animation to ragdoll?")] public float applyAngularVelocity = 1f; private Animator animator; private Rigidbone[] rigidbones = new Rigidbone[0]; private Child[] children = new Child[0]; private bool enableRagdollFlag; private AnimatorUpdateMode animatorUpdateMode; private IK[] allIKComponents = new IK[0]; private bool[] fixTransforms = new bool[0]; private float ragdollWeight; private float ragdollWeightV; private bool fixedFrame; private bool[] disabledIKComponents = new bool[0]; private bool isRagdoll => !rigidbones[0].r.isKinematic && !((Behaviour)animator).enabled; private bool ikUsed { get { if ((Object)(object)ik == (Object)null) { return false; } if (((Behaviour)ik).enabled && ik.GetIKSolver().IKPositionWeight > 0f) { return true; } IK[] array = allIKComponents; foreach (IK iK in array) { if (((Behaviour)iK).enabled && iK.GetIKSolver().IKPositionWeight > 0f) { return true; } } return false; } } public void EnableRagdoll() { if (!isRagdoll) { ((MonoBehaviour)this).StopAllCoroutines(); enableRagdollFlag = true; } } public void DisableRagdoll() { if (isRagdoll) { StoreLocalState(); ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(DisableRagdollSmooth()); } } public void Start() { animator = ((Component)this).GetComponent(); allIKComponents = ((Component)this).GetComponentsInChildren(); disabledIKComponents = new bool[allIKComponents.Length]; fixTransforms = new bool[allIKComponents.Length]; if ((Object)(object)ik != (Object)null) { IKSolver iKSolver = ik.GetIKSolver(); iKSolver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver.OnPostUpdate, new IKSolver.UpdateDelegate(AfterLastIK)); } Rigidbody[] componentsInChildren = ((Component)this).GetComponentsInChildren(); int num = (((Object)(object)((Component)componentsInChildren[0]).gameObject == (Object)(object)((Component)this).gameObject) ? 1 : 0); rigidbones = new Rigidbone[(num != 0) ? (componentsInChildren.Length - 1) : componentsInChildren.Length]; for (int i = 0; i < rigidbones.Length; i++) { rigidbones[i] = new Rigidbone(componentsInChildren[i + num]); } Transform[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(); children = new Child[componentsInChildren2.Length - 1]; for (int j = 0; j < children.Length; j++) { children[j] = new Child(componentsInChildren2[j + 1]); } } private IEnumerator DisableRagdollSmooth() { for (int i = 0; i < rigidbones.Length; i++) { rigidbones[i].r.isKinematic = true; } for (int j = 0; j < allIKComponents.Length; j++) { allIKComponents[j].fixTransforms = fixTransforms[j]; if (disabledIKComponents[j]) { ((Behaviour)allIKComponents[j]).enabled = true; } } animator.updateMode = animatorUpdateMode; ((Behaviour)animator).enabled = true; while (ragdollWeight > 0f) { ragdollWeight = Mathf.SmoothDamp(ragdollWeight, 0f, ref ragdollWeightV, ragdollToAnimationTime); if (ragdollWeight < 0.001f) { ragdollWeight = 0f; } yield return null; } yield return null; } private void Update() { if (!isRagdoll) { return; } if (!applyIkOnRagdoll) { bool flag = false; for (int i = 0; i < allIKComponents.Length; i++) { if (((Behaviour)allIKComponents[i]).enabled) { flag = true; break; } } if (flag) { for (int j = 0; j < allIKComponents.Length; j++) { disabledIKComponents[j] = false; } } for (int k = 0; k < allIKComponents.Length; k++) { if (((Behaviour)allIKComponents[k]).enabled) { ((Behaviour)allIKComponents[k]).enabled = false; disabledIKComponents[k] = true; } } return; } bool flag2 = false; for (int l = 0; l < allIKComponents.Length; l++) { if (disabledIKComponents[l]) { flag2 = true; break; } } if (!flag2) { return; } for (int m = 0; m < allIKComponents.Length; m++) { if (disabledIKComponents[m]) { ((Behaviour)allIKComponents[m]).enabled = true; } } for (int n = 0; n < allIKComponents.Length; n++) { disabledIKComponents[n] = false; } } private void FixedUpdate() { if (isRagdoll && applyIkOnRagdoll) { FixTransforms(1f); } fixedFrame = true; } private void LateUpdate() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 if ((int)animator.updateMode != 1 || ((int)animator.updateMode == 1 && fixedFrame)) { AfterAnimation(); } fixedFrame = false; if (!ikUsed) { OnFinalPose(); } } private void AfterLastIK() { if (ikUsed) { OnFinalPose(); } } private void AfterAnimation() { if (isRagdoll) { StoreLocalState(); } else { FixTransforms(ragdollWeight); } } private void OnFinalPose() { if (!isRagdoll) { RecordVelocities(); } if (enableRagdollFlag) { RagdollEnabler(); } } private void RagdollEnabler() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) StoreLocalState(); for (int i = 0; i < allIKComponents.Length; i++) { disabledIKComponents[i] = false; } if (!applyIkOnRagdoll) { for (int j = 0; j < allIKComponents.Length; j++) { if (((Behaviour)allIKComponents[j]).enabled) { ((Behaviour)allIKComponents[j]).enabled = false; disabledIKComponents[j] = true; } } } animatorUpdateMode = animator.updateMode; animator.updateMode = (AnimatorUpdateMode)1; ((Behaviour)animator).enabled = false; for (int k = 0; k < rigidbones.Length; k++) { rigidbones[k].WakeUp(applyVelocity, applyAngularVelocity); } for (int l = 0; l < fixTransforms.Length; l++) { fixTransforms[l] = allIKComponents[l].fixTransforms; allIKComponents[l].fixTransforms = false; } ragdollWeight = 1f; ragdollWeightV = 0f; enableRagdollFlag = false; } private void RecordVelocities() { Rigidbone[] array = rigidbones; foreach (Rigidbone rigidbone in array) { rigidbone.RecordVelocity(); } } private void StoreLocalState() { Child[] array = children; foreach (Child child in array) { child.StoreLocalState(); } } private void FixTransforms(float weight) { Child[] array = children; foreach (Child child in array) { child.FixTransform(weight); } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolver iKSolver = ik.GetIKSolver(); iKSolver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver.OnPostUpdate, new IKSolver.UpdateDelegate(AfterLastIK)); } } } public abstract class RotationLimit : MonoBehaviour { public Vector3 axis = Vector3.forward; [HideInInspector] public Quaternion defaultLocalRotation; private bool initiated; private bool applicationQuit; private bool defaultLocalRotationSet; public Vector3 secondaryAxis => new Vector3(axis.y, axis.z, axis.x); public Vector3 crossAxis => Vector3.Cross(axis, secondaryAxis); public bool defaultLocalRotationOverride { get; private set; } public void SetDefaultLocalRotation() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) defaultLocalRotation = ((Component)this).transform.localRotation; defaultLocalRotationSet = true; defaultLocalRotationOverride = false; } public void SetDefaultLocalRotation(Quaternion localRotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) defaultLocalRotation = localRotation; defaultLocalRotationSet = true; defaultLocalRotationOverride = true; } public Quaternion GetLimitedLocalRotation(Quaternion localRotation, out bool changed) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { Awake(); } Quaternion val = Quaternion.Inverse(defaultLocalRotation) * localRotation; Quaternion val2 = LimitRotation(val); changed = val2 != val; if (!changed) { return localRotation; } return defaultLocalRotation * val2; } public bool Apply() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) bool changed = false; ((Component)this).transform.localRotation = GetLimitedLocalRotation(((Component)this).transform.localRotation, out changed); return changed; } public void Disable() { if (initiated) { ((Behaviour)this).enabled = false; return; } Awake(); ((Behaviour)this).enabled = false; } protected abstract Quaternion LimitRotation(Quaternion rotation); private void Awake() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (!defaultLocalRotationSet) { SetDefaultLocalRotation(); } if (axis == Vector3.zero) { Debug.LogError((object)"Axis is Vector3.zero."); } initiated = true; } private void LateUpdate() { Apply(); } public void LogWarning(string message) { Warning.Log(message, ((Component)this).transform); } protected static Quaternion Limit1DOF(Quaternion rotation, Vector3 axis) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return Quaternion.FromToRotation(rotation * axis, axis) * rotation; } protected static Quaternion LimitTwist(Quaternion rotation, Vector3 axis, Vector3 orthoAxis, float twistLimit) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) twistLimit = Mathf.Clamp(twistLimit, 0f, 180f); if (twistLimit >= 180f) { return rotation; } Vector3 val = rotation * axis; Vector3 val2 = orthoAxis; Vector3.OrthoNormalize(ref val, ref val2); Vector3 val3 = rotation * orthoAxis; Vector3.OrthoNormalize(ref val, ref val3); Quaternion val4 = Quaternion.FromToRotation(val3, val2) * rotation; if (twistLimit <= 0f) { return val4; } return Quaternion.RotateTowards(val4, rotation, twistLimit); } protected static float GetOrthogonalAngle(Vector3 v1, Vector3 v2, Vector3 normal) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) Vector3.OrthoNormalize(ref normal, ref v1); Vector3.OrthoNormalize(ref normal, ref v2); return Vector3.Angle(v1, v2); } } [HelpURL("http://www.root-motion.com/finalikdox/html/page14.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Rotation Limits/Rotation Limit Angle")] public class RotationLimitAngle : RotationLimit { [Range(0f, 180f)] public float limit = 45f; [Range(0f, 180f)] public float twistLimit = 180f; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page14.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_rotation_limit_angle.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } protected override Quaternion LimitRotation(Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation2 = LimitSwing(rotation); return RotationLimit.LimitTwist(rotation2, axis, base.secondaryAxis, twistLimit); } private Quaternion LimitSwing(Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (axis == Vector3.zero) { return rotation; } if (rotation == Quaternion.identity) { return rotation; } if (limit >= 180f) { return rotation; } Vector3 val = rotation * axis; Quaternion val2 = Quaternion.FromToRotation(axis, val); Quaternion val3 = Quaternion.RotateTowards(Quaternion.identity, val2, limit); Quaternion val4 = Quaternion.FromToRotation(val, val3 * axis); return val4 * rotation; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page14.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Rotation Limits/Rotation Limit Hinge")] public class RotationLimitHinge : RotationLimit { public bool useLimits = true; public float min = -45f; public float max = 90f; [HideInInspector] public float zeroAxisDisplayOffset; private float lastAngle; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page14.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_rotation_limit_hinge.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } protected override Quaternion LimitRotation(Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return LimitHinge(rotation); } private Quaternion LimitHinge(Quaternion rotation) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (min == 0f && max == 0f && useLimits) { return Quaternion.AngleAxis(0f, axis); } Quaternion val = RotationLimit.Limit1DOF(rotation, axis); if (!useLimits) { return val; } Quaternion val2 = Quaternion.Inverse(Quaternion.AngleAxis(lastAngle, axis) * Quaternion.LookRotation(base.secondaryAxis, axis)); Vector3 val3 = val2 * val * base.secondaryAxis; float num = Mathf.Atan2(val3.x, val3.z) * 57.29578f; lastAngle = Mathf.Clamp(lastAngle + num, min, max); return Quaternion.AngleAxis(lastAngle, axis); } } [HelpURL("http://www.root-motion.com/finalikdox/html/page14.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Rotation Limits/Rotation Limit Polygonal")] public class RotationLimitPolygonal : RotationLimit { [Serializable] public class ReachCone { public Vector3[] tetrahedron; public float volume; public Vector3 S; public Vector3 B; public Vector3 o => tetrahedron[0]; public Vector3 a => tetrahedron[1]; public Vector3 b => tetrahedron[2]; public Vector3 c => tetrahedron[3]; public bool isValid => volume > 0f; public ReachCone(Vector3 _o, Vector3 _a, Vector3 _b, Vector3 _c) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) tetrahedron = (Vector3[])(object)new Vector3[4]; tetrahedron[0] = _o; tetrahedron[1] = _a; tetrahedron[2] = _b; tetrahedron[3] = _c; volume = 0f; S = Vector3.zero; B = Vector3.zero; } public void Calculate() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(a, b); volume = Vector3.Dot(val, c) / 6f; Vector3 val2 = Vector3.Cross(a, b); S = ((Vector3)(ref val2)).normalized; Vector3 val3 = Vector3.Cross(b, c); B = ((Vector3)(ref val3)).normalized; } } [Serializable] public class LimitPoint { public Vector3 point; public float tangentWeight; public LimitPoint() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) point = Vector3.forward; tangentWeight = 1f; } } [Range(0f, 180f)] public float twistLimit = 180f; [Range(0f, 3f)] public int smoothIterations = 0; [HideInInspector] public LimitPoint[] points; [HideInInspector] public Vector3[] P; [HideInInspector] public ReachCone[] reachCones = new ReachCone[0]; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page14.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_rotation_limit_polygonal.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public void SetLimitPoints(LimitPoint[] points) { if (points.Length < 3) { LogWarning("The polygon must have at least 3 Limit Points."); return; } this.points = points; BuildReachCones(); } protected override Quaternion LimitRotation(Quaternion rotation) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (reachCones.Length == 0) { Start(); } Quaternion rotation2 = LimitSwing(rotation); return RotationLimit.LimitTwist(rotation2, axis, base.secondaryAxis, twistLimit); } private void Start() { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if (points.Length < 3) { ResetToDefault(); } for (int i = 0; i < reachCones.Length; i++) { if (!reachCones[i].isValid) { if (smoothIterations <= 0) { int num = 0; num = ((i < reachCones.Length - 1) ? (i + 1) : 0); LogWarning("Reach Cone {point " + i + ", point " + num + ", Origin} has negative volume. Make sure Axis vector is in the reachable area and the polygon is convex."); } else { LogWarning("One of the Reach Cones in the polygon has negative volume. Make sure Axis vector is in the reachable area and the polygon is convex."); } } } axis = ((Vector3)(ref axis)).normalized; } public void ResetToDefault() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) points = new LimitPoint[4]; for (int i = 0; i < points.Length; i++) { points[i] = new LimitPoint(); } Quaternion val = Quaternion.AngleAxis(45f, Vector3.right); Quaternion val2 = Quaternion.AngleAxis(45f, Vector3.up); points[0].point = val * val2 * axis; points[1].point = Quaternion.Inverse(val) * val2 * axis; points[2].point = Quaternion.Inverse(val) * Quaternion.Inverse(val2) * axis; points[3].point = val * Quaternion.Inverse(val2) * axis; BuildReachCones(); } public void BuildReachCones() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) smoothIterations = Mathf.Clamp(smoothIterations, 0, 3); P = (Vector3[])(object)new Vector3[points.Length]; for (int i = 0; i < points.Length; i++) { ref Vector3 reference = ref P[i]; reference = ((Vector3)(ref points[i].point)).normalized; } for (int j = 0; j < smoothIterations; j++) { P = SmoothPoints(); } reachCones = new ReachCone[P.Length]; for (int k = 0; k < reachCones.Length - 1; k++) { reachCones[k] = new ReachCone(Vector3.zero, ((Vector3)(ref axis)).normalized, P[k], P[k + 1]); } reachCones[P.Length - 1] = new ReachCone(Vector3.zero, ((Vector3)(ref axis)).normalized, P[P.Length - 1], P[0]); for (int l = 0; l < reachCones.Length; l++) { reachCones[l].Calculate(); } } private Vector3[] SmoothPoints() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[P.Length * 2]; float scalar = GetScalar(P.Length); for (int i = 0; i < array.Length; i += 2) { ref Vector3 reference = ref array[i]; reference = PointToTangentPlane(P[i / 2], 1f); } for (int j = 1; j < array.Length; j += 2) { Vector3 val = Vector3.zero; Vector3 zero = Vector3.zero; Vector3 val2 = Vector3.zero; if (j > 1 && j < array.Length - 2) { val = array[j - 2]; val2 = array[j + 1]; } else if (j == 1) { val = array[^2]; val2 = array[j + 1]; } else if (j == array.Length - 1) { val = array[j - 2]; val2 = array[0]; } zero = ((j >= array.Length - 1) ? array[0] : array[j + 1]); int num = array.Length / points.Length; ref Vector3 reference2 = ref array[j]; reference2 = 0.5f * (array[j - 1] + zero) + scalar * points[j / num].tangentWeight * (zero - val) + scalar * points[j / num].tangentWeight * (array[j - 1] - val2); } for (int k = 0; k < array.Length; k++) { ref Vector3 reference3 = ref array[k]; reference3 = TangentPointToSphere(array[k], 1f); } return array; } private float GetScalar(int k) { if (k <= 3) { return 0.1667f; } return k switch { 4 => 0.1036f, 5 => 0.085f, 6 => 0.0773f, 7 => 0.07f, _ => 0.0625f, }; } private Vector3 PointToTangentPlane(Vector3 p, float r) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Dot(axis, p); float num2 = 2f * r * r / (r * r + num); return num2 * p + (1f - num2) * -axis; } private Vector3 TangentPointToSphere(Vector3 q, float r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Dot(q - axis, q - axis); float num2 = 4f * r * r / (4f * r * r + num); return num2 * q + (1f - num2) * -axis; } private Quaternion LimitSwing(Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (rotation == Quaternion.identity) { return rotation; } Vector3 val = rotation * axis; int reachCone = GetReachCone(val); if (reachCone == -1) { if (!Warning.logged) { LogWarning("RotationLimitPolygonal reach cones are invalid."); } return rotation; } float num = Vector3.Dot(reachCones[reachCone].B, val); if (num > 0f) { return rotation; } Vector3 val2 = Vector3.Cross(axis, val); val = Vector3.Cross(-reachCones[reachCone].B, val2); Quaternion val3 = Quaternion.FromToRotation(rotation * axis, val); return val3 * rotation; } private int GetReachCone(Vector3 L) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) float num = 0f; float num2 = Vector3.Dot(reachCones[0].S, L); for (int i = 0; i < reachCones.Length; i++) { num = num2; num2 = ((i >= reachCones.Length - 1) ? Vector3.Dot(reachCones[0].S, L) : Vector3.Dot(reachCones[i + 1].S, L)); if (num >= 0f && num2 < 0f) { return i; } } return -1; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page14.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Rotation Limits/Rotation Limit Spline")] public class RotationLimitSpline : RotationLimit { [Range(0f, 180f)] public float twistLimit = 180f; [HideInInspector] public AnimationCurve spline; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page14.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_rotation_limit_spline.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public void SetSpline(Keyframe[] keyframes) { spline.keys = keyframes; } protected override Quaternion LimitRotation(Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation2 = LimitSwing(rotation); return RotationLimit.LimitTwist(rotation2, axis, base.secondaryAxis, twistLimit); } public Quaternion LimitSwing(Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if (axis == Vector3.zero) { return rotation; } if (rotation == Quaternion.identity) { return rotation; } Vector3 val = rotation * axis; float num = RotationLimit.GetOrthogonalAngle(val, base.secondaryAxis, axis); float num2 = Vector3.Dot(val, base.crossAxis); if (num2 < 0f) { num = 180f + (180f - num); } float num3 = spline.Evaluate(num); Quaternion val2 = Quaternion.FromToRotation(axis, val); Quaternion val3 = Quaternion.RotateTowards(Quaternion.identity, val2, num3); Quaternion val4 = Quaternion.FromToRotation(val, val3 * axis); return val4 * rotation; } } public class AimController : MonoBehaviour { [Tooltip("Reference to the AimIK component.")] public AimIK ik; [Tooltip("Master weight of the IK solver.")] [Range(0f, 1f)] public float weight = 1f; [Header("Target Smoothing")] [Tooltip("The target to aim at. Do not use the Target transform that is assigned to AimIK. Set to null if you wish to stop aiming.")] public Transform target; [Tooltip("The time it takes to switch targets.")] public float targetSwitchSmoothTime = 0.3f; [Tooltip("The time it takes to blend in/out of AimIK weight.")] public float weightSmoothTime = 0.3f; [Header("Turning Towards The Target")] [Tooltip("Enables smooth turning towards the target according to the parameters under this header.")] public bool smoothTurnTowardsTarget = true; [Tooltip("Speed of turning towards the target using Vector3.RotateTowards.")] public float maxRadiansDelta = 3f; [Tooltip("Speed of moving towards the target using Vector3.RotateTowards.")] public float maxMagnitudeDelta = 3f; [Tooltip("Speed of slerping towards the target.")] public float slerpSpeed = 3f; [Tooltip("Smoothing time for turning towards the yaw and pitch of the target using Mathf.SmoothDampAngle. Value of 0 means smooth damping is disabled.")] public float smoothDampTime = 0f; [Tooltip("The position of the pivot that the aim target is rotated around relative to the root of the character.")] public Vector3 pivotOffsetFromRoot = Vector3.up; [Tooltip("Minimum distance of aiming from the first bone. Keeps the solver from failing if the target is too close.")] public float minDistance = 1f; [Tooltip("Offset applied to the target in world space. Convenient for scripting aiming inaccuracy.")] public Vector3 offset; [Header("RootRotation")] [Tooltip("Character root will be rotate around the Y axis to keep root forward within this angle from the aiming direction.")] [Range(0f, 180f)] public float maxRootAngle = 45f; [Tooltip("If enabled, aligns the root forward to target direction after 'Max Root Angle' has been exceeded.")] public bool turnToTarget; [Tooltip("The time of turning towards the target direction if 'Max Root Angle has been exceeded and 'Turn To Target' is enabled.")] public float turnToTargetTime = 0.2f; [Header("Mode")] [Tooltip("If true, AimIK will consider whatever the current direction of the weapon to be the forward aiming direction and work additively on top of that. This enables you to use recoil and reloading animations seamlessly with AimIK. Adjust the Vector3 value below if the weapon is not aiming perfectly forward in the aiming animation clip.")] public bool useAnimatedAimDirection; [Tooltip("The direction of the animated weapon aiming in character space. Tweak this value to adjust the aiming. 'Use Animated Aim Direction' must be enabled for this property to work.")] public Vector3 animatedAimDirection = Vector3.forward; private Transform lastTarget; private float switchWeight; private float switchWeightV; private float weightV; private Vector3 lastPosition; private Vector3 dir; private bool lastSmoothTowardsTarget; private bool turningToTarget; private float turnToTargetMlp = 1f; private float turnToTargetMlpV; private float yawV; private float pitchV; private float dirMagV; private Vector3 pivot => ((Component)ik).transform.position + ((Component)ik).transform.rotation * pivotOffsetFromRoot; private void Start() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) lastPosition = ik.solver.IKPosition; dir = ik.solver.IKPosition - pivot; ik.solver.target = null; } private void LateUpdate() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)(object)lastTarget) { if ((Object)(object)lastTarget == (Object)null && (Object)(object)target != (Object)null && ik.solver.IKPositionWeight <= 0f) { lastPosition = target.position; dir = target.position - pivot; ik.solver.IKPosition = target.position + offset; } else { lastPosition = ik.solver.IKPosition; dir = ik.solver.IKPosition - pivot; } switchWeight = 0f; lastTarget = target; } float num = ((!((Object)(object)target != (Object)null)) ? 0f : weight); ik.solver.IKPositionWeight = Mathf.SmoothDamp(ik.solver.IKPositionWeight, num, ref weightV, weightSmoothTime); if (ik.solver.IKPositionWeight >= 0.999f && num > ik.solver.IKPositionWeight) { ik.solver.IKPositionWeight = 1f; } if (ik.solver.IKPositionWeight <= 0.001f && num < ik.solver.IKPositionWeight) { ik.solver.IKPositionWeight = 0f; } if (ik.solver.IKPositionWeight <= 0f) { return; } switchWeight = Mathf.SmoothDamp(switchWeight, 1f, ref switchWeightV, targetSwitchSmoothTime); if (switchWeight >= 0.999f) { switchWeight = 1f; } if ((Object)(object)target != (Object)null) { ik.solver.IKPosition = Vector3.Lerp(lastPosition, target.position + offset, switchWeight); } if (smoothTurnTowardsTarget != lastSmoothTowardsTarget) { dir = ik.solver.IKPosition - pivot; lastSmoothTowardsTarget = smoothTurnTowardsTarget; } if (smoothTurnTowardsTarget) { Vector3 val = ik.solver.IKPosition - pivot; if (slerpSpeed > 0f) { dir = Vector3.Slerp(dir, val, Time.deltaTime * slerpSpeed); } if (maxRadiansDelta > 0f || maxMagnitudeDelta > 0f) { dir = Vector3.RotateTowards(dir, val, Time.deltaTime * maxRadiansDelta, maxMagnitudeDelta); } if (smoothDampTime > 0f) { float yaw = V3Tools.GetYaw(dir); float yaw2 = V3Tools.GetYaw(val); float num2 = Mathf.SmoothDampAngle(yaw, yaw2, ref yawV, smoothDampTime); float pitch = V3Tools.GetPitch(dir); float pitch2 = V3Tools.GetPitch(val); float num3 = Mathf.SmoothDampAngle(pitch, pitch2, ref pitchV, smoothDampTime); float num4 = Mathf.SmoothDamp(((Vector3)(ref dir)).magnitude, ((Vector3)(ref val)).magnitude, ref dirMagV, smoothDampTime); dir = Quaternion.Euler(num3, num2, 0f) * Vector3.forward * num4; } ik.solver.IKPosition = pivot + dir; } ApplyMinDistance(); RootRotation(); if (useAnimatedAimDirection) { ik.solver.axis = ik.solver.transform.InverseTransformVector(((Component)ik).transform.rotation * animatedAimDirection); } } private void ApplyMinDistance() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pivot; Vector3 val2 = ik.solver.IKPosition - val; val2 = ((Vector3)(ref val2)).normalized * Mathf.Max(((Vector3)(ref val2)).magnitude, minDistance); ik.solver.IKPosition = val + val2; } private void RootRotation() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Lerp(180f, maxRootAngle * turnToTargetMlp, ik.solver.IKPositionWeight); if (!(num < 180f)) { return; } Vector3 val = Quaternion.Inverse(((Component)ik).transform.rotation) * (ik.solver.IKPosition - pivot); float num2 = Mathf.Atan2(val.x, val.z) * 57.29578f; float num3 = 0f; if (num2 > num) { num3 = num2 - num; if (!turningToTarget && turnToTarget) { ((MonoBehaviour)this).StartCoroutine(TurnToTarget()); } } if (num2 < 0f - num) { num3 = num2 + num; if (!turningToTarget && turnToTarget) { ((MonoBehaviour)this).StartCoroutine(TurnToTarget()); } } ((Component)ik).transform.rotation = Quaternion.AngleAxis(num3, ((Component)ik).transform.up) * ((Component)ik).transform.rotation; } private IEnumerator TurnToTarget() { turningToTarget = true; while (turnToTargetMlp > 0f) { turnToTargetMlp = Mathf.SmoothDamp(turnToTargetMlp, 0f, ref turnToTargetMlpV, turnToTargetTime); if (turnToTargetMlp < 0.01f) { turnToTargetMlp = 0f; } yield return null; } turnToTargetMlp = 1f; turningToTarget = false; } } public class AimPoser : MonoBehaviour { [Serializable] public class Pose { public bool visualize = true; public string name; public Vector3 direction; public float yaw = 75f; public float pitch = 45f; private float angleBuffer; public bool IsInDirection(Vector3 d) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (direction == Vector3.zero) { return false; } if (yaw <= 0f || pitch <= 0f) { return false; } if (yaw < 180f) { Vector3 forward = default(Vector3); ((Vector3)(ref forward))..ctor(direction.x, 0f, direction.z); if (forward == Vector3.zero) { forward = Vector3.forward; } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(d.x, 0f, d.z); float num = Vector3.Angle(val, forward); if (num > yaw + angleBuffer) { return false; } } if (pitch >= 180f) { return true; } float num2 = Vector3.Angle(Vector3.up, direction); float num3 = Vector3.Angle(Vector3.up, d); return Mathf.Abs(num3 - num2) < pitch + angleBuffer; } public void SetAngleBuffer(float value) { angleBuffer = value; } } public float angleBuffer = 5f; public Pose[] poses = new Pose[0]; public Pose GetPose(Vector3 localDirection) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (poses.Length == 0) { return null; } for (int i = 0; i < poses.Length - 1; i++) { if (poses[i].IsInDirection(localDirection)) { return poses[i]; } } return poses[poses.Length - 1]; } public void SetPoseActive(Pose pose) { for (int i = 0; i < poses.Length; i++) { poses[i].SetAngleBuffer((poses[i] != pose) ? 0f : angleBuffer); } } } public class Amplifier : OffsetModifier { [Serializable] public class Body { [Serializable] public class EffectorLink { [Tooltip("Type of the FBBIK effector to use")] public FullBodyBipedEffector effector; [Tooltip("Weight of using this effector")] public float weight; } [Tooltip("The Transform that's motion we are reading.")] public Transform transform; [Tooltip("Amplify the 'transform's' position relative to this Transform.")] public Transform relativeTo; [Tooltip("Linking the body to effectors. One Body can be used to offset more than one effector.")] public EffectorLink[] effectorLinks; [Tooltip("Amplification magnitude along the up axis of the character.")] public float verticalWeight = 1f; [Tooltip("Amplification magnitude along the horizontal axes of the character.")] public float horizontalWeight = 1f; [Tooltip("Speed of the amplifier. 0 means instant.")] public float speed = 3f; private Vector3 lastRelativePos; private Vector3 smoothDelta; private bool firstUpdate; public void Update(IKSolverFullBodyBiped solver, float w, float deltaTime) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)transform == (Object)null) && !((Object)(object)relativeTo == (Object)null)) { Vector3 val = relativeTo.InverseTransformDirection(transform.position - relativeTo.position); if (firstUpdate) { lastRelativePos = val; firstUpdate = false; } Vector3 val2 = (val - lastRelativePos) / deltaTime; smoothDelta = ((!(speed <= 0f)) ? Vector3.Lerp(smoothDelta, val2, deltaTime * speed) : val2); Vector3 v = relativeTo.TransformDirection(smoothDelta); Vector3 val3 = V3Tools.ExtractVertical(v, solver.GetRoot().up, verticalWeight) + V3Tools.ExtractHorizontal(v, solver.GetRoot().up, horizontalWeight); for (int i = 0; i < effectorLinks.Length; i++) { IKEffector effector = solver.GetEffector(effectorLinks[i].effector); effector.positionOffset += val3 * w * effectorLinks[i].weight; } lastRelativePos = val; } } private static Vector3 Multiply(Vector3 v1, Vector3 v2) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) v1.x *= v2.x; v1.y *= v2.y; v1.z *= v2.z; return v1; } } [Tooltip("The amplified bodies.")] public Body[] bodies; protected override void OnModifyOffset() { if (!ik.fixTransforms) { if (!Warning.logged) { Warning.Log("Amplifier needs the Fix Transforms option of the FBBIK to be set to true. Otherwise it might amplify to infinity, should the animator of the character stop because of culling.", ((Component)this).transform); } return; } Body[] array = bodies; foreach (Body body in array) { body.Update(ik.solver, weight, base.deltaTime); } } } public class BodyTilt : OffsetModifier { [Tooltip("Speed of tilting")] public float tiltSpeed = 6f; [Tooltip("Sensitivity of tilting")] public float tiltSensitivity = 0.07f; [Tooltip("The OffsetPose components")] public OffsetPose poseLeft; [Tooltip("The OffsetPose components")] public OffsetPose poseRight; private float tiltAngle; private Vector3 lastForward; protected override void Start() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) base.Start(); lastForward = ((Component)this).transform.forward; } protected override void OnModifyOffset() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(lastForward, ((Component)this).transform.forward); float num = 0f; Vector3 zero = Vector3.zero; ((Quaternion)(ref val)).ToAngleAxis(ref num, ref zero); if (zero.y > 0f) { num = 0f - num; } num *= tiltSensitivity * 0.01f; num /= base.deltaTime; num = Mathf.Clamp(num, -1f, 1f); tiltAngle = Mathf.Lerp(tiltAngle, num, base.deltaTime * tiltSpeed); float num2 = Mathf.Abs(tiltAngle) / 1f; if (tiltAngle < 0f) { poseRight.Apply(ik.solver, num2); } else { poseLeft.Apply(ik.solver, num2); } lastForward = ((Component)this).transform.forward; } } public class CCDBendGoal : MonoBehaviour { public CCDIK ik; [Range(0f, 1f)] public float weight = 1f; private void Start() { IKSolverCCD solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreUpdate, new IKSolver.UpdateDelegate(BeforeIK)); } private void BeforeIK() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } float num = ik.solver.IKPositionWeight * weight; if (!(num <= 0f)) { Vector3 position = ik.solver.bones[0].transform.position; Vector3 position2 = ik.solver.bones[ik.solver.bones.Length - 1].transform.position; Quaternion val = Quaternion.FromToRotation(position2 - position, ((Component)this).transform.position - position); if (num < 1f) { val = Quaternion.Slerp(Quaternion.identity, val, num); } ik.solver.bones[0].transform.rotation = val * ik.solver.bones[0].transform.rotation; } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverCCD solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreUpdate, new IKSolver.UpdateDelegate(BeforeIK)); } } } [ExecuteInEditMode] public class EditorIK : MonoBehaviour { [Tooltip("If slot assigned, will update Animator before IK.")] public Animator animator; [Tooltip("Create/Final IK/Editor IK Pose")] public EditorIKPose defaultPose; [HideInInspector] public Transform[] bones = (Transform[])(object)new Transform[0]; public IK ik { get; private set; } private void OnEnable() { if (!Application.isPlaying) { if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponent(); } if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"EditorIK needs to have an IK component on the same GameObject.", (Object)(object)((Component)this).transform); } else if (bones.Length == 0) { bones = ((Component)((Component)ik).transform).GetComponentsInChildren(); } } } private void OnDisable() { if (!Application.isPlaying) { if ((Object)(object)defaultPose != (Object)null && defaultPose.poseStored) { defaultPose.Restore(bones); } if ((Object)(object)ik != (Object)null) { ik.GetIKSolver().executedInEditor = false; } } } private void OnDestroy() { if (!Application.isPlaying && !((Object)(object)ik == (Object)null)) { if (bones.Length == 0) { bones = ((Component)((Component)ik).transform).GetComponentsInChildren(); } if ((Object)(object)defaultPose != (Object)null && defaultPose.poseStored && bones.Length != 0) { defaultPose.Restore(bones); } ik.GetIKSolver().executedInEditor = false; } } public void StoreDefaultPose() { bones = ((Component)((Component)ik).transform).GetComponentsInChildren(); defaultPose.Store(bones); } public bool Initiate() { if ((Object)(object)defaultPose == (Object)null) { return false; } if (!defaultPose.poseStored) { return false; } if (bones.Length == 0) { return false; } if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponent(); } if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"EditorIK can not find an IK component.", (Object)(object)((Component)this).transform); return false; } defaultPose.Restore(bones); ik.GetIKSolver().executedInEditor = false; ik.GetIKSolver().Initiate(((Component)ik).transform); ik.GetIKSolver().executedInEditor = true; return true; } public void Update() { if (Application.isPlaying || (Object)(object)ik == (Object)null || !((Behaviour)ik).enabled || !ik.GetIKSolver().executedInEditor) { return; } if (bones.Length == 0) { bones = ((Component)((Component)ik).transform).GetComponentsInChildren(); } if (bones.Length == 0 || !defaultPose.Restore(bones)) { return; } ik.GetIKSolver().executedInEditor = false; if (!ik.GetIKSolver().initiated) { ik.GetIKSolver().Initiate(((Component)ik).transform); } if (ik.GetIKSolver().initiated) { ik.GetIKSolver().executedInEditor = true; if ((Object)(object)animator != (Object)null && (Object)(object)animator.runtimeAnimatorController != (Object)null) { animator.Update(Time.deltaTime); } ik.GetIKSolver().Update(); } } } [CreateAssetMenu(fileName = "Editor IK Pose", menuName = "Final IK/Editor IK Pose", order = 1)] public class EditorIKPose : ScriptableObject { public Vector3[] localPositions = (Vector3[])(object)new Vector3[0]; public Quaternion[] localRotations = (Quaternion[])(object)new Quaternion[0]; public bool poseStored => localPositions.Length > 0; public void Store(Transform[] T) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) localPositions = (Vector3[])(object)new Vector3[T.Length]; localRotations = (Quaternion[])(object)new Quaternion[T.Length]; for (int i = 1; i < T.Length; i++) { ref Vector3 reference = ref localPositions[i]; reference = T[i].localPosition; ref Quaternion reference2 = ref localRotations[i]; reference2 = T[i].localRotation; } } public bool Restore(Transform[] T) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (localPositions.Length != T.Length) { Debug.LogError((object)"Can not restore pose (unmatched bone count). Please stop the solver and click on 'Store Default Pose' if you have made changes to character hierarchy."); return false; } for (int i = 1; i < T.Length; i++) { T[i].localPosition = localPositions[i]; T[i].localRotation = localRotations[i]; } return true; } } public class HitReaction : OffsetModifier { [Serializable] public abstract class HitPoint { [Tooltip("Just for visual clarity, not used at all")] public string name; [Tooltip("Linking this hit point to a collider")] public Collider collider; [Tooltip("Only used if this hit point gets hit when already processing another hit")] [SerializeField] private float crossFadeTime = 0.1f; private float length; private float crossFadeSpeed; private float lastTime; public bool inProgress => timer < length; protected float crossFader { get; private set; } protected float timer { get; private set; } protected Vector3 force { get; private set; } protected Vector3 point { get; private set; } public void Hit(Vector3 force, Vector3 point) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) if (length == 0f) { length = GetLength(); } if (length <= 0f) { Debug.LogError((object)"Hit Point WeightCurve length is zero."); return; } if (timer < 1f) { crossFader = 0f; } crossFadeSpeed = ((!(crossFadeTime > 0f)) ? 0f : (1f / crossFadeTime)); CrossFadeStart(); timer = 0f; this.force = force; this.point = point; } public void Apply(IKSolverFullBodyBiped solver, float weight) { float num = Time.time - lastTime; lastTime = Time.time; if (!(timer >= length)) { timer = Mathf.Clamp(timer + num, 0f, length); if (crossFadeSpeed > 0f) { crossFader = Mathf.Clamp(crossFader + num * crossFadeSpeed, 0f, 1f); } else { crossFader = 1f; } OnApply(solver, weight); } } protected abstract float GetLength(); protected abstract void CrossFadeStart(); protected abstract void OnApply(IKSolverFullBodyBiped solver, float weight); } [Serializable] public class HitPointEffector : HitPoint { [Serializable] public class EffectorLink { [Tooltip("The FBBIK effector type")] public FullBodyBipedEffector effector; [Tooltip("The weight of this effector (could also be negative)")] public float weight; private Vector3 lastValue; private Vector3 current; public void Apply(IKSolverFullBodyBiped solver, Vector3 offset, float crossFader) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) current = Vector3.Lerp(lastValue, offset * weight, crossFader); IKEffector iKEffector = solver.GetEffector(effector); iKEffector.positionOffset += current; } public void CrossFadeStart() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) lastValue = current; } } [Tooltip("Offset magnitude in the direction of the hit force")] public AnimationCurve offsetInForceDirection; [Tooltip("Offset magnitude in the direction of character.up")] public AnimationCurve offsetInUpDirection; [Tooltip("Linking this offset to the FBBIK effectors")] public EffectorLink[] effectorLinks; protected override float GetLength() { float num = ((offsetInForceDirection.keys.Length <= 0) ? 0f : ((Keyframe)(ref offsetInForceDirection.keys[offsetInForceDirection.length - 1])).time); float num2 = ((offsetInUpDirection.keys.Length <= 0) ? 0f : ((Keyframe)(ref offsetInUpDirection.keys[offsetInUpDirection.length - 1])).time); return Mathf.Clamp(num, num2, num); } protected override void CrossFadeStart() { EffectorLink[] array = effectorLinks; foreach (EffectorLink effectorLink in array) { effectorLink.CrossFadeStart(); } } protected override void OnApply(IKSolverFullBodyBiped solver, float weight) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) Vector3 up = solver.GetRoot().up; Vector3 val = base.force; Vector3 val2 = up * ((Vector3)(ref val)).magnitude; Vector3 val3 = offsetInForceDirection.Evaluate(base.timer) * base.force + offsetInUpDirection.Evaluate(base.timer) * val2; val3 *= weight; EffectorLink[] array = effectorLinks; foreach (EffectorLink effectorLink in array) { effectorLink.Apply(solver, val3, base.crossFader); } } } [Serializable] public class HitPointBone : HitPoint { [Serializable] public class BoneLink { [Tooltip("Reference to the bone that this hit point rotates")] public Transform bone; [Tooltip("Weight of rotating the bone")] [Range(0f, 1f)] public float weight; private Quaternion lastValue = Quaternion.identity; private Quaternion current = Quaternion.identity; public void Apply(IKSolverFullBodyBiped solver, Quaternion offset, float crossFader) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) current = Quaternion.Lerp(lastValue, Quaternion.Lerp(Quaternion.identity, offset, weight), crossFader); bone.rotation = current * bone.rotation; } public void CrossFadeStart() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) lastValue = current; } } [Tooltip("The angle to rotate the bone around it's rigidbody's world center of mass")] public AnimationCurve aroundCenterOfMass; [Tooltip("Linking this hit point to bone(s)")] public BoneLink[] boneLinks; private Rigidbody rigidbody; protected override float GetLength() { return (aroundCenterOfMass.keys.Length <= 0) ? 0f : ((Keyframe)(ref aroundCenterOfMass.keys[aroundCenterOfMass.length - 1])).time; } protected override void CrossFadeStart() { BoneLink[] array = boneLinks; foreach (BoneLink boneLink in array) { boneLink.CrossFadeStart(); } } protected override void OnApply(IKSolverFullBodyBiped solver, float weight) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rigidbody == (Object)null) { rigidbody = ((Component)collider).GetComponent(); } if ((Object)(object)rigidbody != (Object)null) { Vector3 val = Vector3.Cross(base.force, base.point - rigidbody.worldCenterOfMass); float num = aroundCenterOfMass.Evaluate(base.timer) * weight; Quaternion offset = Quaternion.AngleAxis(num, val); BoneLink[] array = boneLinks; foreach (BoneLink boneLink in array) { boneLink.Apply(solver, offset, base.crossFader); } } } } [Tooltip("Hit points for the FBBIK effectors")] public HitPointEffector[] effectorHitPoints; [Tooltip(" Hit points for bones without an effector, such as the head")] public HitPointBone[] boneHitPoints; public bool inProgress { get { HitPointEffector[] array = effectorHitPoints; foreach (HitPointEffector hitPointEffector in array) { if (hitPointEffector.inProgress) { return true; } } HitPointBone[] array2 = boneHitPoints; foreach (HitPointBone hitPointBone in array2) { if (hitPointBone.inProgress) { return true; } } return false; } } protected override void OnModifyOffset() { HitPointEffector[] array = effectorHitPoints; foreach (HitPointEffector hitPointEffector in array) { hitPointEffector.Apply(ik.solver, weight); } HitPointBone[] array2 = boneHitPoints; foreach (HitPointBone hitPointBone in array2) { hitPointBone.Apply(ik.solver, weight); } } public void Hit(Collider collider, Vector3 force, Vector3 point) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"No IK assigned in HitReaction"); return; } HitPointEffector[] array = effectorHitPoints; foreach (HitPointEffector hitPointEffector in array) { if ((Object)(object)hitPointEffector.collider == (Object)(object)collider) { hitPointEffector.Hit(force, point); } } HitPointBone[] array2 = boneHitPoints; foreach (HitPointBone hitPointBone in array2) { if ((Object)(object)hitPointBone.collider == (Object)(object)collider) { hitPointBone.Hit(force, point); } } } } public class HitReactionVRIK : OffsetModifierVRIK { [Serializable] public abstract class Offset { [Tooltip("Just for visual clarity, not used at all")] public string name; [Tooltip("Linking this hit point to a collider")] public Collider collider; [Tooltip("Only used if this hit point gets hit when already processing another hit")] [SerializeField] private float crossFadeTime = 0.1f; private float length; private float crossFadeSpeed; private float lastTime; protected float crossFader { get; private set; } protected float timer { get; private set; } protected Vector3 force { get; private set; } protected Vector3 point { get; private set; } public void Hit(Vector3 force, AnimationCurve[] curves, Vector3 point) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) if (length == 0f) { length = GetLength(curves); } if (length <= 0f) { Debug.LogError((object)"Hit Point WeightCurve length is zero."); return; } if (timer < 1f) { crossFader = 0f; } crossFadeSpeed = ((!(crossFadeTime > 0f)) ? 0f : (1f / crossFadeTime)); CrossFadeStart(); timer = 0f; this.force = force; this.point = point; } public void Apply(VRIK ik, AnimationCurve[] curves, float weight) { float num = Time.time - lastTime; lastTime = Time.time; if (!(timer >= length)) { timer = Mathf.Clamp(timer + num, 0f, length); if (crossFadeSpeed > 0f) { crossFader = Mathf.Clamp(crossFader + num * crossFadeSpeed, 0f, 1f); } else { crossFader = 1f; } OnApply(ik, curves, weight); } } protected abstract float GetLength(AnimationCurve[] curves); protected abstract void CrossFadeStart(); protected abstract void OnApply(VRIK ik, AnimationCurve[] curves, float weight); } [Serializable] public class PositionOffset : Offset { [Serializable] public class PositionOffsetLink { [Tooltip("The FBBIK effector type")] public IKSolverVR.PositionOffset positionOffset; [Tooltip("The weight of this effector (could also be negative)")] public float weight; private Vector3 lastValue; private Vector3 current; public void Apply(VRIK ik, Vector3 offset, float crossFader) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) current = Vector3.Lerp(lastValue, offset * weight, crossFader); ik.solver.AddPositionOffset(positionOffset, current); } public void CrossFadeStart() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) lastValue = current; } } [Tooltip("Offset magnitude in the direction of the hit force")] public int forceDirCurveIndex; [Tooltip("Offset magnitude in the direction of character.up")] public int upDirCurveIndex = 1; [Tooltip("Linking this offset to the VRIK position offsets")] public PositionOffsetLink[] offsetLinks; protected override float GetLength(AnimationCurve[] curves) { float num = ((curves[forceDirCurveIndex].keys.Length <= 0) ? 0f : ((Keyframe)(ref curves[forceDirCurveIndex].keys[curves[forceDirCurveIndex].length - 1])).time); float num2 = ((curves[upDirCurveIndex].keys.Length <= 0) ? 0f : ((Keyframe)(ref curves[upDirCurveIndex].keys[curves[upDirCurveIndex].length - 1])).time); return Mathf.Clamp(num, num2, num); } protected override void CrossFadeStart() { PositionOffsetLink[] array = offsetLinks; foreach (PositionOffsetLink positionOffsetLink in array) { positionOffsetLink.CrossFadeStart(); } } protected override void OnApply(VRIK ik, AnimationCurve[] curves, float weight) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) Vector3 up = ((Component)ik).transform.up; Vector3 val = base.force; Vector3 val2 = up * ((Vector3)(ref val)).magnitude; Vector3 val3 = curves[forceDirCurveIndex].Evaluate(base.timer) * base.force + curves[upDirCurveIndex].Evaluate(base.timer) * val2; val3 *= weight; PositionOffsetLink[] array = offsetLinks; foreach (PositionOffsetLink positionOffsetLink in array) { positionOffsetLink.Apply(ik, val3, base.crossFader); } } } [Serializable] public class RotationOffset : Offset { [Serializable] public class RotationOffsetLink { [Tooltip("Reference to the bone that this hit point rotates")] public IKSolverVR.RotationOffset rotationOffset; [Tooltip("Weight of rotating the bone")] [Range(0f, 1f)] public float weight; private Quaternion lastValue = Quaternion.identity; private Quaternion current = Quaternion.identity; public void Apply(VRIK ik, Quaternion offset, float crossFader) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) current = Quaternion.Lerp(lastValue, Quaternion.Lerp(Quaternion.identity, offset, weight), crossFader); ik.solver.AddRotationOffset(rotationOffset, current); } public void CrossFadeStart() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) lastValue = current; } } [Tooltip("The angle to rotate the bone around it's rigidbody's world center of mass")] public int curveIndex; [Tooltip("Linking this hit point to bone(s)")] public RotationOffsetLink[] offsetLinks; private Rigidbody rigidbody; protected override float GetLength(AnimationCurve[] curves) { return (curves[curveIndex].keys.Length <= 0) ? 0f : ((Keyframe)(ref curves[curveIndex].keys[curves[curveIndex].length - 1])).time; } protected override void CrossFadeStart() { RotationOffsetLink[] array = offsetLinks; foreach (RotationOffsetLink rotationOffsetLink in array) { rotationOffsetLink.CrossFadeStart(); } } protected override void OnApply(VRIK ik, AnimationCurve[] curves, float weight) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)collider == (Object)null) { Debug.LogError((object)"No collider assigned for a HitPointBone in the HitReaction component."); return; } if ((Object)(object)rigidbody == (Object)null) { rigidbody = ((Component)collider).GetComponent(); } if ((Object)(object)rigidbody != (Object)null) { Vector3 val = Vector3.Cross(base.force, base.point - rigidbody.worldCenterOfMass); float num = curves[curveIndex].Evaluate(base.timer) * weight; Quaternion offset = Quaternion.AngleAxis(num, val); RotationOffsetLink[] array = offsetLinks; foreach (RotationOffsetLink rotationOffsetLink in array) { rotationOffsetLink.Apply(ik, offset, base.crossFader); } } } } public AnimationCurve[] offsetCurves; [Tooltip("Hit points for the FBBIK effectors")] public PositionOffset[] positionOffsets; [Tooltip(" Hit points for bones without an effector, such as the head")] public RotationOffset[] rotationOffsets; protected override void OnModifyOffset() { PositionOffset[] array = positionOffsets; foreach (PositionOffset positionOffset in array) { positionOffset.Apply(ik, offsetCurves, weight); } RotationOffset[] array2 = rotationOffsets; foreach (RotationOffset rotationOffset in array2) { rotationOffset.Apply(ik, offsetCurves, weight); } } public void Hit(Collider collider, Vector3 force, Vector3 point) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"No IK assigned in HitReaction"); return; } PositionOffset[] array = positionOffsets; foreach (PositionOffset positionOffset in array) { if ((Object)(object)positionOffset.collider == (Object)(object)collider) { positionOffset.Hit(force, offsetCurves, point); } } RotationOffset[] array2 = rotationOffsets; foreach (RotationOffset rotationOffset in array2) { if ((Object)(object)rotationOffset.collider == (Object)(object)collider) { rotationOffset.Hit(force, offsetCurves, point); } } } } public class Inertia : OffsetModifier { [Serializable] public class Body { [Serializable] public class EffectorLink { [Tooltip("Type of the FBBIK effector to use")] public FullBodyBipedEffector effector; [Tooltip("Weight of using this effector")] public float weight; } [Tooltip("The Transform to follow, can be any bone of the character")] public Transform transform; [Tooltip("Linking the body to effectors. One Body can be used to offset more than one effector")] public EffectorLink[] effectorLinks; [Tooltip("The speed to follow the Transform")] public float speed = 10f; [Tooltip("The acceleration, smaller values means lazyer following")] public float acceleration = 3f; [Tooltip("Matching target velocity")] [Range(0f, 1f)] public float matchVelocity; [Tooltip("gravity applied to the Body")] public float gravity; private Vector3 delta; private Vector3 lazyPoint; private Vector3 direction; private Vector3 lastPosition; private bool firstUpdate = true; public void Reset() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)transform == (Object)null)) { lazyPoint = transform.position; lastPosition = transform.position; direction = Vector3.zero; } } public void Update(IKSolverFullBodyBiped solver, float weight, float deltaTime) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)transform == (Object)null)) { if (firstUpdate) { Reset(); firstUpdate = false; } direction = Vector3.Lerp(direction, (transform.position - lazyPoint) / deltaTime * 0.01f, deltaTime * acceleration); lazyPoint += direction * deltaTime * speed; delta = transform.position - lastPosition; lazyPoint += delta * matchVelocity; ref Vector3 reference = ref lazyPoint; reference.y += gravity * deltaTime; EffectorLink[] array = effectorLinks; foreach (EffectorLink effectorLink in array) { IKEffector effector = solver.GetEffector(effectorLink.effector); effector.positionOffset += (lazyPoint - transform.position) * effectorLink.weight * weight; } lastPosition = transform.position; } } } [Tooltip("The array of Bodies")] public Body[] bodies; [Tooltip("The array of OffsetLimits")] public OffsetLimits[] limits; public void ResetBodies() { lastTime = Time.time; Body[] array = bodies; foreach (Body body in array) { body.Reset(); } } protected override void OnModifyOffset() { Body[] array = bodies; foreach (Body body in array) { body.Update(ik.solver, weight, base.deltaTime); } ApplyLimits(limits); } } public class LookAtController : MonoBehaviour { public LookAtIK ik; [Header("Target Smoothing")] [Tooltip("The target to look at. Do not use the Target transform that is assigned to LookAtIK. Set to null if you wish to stop looking.")] public Transform target; [Range(0f, 1f)] public float weight = 1f; public Vector3 offset; [Tooltip("The time it takes to switch targets.")] public float targetSwitchSmoothTime = 0.3f; [Tooltip("The time it takes to blend in/out of LookAtIK weight.")] public float weightSmoothTime = 0.3f; [Header("Turning Towards The Target")] [Tooltip("Enables smooth turning towards the target according to the parameters under this header.")] public bool smoothTurnTowardsTarget = true; [Tooltip("Speed of turning towards the target using Vector3.RotateTowards.")] public float maxRadiansDelta = 3f; [Tooltip("Speed of moving towards the target using Vector3.RotateTowards.")] public float maxMagnitudeDelta = 3f; [Tooltip("Speed of slerping towards the target.")] public float slerpSpeed = 3f; [Tooltip("The position of the pivot that the look at target is rotated around relative to the root of the character.")] public Vector3 pivotOffsetFromRoot = Vector3.up; [Tooltip("Minimum distance of looking from the first bone. Keeps the solver from failing if the target is too close.")] public float minDistance = 1f; [Header("RootRotation")] [Tooltip("Character root will be rotate around the Y axis to keep root forward within this angle from the look direction.")] [Range(0f, 180f)] public float maxRootAngle = 45f; private Transform lastTarget; private float switchWeight; private float switchWeightV; private float weightV; private Vector3 lastPosition; private Vector3 dir; private bool lastSmoothTowardsTarget; private Vector3 pivot => ((Component)ik).transform.position + ((Component)ik).transform.rotation * pivotOffsetFromRoot; private void Start() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) lastPosition = ik.solver.IKPosition; dir = ik.solver.IKPosition - pivot; } private void LateUpdate() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)(object)lastTarget) { if ((Object)(object)lastTarget == (Object)null && (Object)(object)target != (Object)null && ik.solver.IKPositionWeight <= 0f) { lastPosition = target.position; dir = target.position - pivot; ik.solver.IKPosition = target.position + offset; } else { lastPosition = ik.solver.IKPosition; dir = ik.solver.IKPosition - pivot; } switchWeight = 0f; lastTarget = target; } float num = ((!((Object)(object)target != (Object)null)) ? 0f : weight); ik.solver.IKPositionWeight = Mathf.SmoothDamp(ik.solver.IKPositionWeight, num, ref weightV, weightSmoothTime); if (ik.solver.IKPositionWeight >= 0.999f && num > ik.solver.IKPositionWeight) { ik.solver.IKPositionWeight = 1f; } if (ik.solver.IKPositionWeight <= 0.001f && num < ik.solver.IKPositionWeight) { ik.solver.IKPositionWeight = 0f; } if (!(ik.solver.IKPositionWeight <= 0f)) { switchWeight = Mathf.SmoothDamp(switchWeight, 1f, ref switchWeightV, targetSwitchSmoothTime); if (switchWeight >= 0.999f) { switchWeight = 1f; } if ((Object)(object)target != (Object)null) { ik.solver.IKPosition = Vector3.Lerp(lastPosition, target.position + offset, switchWeight); } if (smoothTurnTowardsTarget != lastSmoothTowardsTarget) { dir = ik.solver.IKPosition - pivot; lastSmoothTowardsTarget = smoothTurnTowardsTarget; } if (smoothTurnTowardsTarget) { Vector3 val = ik.solver.IKPosition - pivot; dir = Vector3.Slerp(dir, val, Time.deltaTime * slerpSpeed); dir = Vector3.RotateTowards(dir, val, Time.deltaTime * maxRadiansDelta, maxMagnitudeDelta); ik.solver.IKPosition = pivot + dir; } ApplyMinDistance(); RootRotation(); } } private void ApplyMinDistance() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pivot; Vector3 val2 = ik.solver.IKPosition - val; val2 = ((Vector3)(ref val2)).normalized * Mathf.Max(((Vector3)(ref val2)).magnitude, minDistance); ik.solver.IKPosition = val + val2; } private void RootRotation() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Lerp(180f, maxRootAngle, ik.solver.IKPositionWeight); if (num < 180f) { Vector3 val = Quaternion.Inverse(((Component)ik).transform.rotation) * (ik.solver.IKPosition - pivot); float num2 = Mathf.Atan2(val.x, val.z) * 57.29578f; float num3 = 0f; if (num2 > num) { num3 = num2 - num; } if (num2 < 0f - num) { num3 = num2 + num; } ((Component)ik).transform.rotation = Quaternion.AngleAxis(num3, ((Component)ik).transform.up) * ((Component)ik).transform.rotation; } } } public abstract class OffsetModifier : MonoBehaviour { [Serializable] public class OffsetLimits { [Tooltip("The effector type (this is just an enum)")] public FullBodyBipedEffector effector; [Tooltip("Spring force, if zero then this is a hard limit, if not, offset can exceed the limit.")] public float spring = 0f; [Tooltip("Which axes to limit the offset on?")] public bool x; [Tooltip("Which axes to limit the offset on?")] public bool y; [Tooltip("Which axes to limit the offset on?")] public bool z; [Tooltip("The limits")] public float minX; [Tooltip("The limits")] public float maxX; [Tooltip("The limits")] public float minY; [Tooltip("The limits")] public float maxY; [Tooltip("The limits")] public float minZ; [Tooltip("The limits")] public float maxZ; public void Apply(IKEffector e, Quaternion rootRotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Quaternion.Inverse(rootRotation) * e.positionOffset; if (spring <= 0f) { if (x) { val.x = Mathf.Clamp(val.x, minX, maxX); } if (y) { val.y = Mathf.Clamp(val.y, minY, maxY); } if (z) { val.z = Mathf.Clamp(val.z, minZ, maxZ); } } else { if (x) { val.x = SpringAxis(val.x, minX, maxX); } if (y) { val.y = SpringAxis(val.y, minY, maxY); } if (z) { val.z = SpringAxis(val.z, minZ, maxZ); } } e.positionOffset = rootRotation * val; } private float SpringAxis(float value, float min, float max) { if (value > min && value < max) { return value; } if (value < min) { return Spring(value, min, negative: true); } return Spring(value, max, negative: false); } private float Spring(float value, float limit, bool negative) { float num = value - limit; float num2 = num * spring; if (negative) { return value + Mathf.Clamp(0f - num2, 0f, 0f - num); } return value - Mathf.Clamp(num2, 0f, num); } } [Tooltip("The master weight")] public float weight = 1f; [Tooltip("Reference to the FBBIK component")] public FullBodyBipedIK ik; protected float lastTime; protected float deltaTime => Time.time - lastTime; protected abstract void OnModifyOffset(); protected virtual void Start() { ((MonoBehaviour)this).StartCoroutine(Initiate()); } private IEnumerator Initiate() { while ((Object)(object)ik == (Object)null) { yield return null; } IKSolverFullBodyBiped solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreUpdate, new IKSolver.UpdateDelegate(ModifyOffset)); lastTime = Time.time; } private void ModifyOffset() { if (((Behaviour)this).enabled && !(weight <= 0f) && !(deltaTime <= 0f) && !((Object)(object)ik == (Object)null)) { weight = Mathf.Clamp(weight, 0f, 1f); OnModifyOffset(); lastTime = Time.time; } } protected void ApplyLimits(OffsetLimits[] limits) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) foreach (OffsetLimits offsetLimits in limits) { offsetLimits.Apply(ik.solver.GetEffector(offsetLimits.effector), ((Component)this).transform.rotation); } } protected virtual void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreUpdate, new IKSolver.UpdateDelegate(ModifyOffset)); } } } public abstract class OffsetModifierVRIK : MonoBehaviour { [Tooltip("The master weight")] public float weight = 1f; [Tooltip("Reference to the VRIK component")] public VRIK ik; private float lastTime; protected float deltaTime => Time.time - lastTime; protected abstract void OnModifyOffset(); protected virtual void Start() { ((MonoBehaviour)this).StartCoroutine(Initiate()); } private IEnumerator Initiate() { while ((Object)(object)ik == (Object)null) { yield return null; } IKSolverVR solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreUpdate, new IKSolver.UpdateDelegate(ModifyOffset)); lastTime = Time.time; } private void ModifyOffset() { if (((Behaviour)this).enabled && !(weight <= 0f) && !(deltaTime <= 0f) && !((Object)(object)ik == (Object)null)) { weight = Mathf.Clamp(weight, 0f, 1f); OnModifyOffset(); lastTime = Time.time; } } protected virtual void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverVR solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreUpdate, new IKSolver.UpdateDelegate(ModifyOffset)); } } } public class OffsetPose : MonoBehaviour { [Serializable] public class EffectorLink { public FullBodyBipedEffector effector; public Vector3 offset; public Vector3 pin; public Vector3 pinWeight; public void Apply(IKSolverFullBodyBiped solver, float weight, Quaternion rotation) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) IKEffector iKEffector = solver.GetEffector(effector); iKEffector.positionOffset += rotation * offset * weight; Vector3 val = solver.GetRoot().position + rotation * pin; Vector3 val2 = val - solver.GetEffector(effector).bone.position; Vector3 val3 = pinWeight * Mathf.Abs(weight); solver.GetEffector(effector).positionOffset = new Vector3(Mathf.Lerp(solver.GetEffector(effector).positionOffset.x, val2.x, val3.x), Mathf.Lerp(solver.GetEffector(effector).positionOffset.y, val2.y, val3.y), Mathf.Lerp(solver.GetEffector(effector).positionOffset.z, val2.z, val3.z)); } } public EffectorLink[] effectorLinks = new EffectorLink[0]; public void Apply(IKSolverFullBodyBiped solver, float weight) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < effectorLinks.Length; i++) { effectorLinks[i].Apply(solver, weight, solver.GetRoot().rotation); } } public void Apply(IKSolverFullBodyBiped solver, float weight, Quaternion rotation) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < effectorLinks.Length; i++) { effectorLinks[i].Apply(solver, weight, rotation); } } } public class PenetrationAvoidance : OffsetModifier { [Serializable] public class Avoider { [Serializable] public class EffectorLink { [Tooltip("Effector to apply the offset to.")] public FullBodyBipedEffector effector; [Tooltip("Multiplier of the offset value, can be negative.")] public float weight; } [Tooltip("Bones to start the raycast from. Multiple raycasts can be used by assigning more than 1 bone.")] public Transform[] raycastFrom; [Tooltip("The Transform to raycast towards. Usually the body part that you want to keep from penetrating.")] public Transform raycastTo; [Tooltip("If 0, will use simple raycasting, if > 0, will use sphere casting (better, but slower).")] [Range(0f, 1f)] public float raycastRadius; [Tooltip("Linking this to FBBIK effectors.")] public EffectorLink[] effectors; [Tooltip("The time of smooth interpolation of the offset value to avoid penetration.")] public float smoothTimeIn = 0.1f; [Tooltip("The time of smooth interpolation of the offset value blending out of penetration avoidance.")] public float smoothTimeOut = 0.3f; [Tooltip("Layers to keep penetrating from.")] public LayerMask layers; private Vector3 offset; private Vector3 offsetTarget; private Vector3 offsetV; public void Solve(IKSolverFullBodyBiped solver, float weight) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) offsetTarget = GetOffsetTarget(solver); float num = ((!(((Vector3)(ref offsetTarget)).sqrMagnitude > ((Vector3)(ref offset)).sqrMagnitude)) ? smoothTimeOut : smoothTimeIn); offset = Vector3.SmoothDamp(offset, offsetTarget, ref offsetV, num); EffectorLink[] array = effectors; foreach (EffectorLink effectorLink in array) { IKEffector effector = solver.GetEffector(effectorLink.effector); effector.positionOffset += offset * weight * effectorLink.weight; } } private Vector3 GetOffsetTarget(IKSolverFullBodyBiped solver) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; Transform[] array = raycastFrom; foreach (Transform val2 in array) { val += Raycast(val2.position, raycastTo.position + val); } return val; } private Vector3 Raycast(Vector3 from, Vector3 to) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) Vector3 val = to - from; float magnitude = ((Vector3)(ref val)).magnitude; RaycastHit val2 = default(RaycastHit); if (raycastRadius <= 0f) { Physics.Raycast(from, val, ref val2, magnitude, LayerMask.op_Implicit(layers)); } else { Physics.SphereCast(from, raycastRadius, val, ref val2, magnitude, LayerMask.op_Implicit(layers)); } if ((Object)(object)((RaycastHit)(ref val2)).collider == (Object)null) { return Vector3.zero; } return Vector3.Project(-((Vector3)(ref val)).normalized * (magnitude - ((RaycastHit)(ref val2)).distance), ((RaycastHit)(ref val2)).normal); } } [Tooltip("Definitions of penetration avoidances.")] public Avoider[] avoiders; protected override void OnModifyOffset() { Avoider[] array = avoiders; foreach (Avoider avoider in array) { avoider.Solve(ik.solver, weight); } } } public class Recoil : OffsetModifier { [Serializable] public class RecoilOffset { [Serializable] public class EffectorLink { [Tooltip("Type of the FBBIK effector to use")] public FullBodyBipedEffector effector; [Tooltip("Weight of using this effector")] public float weight; } [Tooltip("Offset vector for the associated effector when doing recoil.")] public Vector3 offset; [Tooltip("When firing before the last recoil has faded, how much of the current recoil offset will be maintained?")] [Range(0f, 1f)] public float additivity = 1f; [Tooltip("Max additive recoil for automatic fire.")] public float maxAdditiveOffsetMag = 0.2f; [Tooltip("Linking this recoil offset to FBBIK effectors.")] public EffectorLink[] effectorLinks; private Vector3 additiveOffset; private Vector3 lastOffset; public void Start() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (!(additivity <= 0f)) { additiveOffset = Vector3.ClampMagnitude(lastOffset * additivity, maxAdditiveOffsetMag); } } public void Apply(IKSolverFullBodyBiped solver, Quaternion rotation, float masterWeight, float length, float timeLeft) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) additiveOffset = Vector3.Lerp(Vector3.zero, additiveOffset, timeLeft / length); lastOffset = rotation * (offset * masterWeight) + rotation * additiveOffset; EffectorLink[] array = effectorLinks; foreach (EffectorLink effectorLink in array) { IKEffector effector = solver.GetEffector(effectorLink.effector); effector.positionOffset += lastOffset * effectorLink.weight; } } } [Serializable] public enum Handedness { Right, Left } [Tooltip("Reference to the AimIK component. Optional, only used to getting the aiming direction.")] public AimIK aimIK; [Tooltip("Set this true if you are using IKExecutionOrder.cs or a custom script to force AimIK solve after FBBIK.")] public bool aimIKSolvedLast; [Tooltip("Which hand is holding the weapon?")] public Handedness handedness; [Tooltip("Check for 2-handed weapons.")] public bool twoHanded = true; [Tooltip("Weight curve for the recoil offsets. Recoil procedure is as long as this curve.")] public AnimationCurve recoilWeight; [Tooltip("How much is the magnitude randomized each time Recoil is called?")] public float magnitudeRandom = 0.1f; [Tooltip("How much is the rotation randomized each time Recoil is called?")] public Vector3 rotationRandom; [Tooltip("Rotating the primary hand bone for the recoil (in local space).")] public Vector3 handRotationOffset; [Tooltip("Time of blending in another recoil when doing automatic fire.")] public float blendTime; [Space(10f)] [Tooltip("FBBIK effector position offsets for the recoil (in aiming direction space).")] public RecoilOffset[] offsets; [HideInInspector] public Quaternion rotationOffset = Quaternion.identity; private float magnitudeMlp = 1f; private float endTime = -1f; private Quaternion handRotation; private Quaternion secondaryHandRelativeRotation; private Quaternion randomRotation; private float length = 1f; private bool initiated; private float blendWeight; private float w; private Quaternion primaryHandRotation = Quaternion.identity; private bool handRotationsSet; private Vector3 aimIKAxis; public bool isFinished => Time.time > endTime; private IKEffector primaryHandEffector { get { if (handedness == Handedness.Right) { return ik.solver.rightHandEffector; } return ik.solver.leftHandEffector; } } private IKEffector secondaryHandEffector { get { if (handedness == Handedness.Right) { return ik.solver.leftHandEffector; } return ik.solver.rightHandEffector; } } private Transform primaryHand => primaryHandEffector.bone; private Transform secondaryHand => secondaryHandEffector.bone; public void SetHandRotations(Quaternion leftHandRotation, Quaternion rightHandRotation) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (handedness == Handedness.Left) { primaryHandRotation = leftHandRotation; } else { primaryHandRotation = rightHandRotation; } handRotationsSet = true; } public void Fire(float magnitude) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) float num = magnitude * Random.value * magnitudeRandom; magnitudeMlp = magnitude + num; randomRotation = Quaternion.Euler(rotationRandom * Random.value); RecoilOffset[] array = offsets; foreach (RecoilOffset recoilOffset in array) { recoilOffset.Start(); } if (Time.time < endTime) { blendWeight = 0f; } else { blendWeight = 1f; } length = ((Keyframe)(ref recoilWeight.keys[^1])).time; endTime = Time.time + length; } protected override void OnModifyOffset() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)aimIK != (Object)null) { aimIKAxis = aimIK.solver.axis; } if (Time.time >= endTime) { rotationOffset = Quaternion.identity; return; } if (!initiated && (Object)(object)ik != (Object)null) { initiated = true; IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPostUpdate, new IKSolver.UpdateDelegate(AfterFBBIK)); if ((Object)(object)aimIK != (Object)null) { IKSolverAim solver2 = aimIK.solver; solver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver2.OnPostUpdate, new IKSolver.UpdateDelegate(AfterAimIK)); } } blendTime = Mathf.Max(blendTime, 0f); if (blendTime > 0f) { blendWeight = Mathf.Min(blendWeight + Time.deltaTime * (1f / blendTime), 1f); } else { blendWeight = 1f; } float num = recoilWeight.Evaluate(length - (endTime - Time.time)) * magnitudeMlp; w = Mathf.Lerp(w, num, blendWeight); Quaternion val = ((!((Object)(object)aimIK != (Object)null) || !((Object)(object)aimIK.solver.transform != (Object)null) || aimIKSolvedLast) ? ik.references.root.rotation : Quaternion.LookRotation(aimIK.solver.IKPosition - aimIK.solver.transform.position, ik.references.root.up)); val = randomRotation * val; RecoilOffset[] array = offsets; foreach (RecoilOffset recoilOffset in array) { recoilOffset.Apply(ik.solver, val, w, length, endTime - Time.time); } if (!handRotationsSet) { primaryHandRotation = primaryHand.rotation; } handRotationsSet = false; rotationOffset = Quaternion.Lerp(Quaternion.identity, Quaternion.Euler(randomRotation * primaryHandRotation * handRotationOffset), w); handRotation = rotationOffset * primaryHandRotation; if (twoHanded) { Vector3 val2 = Quaternion.Inverse(primaryHand.rotation) * (secondaryHand.position - primaryHand.position); secondaryHandRelativeRotation = Quaternion.Inverse(primaryHand.rotation) * secondaryHand.rotation; Vector3 val3 = primaryHand.position + primaryHandEffector.positionOffset; Vector3 val4 = val3 + handRotation * val2; IKEffector iKEffector = secondaryHandEffector; iKEffector.positionOffset += val4 - (secondaryHand.position + secondaryHandEffector.positionOffset); } if ((Object)(object)aimIK != (Object)null && aimIKSolvedLast) { aimIK.solver.axis = Quaternion.Inverse(ik.references.root.rotation) * Quaternion.Inverse(rotationOffset) * aimIKAxis; } } private void AfterFBBIK() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (!(Time.time >= endTime)) { primaryHand.rotation = handRotation; if (twoHanded) { secondaryHand.rotation = primaryHand.rotation * secondaryHandRelativeRotation; } } } private void AfterAimIK() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (aimIKSolvedLast) { aimIK.solver.axis = aimIKAxis; } } protected override void OnDestroy() { base.OnDestroy(); if ((Object)(object)ik != (Object)null && initiated) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPostUpdate, new IKSolver.UpdateDelegate(AfterFBBIK)); if ((Object)(object)aimIK != (Object)null) { IKSolverAim solver2 = aimIK.solver; solver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver2.OnPostUpdate, new IKSolver.UpdateDelegate(AfterAimIK)); } } } } public class ShoulderRotator : MonoBehaviour { [Tooltip("Weight of shoulder rotation")] public float weight = 1.5f; [Tooltip("The greater the offset, the sooner the shoulder will start rotating")] public float offset = 0.2f; private FullBodyBipedIK ik; private bool skip; private void Start() { ik = ((Component)this).GetComponent(); IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPostUpdate, new IKSolver.UpdateDelegate(RotateShoulders)); } private void RotateShoulders() { if (!((Object)(object)ik == (Object)null) && !(ik.solver.IKPositionWeight <= 0f)) { if (skip) { skip = false; return; } RotateShoulder(FullBodyBipedChain.LeftArm, weight, offset); RotateShoulder(FullBodyBipedChain.RightArm, weight, offset); skip = true; ik.solver.Update(); } } private void RotateShoulder(FullBodyBipedChain chain, float weight, float offset) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(GetParentBoneMap(chain).swingDirection, ik.solver.GetEndEffector(chain).position - GetParentBoneMap(chain).transform.position); Vector3 val2 = ik.solver.GetEndEffector(chain).position - ik.solver.GetLimbMapping(chain).bone1.position; float num = ik.solver.GetChain(chain).nodes[0].length + ik.solver.GetChain(chain).nodes[1].length; float num2 = ((Vector3)(ref val2)).magnitude / num - 1f + offset; num2 = Mathf.Clamp(num2 * weight, 0f, 1f); Quaternion val3 = Quaternion.Lerp(Quaternion.identity, val, num2 * ik.solver.GetEndEffector(chain).positionWeight * ik.solver.IKPositionWeight); ik.solver.GetLimbMapping(chain).parentBone.rotation = val3 * ik.solver.GetLimbMapping(chain).parentBone.rotation; } private IKMapping.BoneMap GetParentBoneMap(FullBodyBipedChain chain) { return ik.solver.GetLimbMapping(chain).GetBoneMap(IKMappingLimb.BoneMapType.Parent); } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPostUpdate, new IKSolver.UpdateDelegate(RotateShoulders)); } } } public static class VRIKCalibrator { [Serializable] public class Settings { [Tooltip("Multiplies character scale")] public float scaleMlp = 1f; [Tooltip("Local axis of the HMD facing forward.")] public Vector3 headTrackerForward = Vector3.forward; [Tooltip("Local axis of the HMD facing up.")] public Vector3 headTrackerUp = Vector3.up; [Tooltip("Local axis of the hand trackers pointing from the wrist towards the palm.")] public Vector3 handTrackerForward = Vector3.forward; [Tooltip("Local axis of the hand trackers pointing in the direction of the surface normal of the back of the hand.")] public Vector3 handTrackerUp = Vector3.up; [Tooltip("Local axis of the foot trackers towards the player's forward direction.")] public Vector3 footTrackerForward = Vector3.forward; [Tooltip("Local axis of the foot tracker towards the up direction.")] public Vector3 footTrackerUp = Vector3.up; [Space(10f)] [Tooltip("Offset of the head bone from the HMD in (headTrackerForward, headTrackerUp) space relative to the head tracker.")] public Vector3 headOffset; [Tooltip("Offset of the hand bones from the hand trackers in (handTrackerForward, handTrackerUp) space relative to the hand trackers.")] public Vector3 handOffset; [Tooltip("Forward offset of the foot bones from the foot trackers.")] public float footForwardOffset; [Tooltip("Inward offset of the foot bones from the foot trackers.")] public float footInwardOffset; [Tooltip("Used for adjusting foot heading relative to the foot trackers.")] [Range(-180f, 180f)] public float footHeadingOffset; [Range(0f, 1f)] public float pelvisPositionWeight = 1f; [Range(0f, 1f)] public float pelvisRotationWeight = 1f; } [Serializable] public class CalibrationData { [Serializable] public class Target { public bool used; public Vector3 localPosition; public Quaternion localRotation; public Target(Transform t) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) used = (Object)(object)t != (Object)null; if (used) { localPosition = t.localPosition; localRotation = t.localRotation; } } public void SetTo(Transform t) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (used) { t.localPosition = localPosition; t.localRotation = localRotation; } } } public float scale; public Target head; public Target leftHand; public Target rightHand; public Target pelvis; public Target leftFoot; public Target rightFoot; public Target leftLegGoal; public Target rightLegGoal; public Vector3 pelvisTargetRight; public float pelvisPositionWeight; public float pelvisRotationWeight; } public static void RecalibrateScale(VRIK ik, CalibrationData data, Settings settings) { RecalibrateScale(ik, data, settings.scaleMlp); } public static void RecalibrateScale(VRIK ik, CalibrationData data, float scaleMlp) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) CalibrateScale(ik, scaleMlp); data.scale = ik.references.root.localScale.y; } private static void CalibrateScale(VRIK ik, Settings settings) { CalibrateScale(ik, settings.scaleMlp); } private static void CalibrateScale(VRIK ik, float scaleMlp = 1f) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) float num = (ik.solver.spine.headTarget.position.y - ik.references.root.position.y) / (ik.references.head.position.y - ik.references.root.position.y); Transform root = ik.references.root; root.localScale *= num * scaleMlp; } public static CalibrationData Calibrate(VRIK ik, Settings settings, Transform headTracker, Transform bodyTracker = null, Transform leftHandTracker = null, Transform rightHandTracker = null, Transform leftFootTracker = null, Transform rightFootTracker = null) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_06aa: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_08aa: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08af: Unknown result type (might be due to invalid IL or missing references) if (!ik.solver.initiated) { Debug.LogError((object)"Can not calibrate before VRIK has initiated."); return null; } if ((Object)(object)headTracker == (Object)null) { Debug.LogError((object)"Can not calibrate VRIK without the head tracker."); return null; } CalibrationData calibrationData = new CalibrationData(); ik.solver.FixTransforms(); Vector3 position = headTracker.position + headTracker.rotation * Quaternion.LookRotation(settings.headTrackerForward, settings.headTrackerUp) * settings.headOffset; ik.references.root.position = new Vector3(position.x, ik.references.root.position.y, position.z); Vector3 val = headTracker.rotation * settings.headTrackerForward; val.y = 0f; ik.references.root.rotation = Quaternion.LookRotation(val); Transform val2 = ((!((Object)(object)ik.solver.spine.headTarget == (Object)null)) ? ik.solver.spine.headTarget : new GameObject("Head Target").transform); val2.position = position; val2.rotation = ik.references.head.rotation; val2.parent = headTracker; ik.solver.spine.headTarget = val2; float num = (val2.position.y - ik.references.root.position.y) / (ik.references.head.position.y - ik.references.root.position.y); Transform root = ik.references.root; root.localScale *= num * settings.scaleMlp; if ((Object)(object)bodyTracker != (Object)null) { Transform val3 = ((!((Object)(object)ik.solver.spine.pelvisTarget == (Object)null)) ? ik.solver.spine.pelvisTarget : new GameObject("Pelvis Target").transform); val3.position = ik.references.pelvis.position; val3.rotation = ik.references.pelvis.rotation; val3.parent = bodyTracker; ik.solver.spine.pelvisTarget = val3; ik.solver.spine.pelvisPositionWeight = settings.pelvisPositionWeight; ik.solver.spine.pelvisRotationWeight = settings.pelvisRotationWeight; ik.solver.plantFeet = false; ik.solver.spine.maxRootAngle = 180f; } else if ((Object)(object)leftFootTracker != (Object)null && (Object)(object)rightFootTracker != (Object)null) { ik.solver.spine.maxRootAngle = 0f; } if ((Object)(object)leftHandTracker != (Object)null) { Transform val4 = ((!((Object)(object)ik.solver.leftArm.target == (Object)null)) ? ik.solver.leftArm.target : new GameObject("Left Hand Target").transform); val4.position = leftHandTracker.position + leftHandTracker.rotation * Quaternion.LookRotation(settings.handTrackerForward, settings.handTrackerUp) * settings.handOffset; Vector3 upAxis = Vector3.Cross(ik.solver.leftArm.wristToPalmAxis, ik.solver.leftArm.palmToThumbAxis); val4.rotation = QuaTools.MatchRotation(leftHandTracker.rotation * Quaternion.LookRotation(settings.handTrackerForward, settings.handTrackerUp), settings.handTrackerForward, settings.handTrackerUp, ik.solver.leftArm.wristToPalmAxis, upAxis); val4.parent = leftHandTracker; ik.solver.leftArm.target = val4; ik.solver.leftArm.positionWeight = 1f; ik.solver.leftArm.rotationWeight = 1f; } else { ik.solver.leftArm.positionWeight = 0f; ik.solver.leftArm.rotationWeight = 0f; } if ((Object)(object)rightHandTracker != (Object)null) { Transform val5 = ((!((Object)(object)ik.solver.rightArm.target == (Object)null)) ? ik.solver.rightArm.target : new GameObject("Right Hand Target").transform); val5.position = rightHandTracker.position + rightHandTracker.rotation * Quaternion.LookRotation(settings.handTrackerForward, settings.handTrackerUp) * settings.handOffset; Vector3 upAxis2 = -Vector3.Cross(ik.solver.rightArm.wristToPalmAxis, ik.solver.rightArm.palmToThumbAxis); val5.rotation = QuaTools.MatchRotation(rightHandTracker.rotation * Quaternion.LookRotation(settings.handTrackerForward, settings.handTrackerUp), settings.handTrackerForward, settings.handTrackerUp, ik.solver.rightArm.wristToPalmAxis, upAxis2); val5.parent = rightHandTracker; ik.solver.rightArm.target = val5; ik.solver.rightArm.positionWeight = 1f; ik.solver.rightArm.rotationWeight = 1f; } else { ik.solver.rightArm.positionWeight = 0f; ik.solver.rightArm.rotationWeight = 0f; } if ((Object)(object)leftFootTracker != (Object)null) { CalibrateLeg(settings, leftFootTracker, ik.solver.leftLeg, (!((Object)(object)ik.references.leftToes != (Object)null)) ? ik.references.leftFoot : ik.references.leftToes, ik.references.root.forward, isLeft: true); } if ((Object)(object)rightFootTracker != (Object)null) { CalibrateLeg(settings, rightFootTracker, ik.solver.rightLeg, (!((Object)(object)ik.references.rightToes != (Object)null)) ? ik.references.rightFoot : ik.references.rightToes, ik.references.root.forward, isLeft: false); } bool flag = (Object)(object)bodyTracker != (Object)null || ((Object)(object)leftFootTracker != (Object)null && (Object)(object)rightFootTracker != (Object)null); VRIKRootController vRIKRootController = ((Component)ik.references.root).GetComponent(); if (flag) { if ((Object)(object)vRIKRootController == (Object)null) { vRIKRootController = ((Component)ik.references.root).gameObject.AddComponent(); } vRIKRootController.Calibrate(); } else if ((Object)(object)vRIKRootController != (Object)null) { Object.Destroy((Object)(object)vRIKRootController); } ik.solver.spine.minHeadHeight = 0f; ik.solver.locomotion.weight = ((!((Object)(object)bodyTracker == (Object)null) || !((Object)(object)leftFootTracker == (Object)null) || !((Object)(object)rightFootTracker == (Object)null)) ? 0f : 1f); calibrationData.scale = ik.references.root.localScale.y; calibrationData.head = new CalibrationData.Target(ik.solver.spine.headTarget); calibrationData.pelvis = new CalibrationData.Target(ik.solver.spine.pelvisTarget); calibrationData.leftHand = new CalibrationData.Target(ik.solver.leftArm.target); calibrationData.rightHand = new CalibrationData.Target(ik.solver.rightArm.target); calibrationData.leftFoot = new CalibrationData.Target(ik.solver.leftLeg.target); calibrationData.rightFoot = new CalibrationData.Target(ik.solver.rightLeg.target); calibrationData.leftLegGoal = new CalibrationData.Target(ik.solver.leftLeg.bendGoal); calibrationData.rightLegGoal = new CalibrationData.Target(ik.solver.rightLeg.bendGoal); calibrationData.pelvisTargetRight = ((!((Object)(object)vRIKRootController != (Object)null)) ? Vector3.zero : vRIKRootController.pelvisTargetRight); calibrationData.pelvisPositionWeight = ik.solver.spine.pelvisPositionWeight; calibrationData.pelvisRotationWeight = ik.solver.spine.pelvisRotationWeight; return calibrationData; } private static void CalibrateLeg(Settings settings, Transform tracker, IKSolverVR.Leg leg, Transform lastBone, Vector3 rootForward, bool isLeft) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) string text = ((!isLeft) ? "Right" : "Left"); Transform val = ((!((Object)(object)leg.target == (Object)null)) ? leg.target : new GameObject(text + " Foot Target").transform); Quaternion val2 = tracker.rotation * Quaternion.LookRotation(settings.footTrackerForward, settings.footTrackerUp); Vector3 val3 = val2 * Vector3.forward; val3.y = 0f; val2 = Quaternion.LookRotation(val3); float num = ((!isLeft) ? (0f - settings.footInwardOffset) : settings.footInwardOffset); val.position = tracker.position + val2 * new Vector3(num, 0f, settings.footForwardOffset); val.position = new Vector3(val.position.x, lastBone.position.y, val.position.z); val.rotation = lastBone.rotation; Vector3 val4 = AxisTools.GetAxisVectorToDirection(lastBone, rootForward); if (Vector3.Dot(lastBone.rotation * val4, rootForward) < 0f) { val4 = -val4; } Vector3 val5 = Quaternion.Inverse(Quaternion.LookRotation(val.rotation * val4)) * val3; float num2 = Mathf.Atan2(val5.x, val5.z) * 57.29578f; float num3 = ((!isLeft) ? (0f - settings.footHeadingOffset) : settings.footHeadingOffset); val.rotation = Quaternion.AngleAxis(num2 + num3, Vector3.up) * val.rotation; val.parent = tracker; leg.target = val; leg.positionWeight = 1f; leg.rotationWeight = 1f; Transform val6 = ((!((Object)(object)leg.bendGoal == (Object)null)) ? leg.bendGoal : new GameObject(text + " Leg Bend Goal").transform); val6.position = lastBone.position + val2 * Vector3.forward + val2 * Vector3.up; val6.parent = tracker; leg.bendGoal = val6; leg.bendGoalWeight = 1f; } public static void Calibrate(VRIK ik, CalibrationData data, Transform headTracker, Transform bodyTracker = null, Transform leftHandTracker = null, Transform rightHandTracker = null, Transform leftFootTracker = null, Transform rightFootTracker = null) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) if (!ik.solver.initiated) { Debug.LogError((object)"Can not calibrate before VRIK has initiated."); return; } if ((Object)(object)headTracker == (Object)null) { Debug.LogError((object)"Can not calibrate VRIK without the head tracker."); return; } ik.solver.FixTransforms(); Transform val = ((!((Object)(object)ik.solver.spine.headTarget == (Object)null)) ? ik.solver.spine.headTarget : new GameObject("Head Target").transform); val.parent = headTracker; data.head.SetTo(val); ik.solver.spine.headTarget = val; ik.references.root.localScale = data.scale * Vector3.one; if ((Object)(object)bodyTracker != (Object)null && data.pelvis != null) { Transform val2 = ((!((Object)(object)ik.solver.spine.pelvisTarget == (Object)null)) ? ik.solver.spine.pelvisTarget : new GameObject("Pelvis Target").transform); val2.parent = bodyTracker; data.pelvis.SetTo(val2); ik.solver.spine.pelvisTarget = val2; ik.solver.spine.pelvisPositionWeight = data.pelvisPositionWeight; ik.solver.spine.pelvisRotationWeight = data.pelvisRotationWeight; ik.solver.plantFeet = false; ik.solver.spine.maxRootAngle = 180f; } else if ((Object)(object)leftFootTracker != (Object)null && (Object)(object)rightFootTracker != (Object)null) { ik.solver.spine.maxRootAngle = 0f; } if ((Object)(object)leftHandTracker != (Object)null) { Transform val3 = ((!((Object)(object)ik.solver.leftArm.target == (Object)null)) ? ik.solver.leftArm.target : new GameObject("Left Hand Target").transform); val3.parent = leftHandTracker; data.leftHand.SetTo(val3); ik.solver.leftArm.target = val3; ik.solver.leftArm.positionWeight = 1f; ik.solver.leftArm.rotationWeight = 1f; } else { ik.solver.leftArm.positionWeight = 0f; ik.solver.leftArm.rotationWeight = 0f; } if ((Object)(object)rightHandTracker != (Object)null) { Transform val4 = ((!((Object)(object)ik.solver.rightArm.target == (Object)null)) ? ik.solver.rightArm.target : new GameObject("Right Hand Target").transform); val4.parent = rightHandTracker; data.rightHand.SetTo(val4); ik.solver.rightArm.target = val4; ik.solver.rightArm.positionWeight = 1f; ik.solver.rightArm.rotationWeight = 1f; } else { ik.solver.rightArm.positionWeight = 0f; ik.solver.rightArm.rotationWeight = 0f; } if ((Object)(object)leftFootTracker != (Object)null) { CalibrateLeg(data, leftFootTracker, ik.solver.leftLeg, (!((Object)(object)ik.references.leftToes != (Object)null)) ? ik.references.leftFoot : ik.references.leftToes, ik.references.root.forward, isLeft: true); } if ((Object)(object)rightFootTracker != (Object)null) { CalibrateLeg(data, rightFootTracker, ik.solver.rightLeg, (!((Object)(object)ik.references.rightToes != (Object)null)) ? ik.references.rightFoot : ik.references.rightToes, ik.references.root.forward, isLeft: false); } bool flag = (Object)(object)bodyTracker != (Object)null || ((Object)(object)leftFootTracker != (Object)null && (Object)(object)rightFootTracker != (Object)null); VRIKRootController vRIKRootController = ((Component)ik.references.root).GetComponent(); if (flag) { if ((Object)(object)vRIKRootController == (Object)null) { vRIKRootController = ((Component)ik.references.root).gameObject.AddComponent(); } vRIKRootController.Calibrate(data); } else if ((Object)(object)vRIKRootController != (Object)null) { Object.Destroy((Object)(object)vRIKRootController); } ik.solver.spine.minHeadHeight = 0f; ik.solver.locomotion.weight = ((!((Object)(object)bodyTracker == (Object)null) || !((Object)(object)leftFootTracker == (Object)null) || !((Object)(object)rightFootTracker == (Object)null)) ? 0f : 1f); } private static void CalibrateLeg(CalibrationData data, Transform tracker, IKSolverVR.Leg leg, Transform lastBone, Vector3 rootForward, bool isLeft) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) if ((!isLeft || data.leftFoot != null) && (isLeft || data.rightFoot != null)) { string text = ((!isLeft) ? "Right" : "Left"); Transform val = ((!((Object)(object)leg.target == (Object)null)) ? leg.target : new GameObject(text + " Foot Target").transform); val.parent = tracker; if (isLeft) { data.leftFoot.SetTo(val); } else { data.rightFoot.SetTo(val); } leg.target = val; leg.positionWeight = 1f; leg.rotationWeight = 1f; Transform val2 = ((!((Object)(object)leg.bendGoal == (Object)null)) ? leg.bendGoal : new GameObject(text + " Leg Bend Goal").transform); val2.parent = tracker; if (isLeft) { data.leftLegGoal.SetTo(val2); } else { data.rightLegGoal.SetTo(val2); } leg.bendGoal = val2; leg.bendGoalWeight = 1f; } } public static CalibrationData Calibrate(VRIK ik, Transform centerEyeAnchor, Transform leftHandAnchor, Transform rightHandAnchor, Vector3 centerEyePositionOffset, Vector3 centerEyeRotationOffset, Vector3 handPositionOffset, Vector3 handRotationOffset, float scaleMlp = 1f) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) CalibrateHead(ik, centerEyeAnchor, centerEyePositionOffset, centerEyeRotationOffset); CalibrateHands(ik, leftHandAnchor, rightHandAnchor, handPositionOffset, handRotationOffset); CalibrateScale(ik, scaleMlp); CalibrationData calibrationData = new CalibrationData(); calibrationData.scale = ik.references.root.localScale.y; calibrationData.head = new CalibrationData.Target(ik.solver.spine.headTarget); calibrationData.leftHand = new CalibrationData.Target(ik.solver.leftArm.target); calibrationData.rightHand = new CalibrationData.Target(ik.solver.rightArm.target); return calibrationData; } public static void CalibrateHead(VRIK ik, Transform centerEyeAnchor, Vector3 anchorPositionOffset, Vector3 anchorRotationOffset) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik.solver.spine.headTarget == (Object)null) { ik.solver.spine.headTarget = new GameObject("Head IK Target").transform; } Vector3 val = Quaternion.Inverse(ik.references.head.rotation) * ik.references.root.forward; Vector3 val2 = Quaternion.Inverse(ik.references.head.rotation) * ik.references.root.up; Quaternion val3 = Quaternion.LookRotation(val, val2); Vector3 val4 = ik.references.head.position + ik.references.head.rotation * val3 * anchorPositionOffset; Quaternion val5 = ik.references.head.rotation * val3 * Quaternion.Euler(anchorRotationOffset); Quaternion val6 = Quaternion.Inverse(val5); ik.solver.spine.headTarget.parent = centerEyeAnchor; ik.solver.spine.headTarget.localPosition = val6 * (ik.references.head.position - val4); ik.solver.spine.headTarget.localRotation = val6 * ik.references.head.rotation; } public static void CalibrateBody(VRIK ik, Transform pelvisTracker, Vector3 trackerPositionOffset, Vector3 trackerRotationOffset) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik.solver.spine.pelvisTarget == (Object)null) { ik.solver.spine.pelvisTarget = new GameObject("Pelvis IK Target").transform; } ik.solver.spine.pelvisTarget.position = ik.references.pelvis.position + ik.references.root.rotation * trackerPositionOffset; ik.solver.spine.pelvisTarget.rotation = ik.references.root.rotation * Quaternion.Euler(trackerRotationOffset); ik.solver.spine.pelvisTarget.parent = pelvisTracker; } public static void CalibrateHands(VRIK ik, Transform leftHandAnchor, Transform rightHandAnchor, Vector3 anchorPositionOffset, Vector3 anchorRotationOffset) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik.solver.leftArm.target == (Object)null) { ik.solver.leftArm.target = new GameObject("Left Hand IK Target").transform; } if ((Object)(object)ik.solver.rightArm.target == (Object)null) { ik.solver.rightArm.target = new GameObject("Right Hand IK Target").transform; } CalibrateHand(ik.references.leftHand, ik.references.leftForearm, ik.solver.leftArm.target, leftHandAnchor, anchorPositionOffset, anchorRotationOffset, isLeft: true); CalibrateHand(ik.references.rightHand, ik.references.rightForearm, ik.solver.rightArm.target, rightHandAnchor, anchorPositionOffset, anchorRotationOffset, isLeft: false); } private static void CalibrateHand(Transform hand, Transform forearm, Transform target, Transform anchor, Vector3 positionOffset, Vector3 rotationOffset, bool isLeft) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (isLeft) { positionOffset.x = 0f - positionOffset.x; rotationOffset.y = 0f - rotationOffset.y; rotationOffset.z = 0f - rotationOffset.z; } Vector3 val = GuessWristToPalmAxis(hand, forearm); Vector3 val2 = GuessPalmToThumbAxis(hand, forearm); Quaternion val3 = Quaternion.LookRotation(val, val2); Vector3 val4 = hand.position + hand.rotation * val3 * positionOffset; Quaternion val5 = hand.rotation * val3 * Quaternion.Euler(rotationOffset); Quaternion val6 = Quaternion.Inverse(val5); target.parent = anchor; target.localPosition = val6 * (hand.position - val4); target.localRotation = val6 * hand.rotation; } public static Vector3 GuessWristToPalmAxis(Transform hand, Transform forearm) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = forearm.position - hand.position; Vector3 val2 = AxisTools.ToVector3(AxisTools.GetAxisToDirection(hand, val)); if (Vector3.Dot(val, hand.rotation * val2) > 0f) { val2 = -val2; } return val2; } public static Vector3 GuessPalmToThumbAxis(Transform hand, Transform forearm) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) if (hand.childCount == 0) { Debug.LogWarning((object)("Hand " + ((Object)hand).name + " does not have any fingers, VRIK can not guess the hand bone's orientation. Please assign 'Wrist To Palm Axis' and 'Palm To Thumb Axis' manually for both arms in VRIK settings."), (Object)(object)hand); return Vector3.zero; } float num = float.PositiveInfinity; int num2 = 0; for (int i = 0; i < hand.childCount; i++) { float num3 = Vector3.SqrMagnitude(hand.GetChild(i).position - hand.position); if (num3 < num) { num = num3; num2 = i; } } Vector3 val = Vector3.Cross(hand.position - forearm.position, hand.GetChild(num2).position - hand.position); Vector3 val2 = Vector3.Cross(val, hand.position - forearm.position); Vector3 val3 = AxisTools.ToVector3(AxisTools.GetAxisToDirection(hand, val2)); if (Vector3.Dot(val2, hand.rotation * val3) < 0f) { val3 = -val3; } return val3; } } public class VRIKLODController : MonoBehaviour { public Renderer LODRenderer; public float LODDistance = 15f; public bool allowCulled = true; private VRIK ik; private void Start() { ik = ((Component)this).GetComponent(); } private void Update() { ik.solver.LOD = GetLODLevel(); } private int GetLODLevel() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (allowCulled) { if ((Object)(object)LODRenderer == (Object)null) { return 0; } if (!LODRenderer.isVisible) { return 2; } } Vector3 val = ((Component)ik).transform.position - ((Component)Camera.main).transform.position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude > LODDistance * LODDistance) { return 1; } return 0; } } public class VRIKRootController : MonoBehaviour { private Transform pelvisTarget; private Transform leftFootTarget; private Transform rightFootTarget; private VRIK ik; public Vector3 pelvisTargetRight { get; private set; } private void Awake() { ik = ((Component)this).GetComponent(); IKSolverVR solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreUpdate, new IKSolver.UpdateDelegate(OnPreUpdate)); Calibrate(); } public void Calibrate() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"No VRIK found on VRIKRootController's GameObject.", (Object)(object)((Component)this).transform); return; } pelvisTarget = ik.solver.spine.pelvisTarget; leftFootTarget = ik.solver.leftLeg.target; rightFootTarget = ik.solver.rightLeg.target; if ((Object)(object)pelvisTarget != (Object)null) { pelvisTargetRight = Quaternion.Inverse(pelvisTarget.rotation) * ik.references.root.right; } } public void Calibrate(VRIKCalibrator.CalibrationData data) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"No VRIK found on VRIKRootController's GameObject.", (Object)(object)((Component)this).transform); return; } pelvisTarget = ik.solver.spine.pelvisTarget; leftFootTarget = ik.solver.leftLeg.target; rightFootTarget = ik.solver.rightLeg.target; if ((Object)(object)pelvisTarget != (Object)null) { pelvisTargetRight = data.pelvisTargetRight; } } private void OnPreUpdate() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled) { if ((Object)(object)pelvisTarget != (Object)null) { ik.references.root.position = new Vector3(pelvisTarget.position.x, ik.references.root.position.y, pelvisTarget.position.z); Vector3 val = Vector3.Cross(pelvisTarget.rotation * pelvisTargetRight, ik.references.root.up); val.y = 0f; ik.references.root.rotation = Quaternion.LookRotation(val); ik.references.pelvis.position = Vector3.Lerp(ik.references.pelvis.position, pelvisTarget.position, ik.solver.spine.pelvisPositionWeight); ik.references.pelvis.rotation = Quaternion.Slerp(ik.references.pelvis.rotation, pelvisTarget.rotation, ik.solver.spine.pelvisRotationWeight); } else if ((Object)(object)leftFootTarget != (Object)null && (Object)(object)rightFootTarget != (Object)null) { ik.references.root.position = Vector3.Lerp(leftFootTarget.position, rightFootTarget.position, 0.5f); } } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverVR solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreUpdate, new IKSolver.UpdateDelegate(OnPreUpdate)); } } } } namespace RootMotion.Demos { public class AimBoxing : MonoBehaviour { public AimIK aimIK; public Transform pin; private void LateUpdate() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) aimIK.solver.transform.LookAt(pin.position); ((IKSolver)aimIK.solver).IKPosition = ((Component)this).transform.position; } } public class AimSwing : MonoBehaviour { public AimIK ik; [Tooltip("The direction of the animated weapon swing in character space. Tweak this value to adjust the aiming.")] public Vector3 animatedSwingDirection = Vector3.forward; private void LateUpdate() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) ik.solver.axis = ik.solver.transform.InverseTransformVector(((Component)ik).transform.rotation * animatedSwingDirection); } } public class SecondHandOnGun : MonoBehaviour { public AimIK aim; public LimbIK leftArmIK; public Transform leftHand; public Transform rightHand; public Vector3 leftHandPositionOffset; public Vector3 leftHandRotationOffset; private Vector3 leftHandPosRelToRight; private Quaternion leftHandRotRelToRight; private void Start() { ((Behaviour)aim).enabled = false; ((Behaviour)leftArmIK).enabled = false; } private void LateUpdate() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) leftHandPosRelToRight = rightHand.InverseTransformPoint(leftHand.position); leftHandRotRelToRight = Quaternion.Inverse(rightHand.rotation) * leftHand.rotation; ((IKSolver)aim.solver).Update(); ((IKSolver)leftArmIK.solver).IKPosition = rightHand.TransformPoint(leftHandPosRelToRight + leftHandPositionOffset); ((IKSolverTrigonometric)leftArmIK.solver).IKRotation = rightHand.rotation * Quaternion.Euler(leftHandRotationOffset) * leftHandRotRelToRight; ((IKSolver)leftArmIK.solver).Update(); } } public class SimpleAimingSystem : MonoBehaviour { [Tooltip("AimPoser is a tool that returns an animation name based on direction.")] public AimPoser aimPoser; [Tooltip("Reference to the AimIK component.")] public AimIK aim; [Tooltip("Reference to the LookAt component (only used for the head in this instance).")] public LookAtIK lookAt; [Tooltip("Reference to the Animator component.")] public Animator animator; [Tooltip("Time of cross-fading from pose to pose.")] public float crossfadeTime = 0.2f; [Tooltip("Will keep the aim target at a distance.")] public float minAimDistance = 0.5f; private Pose aimPose; private Pose lastPose; private void Start() { ((Behaviour)aim).enabled = false; ((Behaviour)lookAt).enabled = false; } private void LateUpdate() { if ((Object)(object)((IKSolverHeuristic)aim.solver).target == (Object)null) { Debug.LogWarning((object)"AimIK and LookAtIK need to have their 'Target' value assigned.", (Object)(object)((Component)this).transform); } Pose(); ((IKSolver)aim.solver).Update(); if ((Object)(object)lookAt != (Object)null) { ((IKSolver)lookAt.solver).Update(); } } private void Pose() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) LimitAimTarget(); Vector3 val = ((IKSolverHeuristic)aim.solver).target.position - ((Point)((IKSolverHeuristic)aim.solver).bones[0]).transform.position; Vector3 val2 = ((Component)this).transform.InverseTransformDirection(val); aimPose = aimPoser.GetPose(val2); if (aimPose != lastPose) { aimPoser.SetPoseActive(aimPose); lastPose = aimPose; } Pose[] poses = aimPoser.poses; foreach (Pose val3 in poses) { if (val3 == aimPose) { DirectCrossFade(val3.name, 1f); } else { DirectCrossFade(val3.name, 0f); } } } private void LimitAimTarget() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Point)((IKSolverHeuristic)aim.solver).bones[0]).transform.position; Vector3 val = ((IKSolverHeuristic)aim.solver).target.position - position; val = ((Vector3)(ref val)).normalized * Mathf.Max(((Vector3)(ref val)).magnitude, minAimDistance); ((IKSolverHeuristic)aim.solver).target.position = position + val; } private void DirectCrossFade(string state, float target) { float num = Mathf.MoveTowards(animator.GetFloat(state), target, Time.deltaTime * (1f / crossfadeTime)); animator.SetFloat(state, num); } } public class TerrainOffset : MonoBehaviour { public AimIK aimIK; public Vector3 raycastOffset = new Vector3(0f, 2f, 1.5f); public LayerMask raycastLayers; public float min = -2f; public float max = 2f; public float lerpSpeed = 10f; private RaycastHit hit; private Vector3 offset; private void LateUpdate() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.rotation * raycastOffset; Vector3 groundHeightOffset = GetGroundHeightOffset(((Component)this).transform.position + val); offset = Vector3.Lerp(offset, groundHeightOffset, Time.deltaTime * lerpSpeed); Vector3 val2 = ((Component)this).transform.position + new Vector3(val.x, 0f, val.z); aimIK.solver.transform.LookAt(val2); ((IKSolver)aimIK.solver).IKPosition = val2 + offset; } private Vector3 GetGroundHeightOffset(Vector3 worldPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) Debug.DrawRay(worldPosition, Vector3.down * raycastOffset.y * 2f, Color.green); if (Physics.Raycast(worldPosition, Vector3.down, ref hit, raycastOffset.y * 2f)) { return Mathf.Clamp(((RaycastHit)(ref hit)).point.y - ((Component)this).transform.position.y, min, max) * Vector3.up; } return Vector3.zero; } } public class BipedIKvsAnimatorIK : MonoBehaviour { [LargeHeader("References")] public Animator animator; public BipedIK bipedIK; [LargeHeader("Look At")] public Transform lookAtTargetBiped; public Transform lookAtTargetAnimator; [Range(0f, 1f)] public float lookAtWeight = 1f; [Range(0f, 1f)] public float lookAtBodyWeight = 1f; [Range(0f, 1f)] public float lookAtHeadWeight = 1f; [Range(0f, 1f)] public float lookAtEyesWeight = 1f; [Range(0f, 1f)] public float lookAtClampWeight = 0.5f; [Range(0f, 1f)] public float lookAtClampWeightHead = 0.5f; [Range(0f, 1f)] public float lookAtClampWeightEyes = 0.5f; [LargeHeader("Foot")] public Transform footTargetBiped; public Transform footTargetAnimator; [Range(0f, 1f)] public float footPositionWeight = 0f; [Range(0f, 1f)] public float footRotationWeight = 0f; [LargeHeader("Hand")] public Transform handTargetBiped; public Transform handTargetAnimator; [Range(0f, 1f)] public float handPositionWeight = 0f; [Range(0f, 1f)] public float handRotationWeight = 0f; private void OnAnimatorIK(int layer) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) ((Component)animator).transform.rotation = ((Component)bipedIK).transform.rotation; Vector3 val = ((Component)animator).transform.position - ((Component)bipedIK).transform.position; lookAtTargetAnimator.position = lookAtTargetBiped.position + val; bipedIK.SetLookAtPosition(lookAtTargetBiped.position); bipedIK.SetLookAtWeight(lookAtWeight, lookAtBodyWeight, lookAtHeadWeight, lookAtEyesWeight, lookAtClampWeight, lookAtClampWeightHead, lookAtClampWeightEyes); animator.SetLookAtPosition(lookAtTargetAnimator.position); animator.SetLookAtWeight(lookAtWeight, lookAtBodyWeight, lookAtHeadWeight, lookAtEyesWeight, lookAtClampWeight); footTargetAnimator.position = footTargetBiped.position + val; footTargetAnimator.rotation = footTargetBiped.rotation; bipedIK.SetIKPosition((AvatarIKGoal)0, footTargetBiped.position); bipedIK.SetIKRotation((AvatarIKGoal)0, footTargetBiped.rotation); bipedIK.SetIKPositionWeight((AvatarIKGoal)0, footPositionWeight); bipedIK.SetIKRotationWeight((AvatarIKGoal)0, footRotationWeight); animator.SetIKPosition((AvatarIKGoal)0, footTargetAnimator.position); animator.SetIKRotation((AvatarIKGoal)0, footTargetAnimator.rotation); animator.SetIKPositionWeight((AvatarIKGoal)0, footPositionWeight); animator.SetIKRotationWeight((AvatarIKGoal)0, footRotationWeight); handTargetAnimator.position = handTargetBiped.position + val; handTargetAnimator.rotation = handTargetBiped.rotation; bipedIK.SetIKPosition((AvatarIKGoal)2, handTargetBiped.position); bipedIK.SetIKRotation((AvatarIKGoal)2, handTargetBiped.rotation); bipedIK.SetIKPositionWeight((AvatarIKGoal)2, handPositionWeight); bipedIK.SetIKRotationWeight((AvatarIKGoal)2, handRotationWeight); animator.SetIKPosition((AvatarIKGoal)2, handTargetAnimator.position); animator.SetIKRotation((AvatarIKGoal)2, handTargetAnimator.rotation); animator.SetIKPositionWeight((AvatarIKGoal)2, handPositionWeight); animator.SetIKRotationWeight((AvatarIKGoal)2, handRotationWeight); } } public class MechSpider : MonoBehaviour { public LayerMask raycastLayers; public float scale = 1f; public Transform body; public MechSpiderLeg[] legs; public float legRotationWeight = 1f; public float rootPositionSpeed = 5f; public float rootRotationSpeed = 30f; public float breatheSpeed = 2f; public float breatheMagnitude = 0.2f; public float height = 3.5f; public float minHeight = 2f; public float raycastHeight = 10f; public float raycastDistance = 5f; private Vector3 lastPosition; private Vector3 defaultBodyLocalPosition; private float sine; private RaycastHit rootHit; public Vector3 velocity { get; private set; } private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) lastPosition = ((Component)this).transform.position; } private void Update() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) velocity = (((Component)this).transform.position - lastPosition) / Time.deltaTime; lastPosition = ((Component)this).transform.position; Vector3 legsPlaneNormal = GetLegsPlaneNormal(); Quaternion val = Quaternion.FromToRotation(((Component)this).transform.up, legsPlaneNormal); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val * ((Component)this).transform.rotation, Time.deltaTime * rootRotationSpeed); Vector3 legCentroid = GetLegCentroid(); Vector3 val2 = Vector3.Project(legCentroid + ((Component)this).transform.up * height * scale - ((Component)this).transform.position, ((Component)this).transform.up); Transform transform = ((Component)this).transform; transform.position += val2 * Time.deltaTime * (rootPositionSpeed * scale); if (Physics.Raycast(((Component)this).transform.position + ((Component)this).transform.up * raycastHeight * scale, -((Component)this).transform.up, ref rootHit, raycastHeight * scale + raycastDistance * scale, LayerMask.op_Implicit(raycastLayers))) { ref RaycastHit reference = ref rootHit; ((RaycastHit)(ref reference)).distance = ((RaycastHit)(ref reference)).distance - (raycastHeight * scale + minHeight * scale); if (((RaycastHit)(ref rootHit)).distance < 0f) { Vector3 val3 = ((Component)this).transform.position - ((Component)this).transform.up * ((RaycastHit)(ref rootHit)).distance; ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, val3, Time.deltaTime * rootPositionSpeed * scale); } } sine += Time.deltaTime * breatheSpeed; if (sine >= (float)Math.PI * 2f) { sine -= (float)Math.PI * 2f; } float num = Mathf.Sin(sine) * breatheMagnitude * scale; Vector3 val4 = ((Component)this).transform.up * num; ((Component)body).transform.position = ((Component)this).transform.position + val4; } private Vector3 GetLegCentroid() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; float num = 1f / (float)legs.Length; for (int i = 0; i < legs.Length; i++) { val += legs[i].position * num; } return val; } private Vector3 GetLegsPlaneNormal() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.up; if (legRotationWeight <= 0f) { return val; } float num = 1f / Mathf.Lerp((float)legs.Length, 1f, legRotationWeight); for (int i = 0; i < legs.Length; i++) { Vector3 val2 = legs[i].position - (((Component)this).transform.position - ((Component)this).transform.up * height * scale); Vector3 up = ((Component)this).transform.up; Vector3 val3 = val2; Vector3.OrthoNormalize(ref up, ref val3); Quaternion val4 = Quaternion.FromToRotation(val3, val2); val4 = Quaternion.Lerp(Quaternion.identity, val4, num); val = val4 * val; } return val; } } public class MechSpiderController : MonoBehaviour { public MechSpider mechSpider; public Transform cameraTransform; public float speed = 6f; public float turnSpeed = 30f; public Vector3 inputVector => new Vector3(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical")); private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) Vector3 forward = cameraTransform.forward; Vector3 up = ((Component)this).transform.up; Vector3.OrthoNormalize(ref up, ref forward); Quaternion val = Quaternion.LookRotation(forward, ((Component)this).transform.up); Transform transform = ((Component)this).transform; Vector3 val2 = inputVector; transform.Translate(val * ((Vector3)(ref val2)).normalized * Time.deltaTime * speed * mechSpider.scale, (Space)0); ((Component)this).transform.rotation = Quaternion.RotateTowards(((Component)this).transform.rotation, val, Time.deltaTime * turnSpeed); } } public class MechSpiderLeg : MonoBehaviour { public MechSpider mechSpider; public MechSpiderLeg unSync; public Vector3 offset; public float minDelay = 0.2f; public float maxOffset = 1f; public float stepSpeed = 5f; public float footHeight = 0.15f; public float velocityPrediction = 0.2f; public float raycastFocus = 0.1f; public AnimationCurve yOffset; public Transform foot; public Vector3 footUpAxis; public float footRotationSpeed = 10f; public ParticleSystem sand; private IK ik; private float stepProgress = 1f; private float lastStepTime; private Vector3 defaultPosition; private RaycastHit hit = default(RaycastHit); private Quaternion lastFootLocalRotation; private Vector3 smoothHitNormal = Vector3.up; private Vector3 lastStepPosition; public bool isStepping => stepProgress < 1f; public Vector3 position { get { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) return ik.GetIKSolver().GetIKPosition(); } set { //IL_000c: Unknown result type (might be due to invalid IL or missing references) ik.GetIKSolver().SetIKPosition(value); } } private void Awake() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) ik = ((Component)this).GetComponent(); if ((Object)(object)foot != (Object)null) { if (footUpAxis == Vector3.zero) { footUpAxis = Quaternion.Inverse(foot.rotation) * Vector3.up; } lastFootLocalRotation = foot.localRotation; IKSolver iKSolver = ik.GetIKSolver(); iKSolver.OnPostUpdate = (UpdateDelegate)Delegate.Combine((Delegate?)(object)iKSolver.OnPostUpdate, (Delegate?)new UpdateDelegate(AfterIK)); } } private void AfterIK() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)foot == (Object)null)) { foot.localRotation = lastFootLocalRotation; smoothHitNormal = Vector3.Slerp(smoothHitNormal, ((RaycastHit)(ref hit)).normal, Time.deltaTime * footRotationSpeed); Quaternion val = Quaternion.FromToRotation(foot.rotation * footUpAxis, smoothHitNormal); foot.rotation = val * foot.rotation; } } private void Start() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) stepProgress = 1f; hit = default(RaycastHit); position = ik.GetIKSolver().GetPoints()[^1].transform.position; lastStepPosition = position; ((RaycastHit)(ref hit)).point = position; defaultPosition = ((Component)mechSpider).transform.InverseTransformPoint(position + offset * mechSpider.scale); ((MonoBehaviour)this).StartCoroutine(Step(position, position)); } private Vector3 GetStepTarget(out bool stepFound, float focus, float distance) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) stepFound = false; Vector3 val = ((Component)mechSpider).transform.TransformPoint(defaultPosition); val += mechSpider.velocity * velocityPrediction; Vector3 up = ((Component)mechSpider).transform.up; Vector3 val2 = mechSpider.body.position - position; Vector3 val3 = Vector3.Cross(up, val2); up = Quaternion.AngleAxis(focus, val3) * up; if (Physics.Raycast(val + up * mechSpider.raycastHeight * mechSpider.scale, -up, ref hit, mechSpider.raycastHeight * mechSpider.scale + distance, LayerMask.op_Implicit(mechSpider.raycastLayers))) { stepFound = true; } return ((RaycastHit)(ref hit)).point + ((RaycastHit)(ref hit)).normal * footHeight * mechSpider.scale; } private void UpdatePosition(float distance) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) Vector3 up = ((Component)mechSpider).transform.up; if (Physics.Raycast(lastStepPosition + up * mechSpider.raycastHeight * mechSpider.scale, -up, ref hit, mechSpider.raycastHeight * mechSpider.scale + distance, LayerMask.op_Implicit(mechSpider.raycastLayers))) { position = ((RaycastHit)(ref hit)).point + ((RaycastHit)(ref hit)).normal * footHeight * mechSpider.scale; } } private void Update() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) UpdatePosition(mechSpider.raycastDistance * mechSpider.scale); if (!isStepping && !(Time.time < lastStepTime + minDelay) && (!((Object)(object)unSync != (Object)null) || !unSync.isStepping)) { bool stepFound = false; Vector3 stepTarget = GetStepTarget(out stepFound, raycastFocus, mechSpider.raycastDistance * mechSpider.scale); if (!stepFound) { stepTarget = GetStepTarget(out stepFound, 0f - raycastFocus, mechSpider.raycastDistance * 3f * mechSpider.scale); } if (stepFound && !(Vector3.Distance(position, stepTarget) < maxOffset * mechSpider.scale * Random.Range(0.9f, 1.2f))) { ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(Step(position, stepTarget)); } } } private IEnumerator Step(Vector3 stepStartPosition, Vector3 targetPosition) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) stepProgress = 0f; while (stepProgress < 1f) { stepProgress += Time.deltaTime * stepSpeed; position = Vector3.Lerp(stepStartPosition, targetPosition, stepProgress); MechSpiderLeg mechSpiderLeg = this; mechSpiderLeg.position += ((Component)mechSpider).transform.up * yOffset.Evaluate(stepProgress) * mechSpider.scale; lastStepPosition = position; yield return null; } position = targetPosition; lastStepPosition = position; if ((Object)(object)sand != (Object)null) { ((Component)sand).transform.position = position - ((Component)mechSpider).transform.up * footHeight * mechSpider.scale; sand.Emit(20); } lastStepTime = Time.time; } } public class MechSpiderParticles : MonoBehaviour { public MechSpiderController mechSpiderController; private ParticleSystem particles; private void Start() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown particles = (ParticleSystem)((Component)this).GetComponent(typeof(ParticleSystem)); } private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) Vector3 inputVector = mechSpiderController.inputVector; float magnitude = ((Vector3)(ref inputVector)).magnitude; float num = Mathf.Clamp(magnitude * 50f, 30f, 50f); EmissionModule emission = particles.emission; ((EmissionModule)(ref emission)).rateOverTime = new MinMaxCurve(num); MainModule main = particles.main; MainModule main2 = particles.main; MinMaxGradient startColor = ((MainModule)(ref main2)).startColor; float r = ((MinMaxGradient)(ref startColor)).color.r; MainModule main3 = particles.main; MinMaxGradient startColor2 = ((MainModule)(ref main3)).startColor; float g = ((MinMaxGradient)(ref startColor2)).color.g; MainModule main4 = particles.main; MinMaxGradient startColor3 = ((MainModule)(ref main4)).startColor; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(r, g, ((MinMaxGradient)(ref startColor3)).color.b, Mathf.Clamp(magnitude, 0.4f, 1f))); } } } namespace RootMotion1.Demos { public class AnimationWarping : OffsetModifier { [Serializable] public struct Warp { [Tooltip("Layer of the 'Animation State' in the Animator.")] public int animationLayer; [Tooltip("Name of the state in the Animator to warp.")] public string animationState; [Tooltip("Warping weight by normalized time of the animation state.")] public AnimationCurve weightCurve; [Tooltip("Animated point to warp from. This should be in character space so keep this Transform parented to the root of the character.")] public Transform warpFrom; [Tooltip("World space point to warp to.")] public Transform warpTo; [Tooltip("Which FBBIK effector to use?")] public FullBodyBipedEffector effector; } [Serializable] public enum EffectorMode { PositionOffset, Position } [Tooltip("Reference to the Animator component to use")] public Animator animator; [Tooltip("Using effector.positionOffset or effector.position with effector.positionWeight? The former will enable you to use effector.position for other things, the latter will weigh in the effectors, hence using Reach and Pull in the process.")] public EffectorMode effectorMode; [Space(10f)] [Tooltip("The array of warps, can have multiple simultaneous warps.")] public Warp[] warps; private EffectorMode lastMode; protected override void Start() { base.Start(); lastMode = effectorMode; } public float GetWarpWeight(int warpIndex) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (warpIndex < 0) { Debug.LogError((object)"Warp index out of range."); return 0f; } if (warpIndex >= warps.Length) { Debug.LogError((object)"Warp index out of range."); return 0f; } if ((Object)(object)animator == (Object)null) { Debug.LogError((object)"Animator unassigned in AnimationWarping"); return 0f; } AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(warps[warpIndex].animationLayer); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName(warps[warpIndex].animationState)) { return 0f; } return warps[warpIndex].weightCurve.Evaluate(((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime - (float)(int)((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime); } protected override void OnModifyOffset() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < warps.Length; i++) { float warpWeight = GetWarpWeight(i); Vector3 val = warps[i].warpTo.position - warps[i].warpFrom.position; switch (effectorMode) { case EffectorMode.PositionOffset: { IKEffector effector = ik.solver.GetEffector(warps[i].effector); effector.positionOffset += val * warpWeight * weight; break; } case EffectorMode.Position: ik.solver.GetEffector(warps[i].effector).position = ik.solver.GetEffector(warps[i].effector).bone.position + val; ik.solver.GetEffector(warps[i].effector).positionWeight = weight * warpWeight; break; } } if (lastMode == EffectorMode.Position && effectorMode == EffectorMode.PositionOffset) { Warp[] array = warps; for (int j = 0; j < array.Length; j++) { Warp warp = array[j]; ik.solver.GetEffector(warp.effector).positionWeight = 0f; } } lastMode = effectorMode; } private void OnDisable() { if (effectorMode == EffectorMode.Position) { Warp[] array = warps; for (int i = 0; i < array.Length; i++) { Warp warp = array[i]; ik.solver.GetEffector(warp.effector).positionWeight = 0f; } } } } } namespace RootMotion.Demos { public class AnimatorController3rdPerson : MonoBehaviour { public float rotateSpeed = 7f; public float blendSpeed = 10f; public float maxAngle = 90f; public float moveSpeed = 1.5f; public float rootMotionWeight; protected Animator animator; protected Vector3 moveBlend; protected Vector3 moveInput; protected Vector3 velocity; protected virtual void Start() { animator = ((Component)this).GetComponent(); } private void OnAnimatorMove() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) velocity = Vector3.Lerp(velocity, ((Component)this).transform.rotation * Vector3.ClampMagnitude(moveInput, 1f) * moveSpeed, Time.deltaTime * blendSpeed); Transform transform = ((Component)this).transform; transform.position += Vector3.Lerp(velocity * Time.deltaTime, animator.deltaPosition, rootMotionWeight); } public virtual void Move(Vector3 moveInput, bool isMoving, Vector3 faceDirection, Vector3 aimTarget) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) this.moveInput = moveInput; Vector3 val = ((Component)this).transform.InverseTransformDirection(faceDirection); float num = Mathf.Atan2(val.x, val.z) * 57.29578f; float num2 = num * Time.deltaTime * rotateSpeed; if (num > maxAngle) { num2 = Mathf.Clamp(num2, num - maxAngle, num2); } if (num < 0f - maxAngle) { num2 = Mathf.Clamp(num2, num2, num + maxAngle); } ((Component)this).transform.Rotate(Vector3.up, num2); moveBlend = Vector3.Lerp(moveBlend, moveInput, Time.deltaTime * blendSpeed); animator.SetFloat("X", moveBlend.x); animator.SetFloat("Z", moveBlend.z); animator.SetBool("IsMoving", isMoving); } } public class AnimatorController3rdPersonIK : AnimatorController3rdPerson { [Range(0f, 1f)] public float headLookWeight = 1f; public Vector3 gunHoldOffset; public Vector3 leftHandOffset; public Recoil recoil; private AimIK aim; private FullBodyBipedIK ik; private Vector3 headLookAxis; private Vector3 leftHandPosRelToRightHand; private Quaternion leftHandRotRelToRightHand; private Vector3 aimTarget; private Quaternion rightHandRotation; protected override void Start() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) base.Start(); aim = ((Component)this).GetComponent(); ik = ((Component)this).GetComponent(); IKSolverFullBodyBiped solver = ik.solver; ((IKSolverFullBody)solver).OnPreRead = (UpdateDelegate)Delegate.Combine((Delegate?)(object)((IKSolverFullBody)solver).OnPreRead, (Delegate?)new UpdateDelegate(OnPreRead)); ((Behaviour)aim).enabled = false; ((Behaviour)ik).enabled = false; headLookAxis = ik.references.head.InverseTransformVector(ik.references.root.forward); animator.SetLayerWeight(1, 1f); } public override void Move(Vector3 moveInput, bool isMoving, Vector3 faceDirection, Vector3 aimTarget) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) base.Move(moveInput, isMoving, faceDirection, aimTarget); this.aimTarget = aimTarget; Read(); AimIK(); FBBIK(); AimIK(); HeadLookAt(aimTarget); } private void Read() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) leftHandPosRelToRightHand = ik.references.rightHand.InverseTransformPoint(ik.references.leftHand.position); leftHandRotRelToRightHand = Quaternion.Inverse(ik.references.rightHand.rotation) * ik.references.leftHand.rotation; } private void AimIK() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) ((IKSolver)aim.solver).IKPosition = aimTarget; ((IKSolver)aim.solver).Update(); } private void FBBIK() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) rightHandRotation = ik.references.rightHand.rotation; Vector3 val = ik.references.rightHand.rotation * gunHoldOffset; IKEffector rightHandEffector = ik.solver.rightHandEffector; rightHandEffector.positionOffset += val; if ((Object)(object)recoil != (Object)null) { recoil.SetHandRotations(rightHandRotation * leftHandRotRelToRightHand, rightHandRotation); } ((IKSolver)ik.solver).Update(); if ((Object)(object)recoil != (Object)null) { ik.references.rightHand.rotation = recoil.rotationOffset * rightHandRotation; ik.references.leftHand.rotation = recoil.rotationOffset * rightHandRotation * leftHandRotRelToRightHand; } else { ik.references.rightHand.rotation = rightHandRotation; ik.references.leftHand.rotation = rightHandRotation * leftHandRotRelToRightHand; } } private void OnPreRead() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) Quaternion val = ((!((Object)(object)recoil != (Object)null)) ? rightHandRotation : (recoil.rotationOffset * rightHandRotation)); Vector3 val2 = ik.references.rightHand.position + ik.solver.rightHandEffector.positionOffset + val * leftHandPosRelToRightHand; IKEffector leftHandEffector = ik.solver.leftHandEffector; leftHandEffector.positionOffset += val2 - ik.references.leftHand.position - ik.solver.leftHandEffector.positionOffset + val * leftHandOffset; } private void HeadLookAt(Vector3 lookAtTarget) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(ik.references.head.rotation * headLookAxis, lookAtTarget - ik.references.head.position); ik.references.head.rotation = Quaternion.Lerp(Quaternion.identity, val, headLookWeight) * ik.references.head.rotation; } private void OnDestroy() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; ((IKSolverFullBody)solver).OnPreRead = (UpdateDelegate)Delegate.Remove((Delegate?)(object)((IKSolverFullBody)solver).OnPreRead, (Delegate?)new UpdateDelegate(OnPreRead)); } } } public class CharacterAnimationThirdPersonIK : CharacterAnimationThirdPerson { private FullBodyBipedIK ik; protected override void Start() { base.Start(); ik = ((Component)this).GetComponent(); } protected override void LateUpdate() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) base.LateUpdate(); if (!(Vector3.Angle(((Component)this).transform.up, Vector3.up) <= 0.01f)) { Quaternion rotation = Quaternion.FromToRotation(((Component)this).transform.up, Vector3.up); RotateEffector(ik.solver.bodyEffector, rotation, 0.1f); RotateEffector(ik.solver.leftShoulderEffector, rotation, 0.2f); RotateEffector(ik.solver.rightShoulderEffector, rotation, 0.2f); RotateEffector(ik.solver.leftHandEffector, rotation, 0.1f); RotateEffector(ik.solver.rightHandEffector, rotation, 0.1f); } } private void RotateEffector(IKEffector effector, Quaternion rotation, float mlp) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) Vector3 val = effector.bone.position - ((Component)this).transform.position; Vector3 val2 = rotation * val; Vector3 val3 = val2 - val; effector.positionOffset += val3 * mlp; } } public class CharacterController3rdPerson : MonoBehaviour { public CameraController cam; private AnimatorController3rdPerson animatorController; private static Vector3 inputVector => new Vector3(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical")); private static Vector3 inputVectorRaw => new Vector3(Input.GetAxisRaw("Horizontal"), 0f, Input.GetAxisRaw("Vertical")); private void Start() { animatorController = ((Component)this).GetComponent(); ((Behaviour)cam).enabled = false; } private void LateUpdate() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) cam.UpdateInput(); cam.UpdateTransform(); Vector3 moveInput = inputVector; bool isMoving = inputVector != Vector3.zero || inputVectorRaw != Vector3.zero; Vector3 forward = ((Component)cam).transform.forward; Vector3 aimTarget = ((Component)cam).transform.position + forward * 10f; animatorController.Move(moveInput, isMoving, forward, aimTarget); } } } namespace RootMotion1.Demos { public class EffectorOffset : OffsetModifier { [Range(0f, 1f)] public float handsMaintainRelativePositionWeight; public Vector3 bodyOffset; public Vector3 leftShoulderOffset; public Vector3 rightShoulderOffset; public Vector3 leftThighOffset; public Vector3 rightThighOffset; public Vector3 leftHandOffset; public Vector3 rightHandOffset; public Vector3 leftFootOffset; public Vector3 rightFootOffset; protected override void OnModifyOffset() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) ik.solver.leftHandEffector.maintainRelativePositionWeight = handsMaintainRelativePositionWeight; ik.solver.rightHandEffector.maintainRelativePositionWeight = handsMaintainRelativePositionWeight; IKEffector bodyEffector = ik.solver.bodyEffector; bodyEffector.positionOffset += ((Component)this).transform.rotation * bodyOffset * weight; IKEffector leftShoulderEffector = ik.solver.leftShoulderEffector; leftShoulderEffector.positionOffset += ((Component)this).transform.rotation * leftShoulderOffset * weight; IKEffector rightShoulderEffector = ik.solver.rightShoulderEffector; rightShoulderEffector.positionOffset += ((Component)this).transform.rotation * rightShoulderOffset * weight; IKEffector leftThighEffector = ik.solver.leftThighEffector; leftThighEffector.positionOffset += ((Component)this).transform.rotation * leftThighOffset * weight; IKEffector rightThighEffector = ik.solver.rightThighEffector; rightThighEffector.positionOffset += ((Component)this).transform.rotation * rightThighOffset * weight; IKEffector leftHandEffector = ik.solver.leftHandEffector; leftHandEffector.positionOffset += ((Component)this).transform.rotation * leftHandOffset * weight; IKEffector rightHandEffector = ik.solver.rightHandEffector; rightHandEffector.positionOffset += ((Component)this).transform.rotation * rightHandOffset * weight; IKEffector leftFootEffector = ik.solver.leftFootEffector; leftFootEffector.positionOffset += ((Component)this).transform.rotation * leftFootOffset * weight; IKEffector rightFootEffector = ik.solver.rightFootEffector; rightFootEffector.positionOffset += ((Component)this).transform.rotation * rightFootOffset * weight; } } } namespace RootMotion.Demos { public class ExplosionDemo : MonoBehaviour { public SimpleLocomotion character; public float forceMlp = 1f; public float upForce = 1f; public float weightFalloffSpeed = 1f; public AnimationCurve weightFalloff; public AnimationCurve explosionForceByDistance; public AnimationCurve scale; private float weight = 0f; private Vector3 defaultScale = Vector3.one; private Rigidbody r; private FullBodyBipedIK ik; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) defaultScale = ((Component)this).transform.localScale; r = ((Component)character).GetComponent(); ik = ((Component)character).GetComponent(); } private void Update() { //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) weight = Mathf.Clamp(weight - Time.deltaTime * weightFalloffSpeed, 0f, 1f); if (Input.GetKeyDown((KeyCode)101) && character.isGrounded) { ((IKSolver)ik.solver).IKPositionWeight = 1f; ik.solver.leftHandEffector.position = ik.solver.leftHandEffector.bone.position; ik.solver.rightHandEffector.position = ik.solver.rightHandEffector.bone.position; ik.solver.leftFootEffector.position = ik.solver.leftFootEffector.bone.position; ik.solver.rightFootEffector.position = ik.solver.rightFootEffector.bone.position; weight = 1f; Vector3 val = r.position - ((Component)this).transform.position; val.y = 0f; float num = explosionForceByDistance.Evaluate(((Vector3)(ref val)).magnitude); r.velocity = (((Vector3)(ref val)).normalized + Vector3.up * upForce) * num * forceMlp; } if (weight < 0.5f && character.isGrounded) { weight = Mathf.Clamp(weight - Time.deltaTime * 3f, 0f, 1f); } SetEffectorWeights(weightFalloff.Evaluate(weight)); ((Component)this).transform.localScale = scale.Evaluate(weight) * defaultScale; } private void SetEffectorWeights(float w) { ik.solver.leftHandEffector.positionWeight = w; ik.solver.rightHandEffector.positionWeight = w; ik.solver.leftFootEffector.positionWeight = w; ik.solver.rightFootEffector.positionWeight = w; } } public class FBBIKSettings : MonoBehaviour { [Serializable] public class Limb { public Smoothing reachSmoothing; public float maintainRelativePositionWeight; public float mappingWeight = 1f; public void Apply(FullBodyBipedChain chain, IKSolverFullBodyBiped solver) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) solver.GetChain(chain).reachSmoothing = reachSmoothing; solver.GetEndEffector(chain).maintainRelativePositionWeight = maintainRelativePositionWeight; solver.GetLimbMapping(chain).weight = mappingWeight; } } public FullBodyBipedIK ik; public bool disableAfterStart; public Limb leftArm; public Limb rightArm; public Limb leftLeg; public Limb rightLeg; public float rootPin = 0f; public bool bodyEffectChildNodes = true; public void UpdateSettings() { if (!((Object)(object)ik == (Object)null)) { leftArm.Apply((FullBodyBipedChain)0, ik.solver); rightArm.Apply((FullBodyBipedChain)1, ik.solver); leftLeg.Apply((FullBodyBipedChain)2, ik.solver); rightLeg.Apply((FullBodyBipedChain)3, ik.solver); ((IKSolverFullBody)ik.solver).chain[0].pin = rootPin; ik.solver.bodyEffector.effectChildNodes = bodyEffectChildNodes; } } private void Start() { Debug.Log((object)"FBBIKSettings is deprecated, you can now edit all the settings from the custom inspector of the FullBodyBipedIK component."); UpdateSettings(); if (disableAfterStart) { ((Behaviour)this).enabled = false; } } private void Update() { UpdateSettings(); } } public class FBIKBendGoal : MonoBehaviour { public FullBodyBipedIK ik; public FullBodyBipedChain chain; public float weight; private void Start() { Debug.Log((object)"FBIKBendGoal is deprecated, you can now a bend goal from the custom inspector of the FullBodyBipedIK component."); } private void Update() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ik == (Object)null)) { ik.solver.GetBendConstraint(chain).bendGoal = ((Component)this).transform; ik.solver.GetBendConstraint(chain).weight = weight; } } } public class FBIKBoxing : MonoBehaviour { [Tooltip("The target we want to hit")] public Transform target; [Tooltip("The pin Transform is used to reference the exact hit point in the animation (used by AimIK to aim the upper body to follow the target).In Legacy and Generic modes you can just create and position a reference point in your animating software and include it in the FBX. Then in Unity if you added a GameObject with the exact same name under the character's root, it would be animated to the required position.In Humanoid mode however, Mecanim loses track of any Transform that does not belong to the avatar, so in this case the pin point has to be manually set inside the Unity Editor.")] public Transform pin; [Tooltip("The Full Body Biped IK component")] public FullBodyBipedIK ik; [Tooltip("The Aim IK component. Aim IK is ust used for following the target slightly with the body.")] public AimIK aim; [Tooltip("The master weight")] public float weight; [Tooltip("The effector type of the punching hand")] public FullBodyBipedEffector effector; [Tooltip("Weight of aiming the body to follow the target")] public AnimationCurve aimWeight; private Animator animator; private void Start() { animator = ((Component)this).GetComponent(); } private void LateUpdate() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) float num = animator.GetFloat("HitWeight"); ik.solver.GetEffector(effector).position = target.position; ik.solver.GetEffector(effector).positionWeight = num * weight; if ((Object)(object)aim != (Object)null) { aim.solver.transform.LookAt(pin.position); ((IKSolver)aim.solver).IKPosition = target.position; ((IKSolver)aim.solver).IKPositionWeight = aimWeight.Evaluate(num) * weight; } } } public class FBIKHandsOnProp : MonoBehaviour { public FullBodyBipedIK ik; public bool leftHanded; private void Awake() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown IKSolverFullBodyBiped solver = ik.solver; ((IKSolverFullBody)solver).OnPreRead = (UpdateDelegate)Delegate.Combine((Delegate?)(object)((IKSolverFullBody)solver).OnPreRead, (Delegate?)new UpdateDelegate(OnPreRead)); } private void OnPreRead() { if (leftHanded) { HandsOnProp(ik.solver.leftHandEffector, ik.solver.rightHandEffector); } else { HandsOnProp(ik.solver.rightHandEffector, ik.solver.leftHandEffector); } } private void HandsOnProp(IKEffector mainHand, IKEffector otherHand) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) Vector3 val = otherHand.bone.position - mainHand.bone.position; Vector3 val2 = Quaternion.Inverse(mainHand.bone.rotation) * val; Vector3 val3 = mainHand.bone.position + val * 0.5f; Quaternion val4 = Quaternion.Inverse(mainHand.bone.rotation) * otherHand.bone.rotation; Vector3 val5 = otherHand.bone.position + otherHand.positionOffset - (mainHand.bone.position + mainHand.positionOffset); Vector3 val6 = mainHand.bone.position + mainHand.positionOffset + val * 0.5f; mainHand.position = mainHand.bone.position + mainHand.positionOffset + (val6 - val3); mainHand.positionWeight = 1f; Quaternion val7 = Quaternion.FromToRotation(val, val5); mainHand.bone.rotation = val7 * mainHand.bone.rotation; otherHand.position = mainHand.position + mainHand.bone.rotation * val2; otherHand.positionWeight = 1f; otherHand.bone.rotation = mainHand.bone.rotation * val4; ik.solver.leftArmMapping.maintainRotationWeight = 1f; ik.solver.rightArmMapping.maintainRotationWeight = 1f; } private void OnDestroy() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; ((IKSolverFullBody)solver).OnPreRead = (UpdateDelegate)Delegate.Remove((Delegate?)(object)((IKSolverFullBody)solver).OnPreRead, (Delegate?)new UpdateDelegate(OnPreRead)); } } } public class FPSAiming : MonoBehaviour { [Range(0f, 1f)] public float aimWeight = 1f; [Range(0f, 1f)] public float sightWeight = 1f; [Range(0f, 180f)] public float maxAngle = 80f; public Vector3 aimOffset; public bool animatePhysics; public Transform gun; public Transform gunTarget; public FullBodyBipedIK ik; public AimIK gunAim; public AimIK headAim; public CameraControllerFPS cam; public Recoil recoil; [Range(0f, 1f)] public float cameraRecoilWeight = 0.5f; private Vector3 gunTargetDefaultLocalPosition; private Vector3 gunTargetDefaultLocalRotation; private Vector3 camDefaultLocalPosition; private Vector3 camRelativeToGunTarget; private bool updateFrame; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) gunTargetDefaultLocalPosition = gunTarget.localPosition; gunTargetDefaultLocalRotation = gunTarget.localEulerAngles; camDefaultLocalPosition = ((Component)cam).transform.localPosition; ((Behaviour)cam).enabled = false; ((Behaviour)gunAim).enabled = false; if ((Object)(object)headAim != (Object)null) { ((Behaviour)headAim).enabled = false; } ((Behaviour)ik).enabled = false; if ((Object)(object)recoil != (Object)null && ((IKSolverFullBody)ik.solver).iterations == 0) { Debug.LogWarning((object)"FPSAiming with Recoil needs FBBIK solver iteration count to be at least 1 to maintain accuracy."); } } private void FixedUpdate() { updateFrame = true; } private void LateUpdate() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!animatePhysics) { updateFrame = true; } if (updateFrame) { updateFrame = false; ((Component)cam).transform.localPosition = camDefaultLocalPosition; camRelativeToGunTarget = gunTarget.InverseTransformPoint(((Component)cam).transform.position); cam.LateUpdate(); RotateCharacter(); Aiming(); LookDownTheSight(); } } private void Aiming() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)headAim == (Object)null) || !(aimWeight <= 0f)) { Quaternion rotation = ((Component)cam).transform.rotation; ((IKSolver)headAim.solver).IKPosition = ((Component)cam).transform.position + ((Component)cam).transform.forward * 10f; ((IKSolver)headAim.solver).IKPositionWeight = 1f - aimWeight; ((IKSolver)headAim.solver).Update(); ((IKSolver)gunAim.solver).IKPosition = ((Component)cam).transform.position + ((Component)cam).transform.forward * 10f + ((Component)cam).transform.rotation * aimOffset; ((IKSolver)gunAim.solver).IKPositionWeight = aimWeight; ((IKSolver)gunAim.solver).Update(); ((Component)cam).transform.rotation = rotation; } } private void LookDownTheSight() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) float num = aimWeight * sightWeight; gunTarget.position = Vector3.Lerp(gun.position, gunTarget.parent.TransformPoint(gunTargetDefaultLocalPosition), num); gunTarget.rotation = Quaternion.Lerp(gun.rotation, gunTarget.parent.rotation * Quaternion.Euler(gunTargetDefaultLocalRotation), num); Vector3 val = gun.InverseTransformPoint(ik.solver.leftHandEffector.bone.position); Vector3 val2 = gun.InverseTransformPoint(ik.solver.rightHandEffector.bone.position); Quaternion val3 = Quaternion.Inverse(gun.rotation) * ik.solver.leftHandEffector.bone.rotation; Quaternion val4 = Quaternion.Inverse(gun.rotation) * ik.solver.rightHandEffector.bone.rotation; float num2 = 1f; IKEffector leftHandEffector = ik.solver.leftHandEffector; leftHandEffector.positionOffset += (gunTarget.TransformPoint(val) - (ik.solver.leftHandEffector.bone.position + ik.solver.leftHandEffector.positionOffset)) * num2; IKEffector rightHandEffector = ik.solver.rightHandEffector; rightHandEffector.positionOffset += (gunTarget.TransformPoint(val2) - (ik.solver.rightHandEffector.bone.position + ik.solver.rightHandEffector.positionOffset)) * num2; ik.solver.headMapping.maintainRotationWeight = 1f; if ((Object)(object)recoil != (Object)null) { recoil.SetHandRotations(gunTarget.rotation * val3, gunTarget.rotation * val4); } ((IKSolver)ik.solver).Update(); if ((Object)(object)recoil != (Object)null) { ik.references.leftHand.rotation = recoil.rotationOffset * (gunTarget.rotation * val3); ik.references.rightHand.rotation = recoil.rotationOffset * (gunTarget.rotation * val4); } else { ik.references.leftHand.rotation = gunTarget.rotation * val3; ik.references.rightHand.rotation = gunTarget.rotation * val4; } ((Component)cam).transform.position = Vector3.Lerp(((Component)cam).transform.position, Vector3.Lerp(gunTarget.TransformPoint(camRelativeToGunTarget), ((Component)gun).transform.TransformPoint(camRelativeToGunTarget), cameraRecoilWeight), num); } private void RotateCharacter() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) if (maxAngle >= 180f) { return; } if (maxAngle <= 0f) { ((Component)this).transform.rotation = Quaternion.LookRotation(new Vector3(((Component)cam).transform.forward.x, 0f, ((Component)cam).transform.forward.z)); return; } Vector3 val = ((Component)this).transform.InverseTransformDirection(((Component)cam).transform.forward); float num = Mathf.Atan2(val.x, val.z) * 57.29578f; if (Mathf.Abs(num) > Mathf.Abs(maxAngle)) { float num2 = num - maxAngle; if (num < 0f) { num2 = num + maxAngle; } ((Component)this).transform.rotation = Quaternion.AngleAxis(num2, ((Component)this).transform.up) * ((Component)this).transform.rotation; } } } public class FPSCharacter : MonoBehaviour { [Range(0f, 1f)] public float walkSpeed = 0.5f; private float sVel; private Animator animator; private FPSAiming FPSAiming; private void Start() { animator = ((Component)this).GetComponent(); FPSAiming = ((Component)this).GetComponent(); } private void Update() { FPSAiming.sightWeight = Mathf.SmoothDamp(FPSAiming.sightWeight, (!Input.GetMouseButton(1)) ? 0f : 1f, ref sVel, 0.1f); if (FPSAiming.sightWeight < 0.001f) { FPSAiming.sightWeight = 0f; } if (FPSAiming.sightWeight > 0.999f) { FPSAiming.sightWeight = 1f; } animator.SetFloat("Speed", walkSpeed); } private void OnGUI() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) GUI.Label(new Rect((float)(Screen.width - 210), 10f, 200f, 25f), "Hold RMB to aim down the sight"); } } public class HitReactionTrigger : MonoBehaviour { public HitReaction hitReaction; public float hitForce = 1f; private string colliderName; private void Update() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (Input.GetMouseButtonDown(0)) { Ray val = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 100f)) { hitReaction.Hit(((RaycastHit)(ref val2)).collider, ((Ray)(ref val)).direction * hitForce, ((RaycastHit)(ref val2)).point); colliderName = ((Object)((RaycastHit)(ref val2)).collider).name; } } } private void OnGUI() { GUILayout.Label("LMB to shoot the Dummy, RMB to rotate the camera.", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (colliderName != string.Empty) { GUILayout.Label("Last Bone Hit: " + colliderName, (GUILayoutOption[])(object)new GUILayoutOption[0]); } } } public class HoldingHands : MonoBehaviour { public FullBodyBipedIK rightHandChar; public FullBodyBipedIK leftHandChar; public Transform rightHandTarget; public Transform leftHandTarget; public float crossFade; public float speed = 10f; private Quaternion rightHandRotation; private Quaternion leftHandRotation; private void Start() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) rightHandRotation = Quaternion.Inverse(rightHandChar.solver.rightHandEffector.bone.rotation) * ((Component)this).transform.rotation; leftHandRotation = Quaternion.Inverse(leftHandChar.solver.leftHandEffector.bone.rotation) * ((Component)this).transform.rotation; } private void LateUpdate() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Lerp(rightHandChar.solver.rightHandEffector.bone.position, leftHandChar.solver.leftHandEffector.bone.position, crossFade); ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, val, Time.deltaTime * speed); ((Component)this).transform.rotation = Quaternion.Slerp(rightHandChar.solver.rightHandEffector.bone.rotation * rightHandRotation, leftHandChar.solver.leftHandEffector.bone.rotation * leftHandRotation, crossFade); rightHandChar.solver.rightHandEffector.position = rightHandTarget.position; rightHandChar.solver.rightHandEffector.rotation = rightHandTarget.rotation; leftHandChar.solver.leftHandEffector.position = leftHandTarget.position; leftHandChar.solver.leftHandEffector.rotation = leftHandTarget.rotation; } } public class InteractionC2CDemo : MonoBehaviour { public InteractionSystem character1; public InteractionSystem character2; public InteractionObject handShake; private void OnGUI() { if (GUILayout.Button("Shake Hands", (GUILayoutOption[])(object)new GUILayoutOption[0])) { character1.StartInteraction((FullBodyBipedEffector)6, handShake, true); character2.StartInteraction((FullBodyBipedEffector)6, handShake, true); } } private void LateUpdate() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) Vector3 position = Vector3.Lerp(character1.ik.solver.rightHandEffector.bone.position, character2.ik.solver.rightHandEffector.bone.position, 0.5f); ((Component)handShake).transform.position = position; } } public class InteractionDemo : MonoBehaviour { public InteractionSystem interactionSystem; public bool interrupt; public InteractionObject ball; public InteractionObject benchMain; public InteractionObject benchHands; public InteractionObject button; public InteractionObject cigarette; public InteractionObject door; private bool isSitting; private void OnGUI() { interrupt = GUILayout.Toggle(interrupt, "Interrupt", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (isSitting) { if (!interactionSystem.inInteraction && GUILayout.Button("Stand Up", (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.ResumeAll(); isSitting = false; } return; } if (GUILayout.Button("Pick Up Ball", (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.StartInteraction((FullBodyBipedEffector)6, ball, interrupt); } if (GUILayout.Button("Button Left Hand", (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.StartInteraction((FullBodyBipedEffector)5, button, interrupt); } if (GUILayout.Button("Button Right Hand", (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.StartInteraction((FullBodyBipedEffector)6, button, interrupt); } if (GUILayout.Button("Put Out Cigarette", (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.StartInteraction((FullBodyBipedEffector)8, cigarette, interrupt); } if (GUILayout.Button("Open Door", (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.StartInteraction((FullBodyBipedEffector)5, door, interrupt); } if (!interactionSystem.inInteraction && GUILayout.Button("Sit Down", (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.StartInteraction((FullBodyBipedEffector)0, benchMain, interrupt); interactionSystem.StartInteraction((FullBodyBipedEffector)3, benchMain, interrupt); interactionSystem.StartInteraction((FullBodyBipedEffector)4, benchMain, interrupt); interactionSystem.StartInteraction((FullBodyBipedEffector)7, benchMain, interrupt); interactionSystem.StartInteraction((FullBodyBipedEffector)5, benchHands, interrupt); interactionSystem.StartInteraction((FullBodyBipedEffector)6, benchHands, interrupt); isSitting = true; } } } public class InteractionSystemTestGUI : MonoBehaviour { [Tooltip("The object to interact to")] public InteractionObject interactionObject; [Tooltip("The effectors to interact with")] public FullBodyBipedEffector[] effectors; private InteractionSystem interactionSystem; private void Awake() { interactionSystem = ((Component)this).GetComponent(); } private void OnGUI() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)interactionSystem == (Object)null) { return; } if (GUILayout.Button("Start Interaction With " + ((Object)interactionObject).name, (GUILayoutOption[])(object)new GUILayoutOption[0])) { if (effectors.Length == 0) { Debug.Log((object)"Please select the effectors to interact with."); } FullBodyBipedEffector[] array = effectors; foreach (FullBodyBipedEffector val in array) { interactionSystem.StartInteraction(val, interactionObject, true); } } if (effectors.Length != 0 && interactionSystem.IsPaused(effectors[0]) && GUILayout.Button("Resume Interaction With " + ((Object)interactionObject).name, (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.ResumeAll(); } } } public class KissingRig : MonoBehaviour { [Serializable] public class Partner { public FullBodyBipedIK ik; public Transform mouth; public Transform mouthTarget; public Transform touchTargetLeftHand; public Transform touchTargetRightHand; public float bodyWeightHorizontal = 0.4f; public float bodyWeightVertical = 1f; public float neckRotationWeight = 0.3f; public float headTiltAngle = 10f; public Vector3 headTiltAxis; private Quaternion neckRotation; private Transform neck => ((IKSolverFullBody)ik.solver).spineMapping.spineBones[((IKSolverFullBody)ik.solver).spineMapping.spineBones.Length - 1]; public void Initiate() { ((Behaviour)ik).enabled = false; } public void Update(float weight) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) ik.solver.leftShoulderEffector.positionWeight = weight; ik.solver.rightShoulderEffector.positionWeight = weight; ik.solver.leftHandEffector.positionWeight = weight; ik.solver.rightHandEffector.positionWeight = weight; ik.solver.leftHandEffector.rotationWeight = weight; ik.solver.rightHandEffector.rotationWeight = weight; ik.solver.bodyEffector.positionWeight = weight; InverseTransformEffector((FullBodyBipedEffector)1, mouth, mouthTarget.position, weight); InverseTransformEffector((FullBodyBipedEffector)2, mouth, mouthTarget.position, weight); InverseTransformEffector((FullBodyBipedEffector)0, mouth, mouthTarget.position, weight); ik.solver.bodyEffector.position = Vector3.Lerp(new Vector3(ik.solver.bodyEffector.position.x, ik.solver.bodyEffector.bone.position.y, ik.solver.bodyEffector.position.z), ik.solver.bodyEffector.position, bodyWeightVertical * weight); ik.solver.bodyEffector.position = Vector3.Lerp(new Vector3(ik.solver.bodyEffector.bone.position.x, ik.solver.bodyEffector.position.y, ik.solver.bodyEffector.bone.position.z), ik.solver.bodyEffector.position, bodyWeightHorizontal * weight); ik.solver.leftHandEffector.position = touchTargetLeftHand.position; ik.solver.rightHandEffector.position = touchTargetRightHand.position; ik.solver.leftHandEffector.rotation = touchTargetLeftHand.rotation; ik.solver.rightHandEffector.rotation = touchTargetRightHand.rotation; neckRotation = neck.rotation; ((IKSolver)ik.solver).Update(); neck.rotation = Quaternion.Slerp(neck.rotation, neckRotation, neckRotationWeight * weight); ik.references.head.localRotation = Quaternion.AngleAxis(headTiltAngle * weight, headTiltAxis) * ik.references.head.localRotation; } private void InverseTransformEffector(FullBodyBipedEffector effector, Transform target, Vector3 targetPosition, float weight) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ik.solver.GetEffector(effector).bone.position - target.position; ik.solver.GetEffector(effector).position = Vector3.Lerp(ik.solver.GetEffector(effector).bone.position, targetPosition + val, weight); } } public Partner partner1; public Partner partner2; public float weight; public int iterations = 3; private void Start() { partner1.Initiate(); partner2.Initiate(); } private void LateUpdate() { for (int i = 0; i < iterations; i++) { partner1.Update(weight); partner2.Update(weight); } } } } namespace RootMotion1.Demos { public class MotionAbsorb : OffsetModifier { [Serializable] public enum Mode { Position, PositionOffset } [Serializable] public class Absorber { [Tooltip("The type of effector (hand, foot, shoulder...) - this is just an enum")] public FullBodyBipedEffector effector; [Tooltip("How much should motion be absorbed on this effector")] public float weight = 1f; private Vector3 position; private Quaternion rotation = Quaternion.identity; private IKEffector e; public void SetToBone(IKSolverFullBodyBiped solver, Mode mode) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) e = solver.GetEffector(effector); switch (mode) { case Mode.Position: e.position = e.bone.position; e.rotation = e.bone.rotation; break; case Mode.PositionOffset: position = e.bone.position; rotation = e.bone.rotation; break; } } public void UpdateEffectorWeights(float w) { e.positionWeight = w * weight; e.rotationWeight = w * weight; } public void SetPosition(float w) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) IKEffector iKEffector = e; iKEffector.positionOffset += (position - e.bone.position) * w * weight; } public void SetRotation(float w) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) e.bone.rotation = Quaternion.Slerp(e.bone.rotation, rotation, w * weight); } } [Tooltip("Use either effector position, position weight, rotation, rotationWeight or positionOffset and rotating the bone directly.")] public Mode mode; [Tooltip("Array containing the absorbers")] public Absorber[] absorbers; [Tooltip("Weight falloff curve (how fast will the effect reduce after impact)")] public AnimationCurve falloff; [Tooltip("How fast will the impact fade away. (if 1, effect lasts for 1 second)")] public float falloffSpeed = 1f; private float timer; private float w; private Mode initialMode; protected override void Start() { base.Start(); IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (RootMotion1.FinalIK.IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPostUpdate, new RootMotion1.FinalIK.IKSolver.UpdateDelegate(AfterIK)); initialMode = mode; } private void OnCollisionEnter(Collision c) { if (!(timer > 0f)) { timer = 1f; for (int i = 0; i < absorbers.Length; i++) { absorbers[i].SetToBone(ik.solver, mode); } } } protected override void OnModifyOffset() { if (timer <= 0f) { return; } mode = initialMode; timer -= Time.deltaTime * falloffSpeed; w = falloff.Evaluate(timer); if (mode == Mode.Position) { for (int i = 0; i < absorbers.Length; i++) { absorbers[i].UpdateEffectorWeights(w * weight); } } else { for (int j = 0; j < absorbers.Length; j++) { absorbers[j].SetPosition(w * weight); } } } private void AfterIK() { if (!(timer <= 0f) && mode != Mode.Position) { for (int i = 0; i < absorbers.Length; i++) { absorbers[i].SetRotation(w * weight); } } } protected override void OnDestroy() { base.OnDestroy(); if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (RootMotion1.FinalIK.IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPostUpdate, new RootMotion1.FinalIK.IKSolver.UpdateDelegate(AfterIK)); } } } } namespace RootMotion.Demos { public class MotionAbsorbCharacter : MonoBehaviour { public Animator animator; public MotionAbsorb motionAbsorb; public Transform cube; public float cubeRandomPosition = 0.1f; public AnimationCurve motionAbsorbWeight; private Vector3 cubeDefaultPosition; private AnimatorStateInfo info; private Rigidbody cubeRigidbody; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) cubeDefaultPosition = cube.position; cubeRigidbody = ((Component)cube).GetComponent(); } private void Update() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) info = animator.GetCurrentAnimatorStateInfo(0); ((OffsetModifier)motionAbsorb).weight = motionAbsorbWeight.Evaluate(((AnimatorStateInfo)(ref info)).normalizedTime - (float)(int)((AnimatorStateInfo)(ref info)).normalizedTime); } private void SwingStart() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) cubeRigidbody.MovePosition(cubeDefaultPosition + Random.insideUnitSphere * cubeRandomPosition); cubeRigidbody.MoveRotation(Quaternion.identity); cubeRigidbody.velocity = Vector3.zero; cubeRigidbody.angularVelocity = Vector3.zero; } } } namespace RootMotion1.Demos { public class OffsetEffector : OffsetModifier { [Serializable] public class EffectorLink { public FullBodyBipedEffector effectorType; public float weightMultiplier = 1f; [HideInInspector] public Vector3 localPosition; } public EffectorLink[] effectorLinks; protected override void Start() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) base.Start(); EffectorLink[] array = effectorLinks; foreach (EffectorLink effectorLink in array) { effectorLink.localPosition = ((Component)this).transform.InverseTransformPoint(ik.solver.GetEffector(effectorLink.effectorType).bone.position); if (effectorLink.effectorType == FullBodyBipedEffector.Body) { ik.solver.bodyEffector.effectChildNodes = false; } } } protected override void OnModifyOffset() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) EffectorLink[] array = effectorLinks; foreach (EffectorLink effectorLink in array) { Vector3 val = ((Component)this).transform.TransformPoint(effectorLink.localPosition); IKEffector effector = ik.solver.GetEffector(effectorLink.effectorType); effector.positionOffset += (val - (ik.solver.GetEffector(effectorLink.effectorType).bone.position + ik.solver.GetEffector(effectorLink.effectorType).positionOffset)) * weight * effectorLink.weightMultiplier; } } } } namespace RootMotion.Demos { public class PendulumExample : MonoBehaviour { [Tooltip("The master weight of this script.")] [Range(0f, 1f)] public float weight = 1f; [Tooltip("Multiplier for the distance of the root to the target.")] public float hangingDistanceMlp = 1.3f; [Tooltip("Where does the root of the character land when weight is blended out?")] [HideInInspector] public Vector3 rootTargetPosition; [Tooltip("How is the root of the character rotated when weight is blended out?")] [HideInInspector] public Quaternion rootTargetRotation; public Transform target; public Transform leftHandTarget; public Transform rightHandTarget; public Transform leftFootTarget; public Transform rightFootTarget; public Transform pelvisTarget; public Transform bodyTarget; public Transform headTarget; public Vector3 pelvisDownAxis = Vector3.right; private FullBodyBipedIK ik; private Quaternion rootRelativeToPelvis; private Vector3 pelvisToRoot; private float lastWeight; private void Start() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) ik = ((Component)this).GetComponent(); Quaternion rotation = target.rotation; target.rotation = leftHandTarget.rotation; FixedJoint val = ((Component)target).gameObject.AddComponent(); ((Joint)val).connectedBody = ((Component)leftHandTarget).GetComponent(); ((Component)target).GetComponent().MoveRotation(rotation); rootRelativeToPelvis = Quaternion.Inverse(pelvisTarget.rotation) * ((Component)this).transform.rotation; pelvisToRoot = Quaternion.Inverse(ik.references.pelvis.rotation) * (((Component)this).transform.position - ik.references.pelvis.position); rootTargetPosition = ((Component)this).transform.position; rootTargetRotation = ((Component)this).transform.rotation; lastWeight = weight; } private void LateUpdate() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) if (weight > 0f) { ik.solver.leftHandEffector.positionWeight = weight; ik.solver.leftHandEffector.rotationWeight = weight; } else { rootTargetPosition = ((Component)this).transform.position; rootTargetRotation = ((Component)this).transform.rotation; if (lastWeight > 0f) { ik.solver.leftHandEffector.positionWeight = 0f; ik.solver.leftHandEffector.rotationWeight = 0f; } } lastWeight = weight; if (!(weight <= 0f)) { ((Component)this).transform.position = Vector3.Lerp(rootTargetPosition, pelvisTarget.position + pelvisTarget.rotation * pelvisToRoot * hangingDistanceMlp, weight); ((Component)this).transform.rotation = Quaternion.Lerp(rootTargetRotation, pelvisTarget.rotation * rootRelativeToPelvis, weight); ik.solver.leftHandEffector.position = leftHandTarget.position; ik.solver.leftHandEffector.rotation = leftHandTarget.rotation; Vector3 val = ik.references.pelvis.rotation * pelvisDownAxis; Quaternion val2 = Quaternion.FromToRotation(val, rightHandTarget.position - headTarget.position); ik.references.rightUpperArm.rotation = Quaternion.Lerp(Quaternion.identity, val2, weight) * ik.references.rightUpperArm.rotation; Quaternion val3 = Quaternion.FromToRotation(val, leftFootTarget.position - bodyTarget.position); ik.references.leftThigh.rotation = Quaternion.Lerp(Quaternion.identity, val3, weight) * ik.references.leftThigh.rotation; Quaternion val4 = Quaternion.FromToRotation(val, rightFootTarget.position - bodyTarget.position); ik.references.rightThigh.rotation = Quaternion.Lerp(Quaternion.identity, val4, weight) * ik.references.rightThigh.rotation; } } } public abstract class PickUp2Handed : MonoBehaviour { public int GUIspace; public InteractionSystem interactionSystem; public InteractionObject obj; public Transform pivot; public Transform holdPoint; public float pickUpTime = 0.3f; private float holdWeight; private float holdWeightVel; private Vector3 pickUpPosition; private Quaternion pickUpRotation; private bool holding => holdingLeft || holdingRight; private bool holdingLeft => interactionSystem.IsPaused((FullBodyBipedEffector)5) && (Object)(object)interactionSystem.GetInteractionObject((FullBodyBipedEffector)5) == (Object)(object)obj; private bool holdingRight => interactionSystem.IsPaused((FullBodyBipedEffector)6) && (Object)(object)interactionSystem.GetInteractionObject((FullBodyBipedEffector)6) == (Object)(object)obj; private void OnGUI() { GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.Space((float)GUIspace); if (!holding) { if (GUILayout.Button("Pick Up " + ((Object)obj).name, (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.StartInteraction((FullBodyBipedEffector)5, obj, false); interactionSystem.StartInteraction((FullBodyBipedEffector)6, obj, false); } } else { GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[0]); if (holdingRight && GUILayout.Button("Release Right", (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.ResumeInteraction((FullBodyBipedEffector)6); } if (holdingLeft && GUILayout.Button("Release Left", (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.ResumeInteraction((FullBodyBipedEffector)5); } if (GUILayout.Button("Drop " + ((Object)obj).name, (GUILayoutOption[])(object)new GUILayoutOption[0])) { interactionSystem.ResumeAll(); } GUILayout.EndVertical(); } GUILayout.EndHorizontal(); } protected abstract void RotatePivot(); private void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown InteractionSystem obj = interactionSystem; obj.OnInteractionStart = (InteractionDelegate)Delegate.Combine((Delegate?)(object)obj.OnInteractionStart, (Delegate?)new InteractionDelegate(OnStart)); InteractionSystem obj2 = interactionSystem; obj2.OnInteractionPause = (InteractionDelegate)Delegate.Combine((Delegate?)(object)obj2.OnInteractionPause, (Delegate?)new InteractionDelegate(OnPause)); InteractionSystem obj3 = interactionSystem; obj3.OnInteractionResume = (InteractionDelegate)Delegate.Combine((Delegate?)(object)obj3.OnInteractionResume, (Delegate?)new InteractionDelegate(OnDrop)); } private void OnPause(FullBodyBipedEffector effectorType, InteractionObject interactionObject) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((int)effectorType == 5 && !((Object)(object)interactionObject != (Object)(object)obj)) { ((Component)obj).transform.parent = ((Component)interactionSystem).transform; Rigidbody component = ((Component)obj).GetComponent(); if ((Object)(object)component != (Object)null) { component.isKinematic = true; } pickUpPosition = ((Component)obj).transform.position; pickUpRotation = ((Component)obj).transform.rotation; holdWeight = 0f; holdWeightVel = 0f; } } private void OnStart(FullBodyBipedEffector effectorType, InteractionObject interactionObject) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_003a: Unknown result type (might be due to invalid IL or missing references) if ((int)effectorType == 5 && !((Object)(object)interactionObject != (Object)(object)obj)) { RotatePivot(); holdPoint.rotation = ((Component)obj).transform.rotation; } } private void OnDrop(FullBodyBipedEffector effectorType, InteractionObject interactionObject) { if (!holding && !((Object)(object)interactionObject != (Object)(object)obj)) { ((Component)obj).transform.parent = null; if ((Object)(object)((Component)obj).GetComponent() != (Object)null) { ((Component)obj).GetComponent().isKinematic = false; } } } private void LateUpdate() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) if (holding) { holdWeight = Mathf.SmoothDamp(holdWeight, 1f, ref holdWeightVel, pickUpTime); ((Component)obj).transform.position = Vector3.Lerp(pickUpPosition, holdPoint.position, holdWeight); ((Component)obj).transform.rotation = Quaternion.Lerp(pickUpRotation, holdPoint.rotation, holdWeight); } } private void OnDestroy() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown if (!((Object)(object)interactionSystem == (Object)null)) { InteractionSystem obj = interactionSystem; obj.OnInteractionStart = (InteractionDelegate)Delegate.Remove((Delegate?)(object)obj.OnInteractionStart, (Delegate?)new InteractionDelegate(OnStart)); InteractionSystem obj2 = interactionSystem; obj2.OnInteractionPause = (InteractionDelegate)Delegate.Remove((Delegate?)(object)obj2.OnInteractionPause, (Delegate?)new InteractionDelegate(OnPause)); InteractionSystem obj3 = interactionSystem; obj3.OnInteractionResume = (InteractionDelegate)Delegate.Remove((Delegate?)(object)obj3.OnInteractionResume, (Delegate?)new InteractionDelegate(OnDrop)); } } } public class PickUpBox : PickUp2Handed { protected override void RotatePivot() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pivot.position - ((Component)interactionSystem).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; normalized.y = 0f; Vector3 val2 = ((Component)obj).transform.InverseTransformDirection(normalized); Vector3 axis = QuaTools.GetAxis(val2); Vector3 axis2 = QuaTools.GetAxis(((Component)obj).transform.InverseTransformDirection(((Component)interactionSystem).transform.up)); pivot.localRotation = Quaternion.LookRotation(axis, axis2); } } public class PickUpSphere : PickUp2Handed { protected override void RotatePivot() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Lerp(interactionSystem.ik.solver.leftHandEffector.bone.position, interactionSystem.ik.solver.rightHandEffector.bone.position, 0.5f); Vector3 val2 = ((Component)obj).transform.position - val; pivot.rotation = Quaternion.LookRotation(val2); } } public class RagdollUtilityDemo : MonoBehaviour { public RagdollUtility ragdollUtility; public Transform root; public Rigidbody pelvis; private void OnGUI() { GUILayout.Label(" Press R to switch to ragdoll. \n Weigh in one of the FBBIK effectors to make kinematic changes to the ragdoll pose.\n A to blend back to animation", (GUILayoutOption[])(object)new GUILayoutOption[0]); } private void Update() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown((KeyCode)114)) { ragdollUtility.EnableRagdoll(); } if (Input.GetKeyDown((KeyCode)97)) { Vector3 val = pelvis.position - root.position; Transform obj = root; obj.position += val; Transform transform = ((Component)pelvis).transform; transform.position -= val; ragdollUtility.DisableRagdoll(); } } } public class RecoilTest : MonoBehaviour { public float magnitude = 1f; private Recoil recoil; private void Start() { recoil = ((Component)this).GetComponent(); } private void Update() { if (Input.GetKeyDown((KeyCode)114) || Input.GetMouseButtonDown(0)) { recoil.Fire(magnitude); } } private void OnGUI() { GUILayout.Label("Press R or LMB for procedural recoil.", (GUILayoutOption[])(object)new GUILayoutOption[0]); } } public class ResetInteractionObject : MonoBehaviour { public float resetDelay = 1f; private Vector3 defaultPosition; private Quaternion defaultRotation; private Transform defaultParent; private Rigidbody r; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) defaultPosition = ((Component)this).transform.position; defaultRotation = ((Component)this).transform.rotation; defaultParent = ((Component)this).transform.parent; r = ((Component)this).GetComponent(); } private void OnPickUp(Transform t) { ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(ResetObject(Time.time + resetDelay)); } private IEnumerator ResetObject(float resetTime) { while (Time.time < resetTime) { yield return null; } Poser poser = ((Component)((Component)this).transform.parent).GetComponent(); if ((Object)(object)poser != (Object)null) { poser.poseRoot = null; poser.weight = 0f; } ((Component)this).transform.parent = defaultParent; ((Component)this).transform.position = defaultPosition; ((Component)this).transform.rotation = defaultRotation; if ((Object)(object)r != (Object)null) { r.isKinematic = false; } } } public class SoccerDemo : MonoBehaviour { private Animator animator; private Vector3 defaultPosition; private Quaternion defaultRotation; private void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) animator = ((Component)this).GetComponent(); defaultPosition = ((Component)this).transform.position; defaultRotation = ((Component)this).transform.rotation; ((MonoBehaviour)this).StartCoroutine(ResetDelayed()); } private IEnumerator ResetDelayed() { while (true) { yield return (object)new WaitForSeconds(3f); ((Component)this).transform.position = defaultPosition; ((Component)this).transform.rotation = defaultRotation; animator.CrossFade("SoccerKick", 0f, 0, 0f); yield return null; } } } public class TouchWalls : MonoBehaviour { [Serializable] public class EffectorLink { public bool enabled = true; public FullBodyBipedEffector effectorType; public InteractionObject interactionObject; public Transform spherecastFrom; public float spherecastRadius = 0.1f; public float minDistance = 0.3f; public float distanceMlp = 1f; public LayerMask touchLayers; public float lerpSpeed = 10f; public float minSwitchTime = 0.2f; public float releaseDistance = 0.4f; public bool sliding; private Vector3 raycastDirectionLocal; private float raycastDistance; private bool inTouch; private RaycastHit hit = default(RaycastHit); private Vector3 targetPosition; private Quaternion targetRotation; private bool initiated; private float nextSwitchTime; private float speedF; public void Initiate(InteractionSystem interactionSystem) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) raycastDirectionLocal = spherecastFrom.InverseTransformDirection(((Component)interactionObject).transform.position - spherecastFrom.position); raycastDistance = Vector3.Distance(spherecastFrom.position, ((Component)interactionObject).transform.position); interactionSystem.OnInteractionStart = (InteractionDelegate)Delegate.Combine((Delegate?)(object)interactionSystem.OnInteractionStart, (Delegate?)new InteractionDelegate(OnInteractionStart)); interactionSystem.OnInteractionResume = (InteractionDelegate)Delegate.Combine((Delegate?)(object)interactionSystem.OnInteractionResume, (Delegate?)new InteractionDelegate(OnInteractionResume)); interactionSystem.OnInteractionStop = (InteractionDelegate)Delegate.Combine((Delegate?)(object)interactionSystem.OnInteractionStop, (Delegate?)new InteractionDelegate(OnInteractionStop)); ((RaycastHit)(ref hit)).normal = Vector3.forward; targetPosition = ((Component)interactionObject).transform.position; targetRotation = ((Component)interactionObject).transform.rotation; initiated = true; } private bool FindWalls(Vector3 direction) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!enabled) { return false; } bool result = Physics.SphereCast(spherecastFrom.position, spherecastRadius, direction, ref hit, raycastDistance * distanceMlp, LayerMask.op_Implicit(touchLayers)); if (((RaycastHit)(ref hit)).distance < minDistance) { result = false; } return result; } public void Update(InteractionSystem interactionSystem) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } Vector3 val = spherecastFrom.TransformDirection(raycastDirectionLocal); ((RaycastHit)(ref hit)).point = spherecastFrom.position + val; bool flag = FindWalls(val); if (!inTouch) { if (flag && Time.time > nextSwitchTime) { ((Component)interactionObject).transform.parent = null; interactionSystem.StartInteraction(effectorType, interactionObject, true); nextSwitchTime = Time.time + minSwitchTime / interactionSystem.speed; targetPosition = ((RaycastHit)(ref hit)).point; targetRotation = Quaternion.LookRotation(-((RaycastHit)(ref hit)).normal); ((Component)interactionObject).transform.position = targetPosition; ((Component)interactionObject).transform.rotation = targetRotation; } } else { if (!flag) { StopTouch(interactionSystem); } else if (!interactionSystem.IsPaused(effectorType) || sliding) { targetPosition = ((RaycastHit)(ref hit)).point; targetRotation = Quaternion.LookRotation(-((RaycastHit)(ref hit)).normal); } if (Vector3.Distance(((Component)interactionObject).transform.position, ((RaycastHit)(ref hit)).point) > releaseDistance) { if (flag) { targetPosition = ((RaycastHit)(ref hit)).point; targetRotation = Quaternion.LookRotation(-((RaycastHit)(ref hit)).normal); } else { StopTouch(interactionSystem); } } } float num = ((inTouch && (!interactionSystem.IsPaused(effectorType) || !(((Component)interactionObject).transform.position == targetPosition))) ? 1f : 0f); speedF = Mathf.Lerp(speedF, num, Time.deltaTime * 3f * interactionSystem.speed); float num2 = Time.deltaTime * lerpSpeed * speedF * interactionSystem.speed; ((Component)interactionObject).transform.position = Vector3.Lerp(((Component)interactionObject).transform.position, targetPosition, num2); ((Component)interactionObject).transform.rotation = Quaternion.Slerp(((Component)interactionObject).transform.rotation, targetRotation, num2); } private void StopTouch(InteractionSystem interactionSystem) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) ((Component)interactionObject).transform.parent = ((Component)interactionSystem).transform; nextSwitchTime = Time.time + minSwitchTime / interactionSystem.speed; if (interactionSystem.IsPaused(effectorType)) { interactionSystem.ResumeInteraction(effectorType); return; } speedF = 0f; targetPosition = ((RaycastHit)(ref hit)).point; targetRotation = Quaternion.LookRotation(-((RaycastHit)(ref hit)).normal); } private void OnInteractionStart(FullBodyBipedEffector effectorType, InteractionObject interactionObject) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) if (effectorType == this.effectorType && !((Object)(object)interactionObject != (Object)(object)this.interactionObject)) { inTouch = true; } } private void OnInteractionResume(FullBodyBipedEffector effectorType, InteractionObject interactionObject) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) if (effectorType == this.effectorType && !((Object)(object)interactionObject != (Object)(object)this.interactionObject)) { inTouch = false; } } private void OnInteractionStop(FullBodyBipedEffector effectorType, InteractionObject interactionObject) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) if (effectorType == this.effectorType && !((Object)(object)interactionObject != (Object)(object)this.interactionObject)) { inTouch = false; } } public void Destroy(InteractionSystem interactionSystem) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown if (initiated) { interactionSystem.OnInteractionStart = (InteractionDelegate)Delegate.Remove((Delegate?)(object)interactionSystem.OnInteractionStart, (Delegate?)new InteractionDelegate(OnInteractionStart)); interactionSystem.OnInteractionResume = (InteractionDelegate)Delegate.Remove((Delegate?)(object)interactionSystem.OnInteractionResume, (Delegate?)new InteractionDelegate(OnInteractionResume)); interactionSystem.OnInteractionStop = (InteractionDelegate)Delegate.Remove((Delegate?)(object)interactionSystem.OnInteractionStop, (Delegate?)new InteractionDelegate(OnInteractionStop)); } } } public InteractionSystem interactionSystem; public EffectorLink[] effectorLinks; private void Start() { EffectorLink[] array = effectorLinks; foreach (EffectorLink effectorLink in array) { effectorLink.Initiate(interactionSystem); } } private void FixedUpdate() { for (int i = 0; i < effectorLinks.Length; i++) { effectorLinks[i].Update(interactionSystem); } } private void OnDestroy() { if ((Object)(object)interactionSystem != (Object)null) { for (int i = 0; i < effectorLinks.Length; i++) { effectorLinks[i].Destroy(interactionSystem); } } } } public class TransferMotion : MonoBehaviour { [Tooltip("The Transform to transfer motion to.")] public Transform to; [Tooltip("The amount of motion to transfer.")] [Range(0f, 1f)] public float transferMotion = 0.9f; private Vector3 lastPosition; private void OnEnable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) lastPosition = ((Component)this).transform.position; } private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.position - lastPosition; Transform obj = to; obj.position += val * transferMotion; lastPosition = ((Component)this).transform.position; } } public class TwoHandedProp : MonoBehaviour { [Tooltip("The left hand target parented to the right hand.")] public Transform leftHandTarget; private FullBodyBipedIK ik; private Vector3 targetPosRelativeToRight; private Quaternion targetRotRelativeToRight; private void Start() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown ik = ((Component)this).GetComponent(); IKSolverFullBodyBiped solver = ik.solver; ((IKSolver)solver).OnPostUpdate = (UpdateDelegate)Delegate.Combine((Delegate?)(object)((IKSolver)solver).OnPostUpdate, (Delegate?)new UpdateDelegate(AfterFBBIK)); ik.solver.leftHandEffector.positionWeight = 1f; ik.solver.rightHandEffector.positionWeight = 1f; if ((Object)(object)ik.solver.rightHandEffector.target == (Object)null) { Debug.LogError((object)"Right Hand Effector needs a Target in this demo."); } } private void LateUpdate() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) targetPosRelativeToRight = ik.references.rightHand.InverseTransformPoint(leftHandTarget.position); targetRotRelativeToRight = Quaternion.Inverse(ik.references.rightHand.rotation) * leftHandTarget.rotation; ik.solver.leftHandEffector.position = ik.solver.rightHandEffector.target.position + ik.solver.rightHandEffector.target.rotation * targetPosRelativeToRight; ik.solver.leftHandEffector.rotation = ik.solver.rightHandEffector.target.rotation * targetRotRelativeToRight; } private void AfterFBBIK() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) ik.solver.leftHandEffector.bone.rotation = ik.solver.leftHandEffector.rotation; ik.solver.rightHandEffector.bone.rotation = ik.solver.rightHandEffector.rotation; } private void OnDestroy() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; ((IKSolver)solver).OnPostUpdate = (UpdateDelegate)Delegate.Remove((Delegate?)(object)((IKSolver)solver).OnPostUpdate, (Delegate?)new UpdateDelegate(AfterFBBIK)); } } } public class UserControlInteractions : UserControlThirdPerson { public CharacterThirdPerson character; public InteractionSystem interactionSystem; public bool disableInputInInteraction = true; public float enableInputAtProgress = 0.8f; protected override void Update() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (disableInputInInteraction && (Object)(object)interactionSystem != (Object)null && (interactionSystem.inInteraction || interactionSystem.IsPaused())) { float minActiveProgress = interactionSystem.GetMinActiveProgress(); if (minActiveProgress > 0f && minActiveProgress < enableInputAtProgress) { state.move = Vector3.zero; state.jump = false; return; } } base.Update(); } private void OnGUI() { if (!character.onGround) { return; } if (interactionSystem.IsPaused() && interactionSystem.IsInSync()) { GUILayout.Label("Press E to resume interaction", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (Input.GetKey((KeyCode)101)) { interactionSystem.ResumeAll(); } return; } int closestTriggerIndex = interactionSystem.GetClosestTriggerIndex(); if (closestTriggerIndex != -1 && interactionSystem.TriggerEffectorsReady(closestTriggerIndex)) { GUILayout.Label("Press E to start interaction", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (Input.GetKey((KeyCode)101)) { interactionSystem.TriggerInteraction(closestTriggerIndex, false); } } } } public class GrounderDemo : MonoBehaviour { public GameObject[] characters; private void OnGUI() { if (GUILayout.Button("Biped", (GUILayoutOption[])(object)new GUILayoutOption[0])) { Activate(0); } if (GUILayout.Button("Quadruped", (GUILayoutOption[])(object)new GUILayoutOption[0])) { Activate(1); } if (GUILayout.Button("Mech", (GUILayoutOption[])(object)new GUILayoutOption[0])) { Activate(2); } if (GUILayout.Button("Bot", (GUILayoutOption[])(object)new GUILayoutOption[0])) { Activate(3); } } public void Activate(int index) { for (int i = 0; i < characters.Length; i++) { characters[i].SetActive(i == index); } } } public class PlatformRotator : MonoBehaviour { public float maxAngle = 70f; public float switchRotationTime = 0.5f; public float random = 0.5f; public float rotationSpeed = 50f; public Vector3 movePosition; public float moveSpeed = 5f; public int characterLayer; private Quaternion defaultRotation; private Quaternion targetRotation; private Vector3 targetPosition; private Vector3 velocity; private Rigidbody r; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) defaultRotation = ((Component)this).transform.rotation; targetPosition = ((Component)this).transform.position + movePosition; r = ((Component)this).GetComponent(); ((MonoBehaviour)this).StartCoroutine(SwitchRotation()); } private void FixedUpdate() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) r.MovePosition(Vector3.SmoothDamp(r.position, targetPosition, ref velocity, 1f, moveSpeed)); if (Vector3.Distance(((Component)this).GetComponent().position, targetPosition) < 0.1f) { movePosition = -movePosition; targetPosition += movePosition; } r.MoveRotation(Quaternion.RotateTowards(r.rotation, targetRotation, rotationSpeed * Time.deltaTime)); } private IEnumerator SwitchRotation() { while (true) { float angle = Random.Range(0f - maxAngle, maxAngle); Vector3 axis = Random.onUnitSphere; targetRotation = Quaternion.AngleAxis(angle, axis) * defaultRotation; yield return (object)new WaitForSeconds(switchRotationTime + Random.value * random); } } private void OnCollisionEnter(Collision collision) { if (collision.gameObject.layer == characterLayer) { CharacterThirdPerson component = collision.gameObject.GetComponent(); if (!((Object)(object)component == (Object)null) && component.smoothPhysics) { component.smoothPhysics = false; } } } private void OnCollisionExit(Collision collision) { if (collision.gameObject.layer == characterLayer) { CharacterThirdPerson component = collision.gameObject.GetComponent(); if (!((Object)(object)component == (Object)null)) { component.smoothPhysics = true; } } } } public class BendGoal : MonoBehaviour { public LimbIK limbIK; [Range(0f, 1f)] public float weight = 1f; private void Start() { Debug.Log((object)"BendGoal is deprecated, you can now a bend goal from the custom inspector of the LimbIK component."); } private void LateUpdate() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)limbIK == (Object)null)) { ((IKSolverTrigonometric)limbIK.solver).SetBendGoalPosition(((Component)this).transform.position, weight); } } } public class Turret : MonoBehaviour { [Serializable] public class Part { public Transform transform; private RotationLimit rotationLimit; public void AimAt(Transform target) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) transform.LookAt(target.position, transform.up); if ((Object)(object)rotationLimit == (Object)null) { rotationLimit = ((Component)transform).GetComponent(); rotationLimit.Disable(); } rotationLimit.Apply(); } } public Transform target; public Part[] parts; private void Update() { Part[] array = parts; foreach (Part part in array) { part.AimAt(target); } } } } namespace RootMotion1 { public class CameraController : MonoBehaviour { [Serializable] public enum UpdateMode { Update, FixedUpdate, LateUpdate, FixedLateUpdate } public Transform target; public Transform rotationSpace; public UpdateMode updateMode = UpdateMode.LateUpdate; public bool lockCursor = true; [Header("Position")] public bool smoothFollow; public Vector3 offset = new Vector3(0f, 1.5f, 0.5f); public float followSpeed = 10f; [Header("Rotation")] public float rotationSensitivity = 3.5f; public float yMinLimit = -20f; public float yMaxLimit = 80f; public bool rotateAlways = true; public bool rotateOnLeftButton; public bool rotateOnRightButton; public bool rotateOnMiddleButton; [Header("Distance")] public float distance = 10f; public float minDistance = 4f; public float maxDistance = 10f; public float zoomSpeed = 10f; public float zoomSensitivity = 1f; [Header("Blocking")] public LayerMask blockingLayers; public float blockingRadius = 1f; public float blockingSmoothTime = 0.1f; public float blockingOriginOffset; [Range(0f, 1f)] public float blockedOffset = 0.5f; private Vector3 targetDistance; private Vector3 position; private Quaternion rotation = Quaternion.identity; private Vector3 smoothPosition; private Camera cam; private bool fixedFrame; private float fixedDeltaTime; private Quaternion r = Quaternion.identity; private Vector3 lastUp; private float blockedDistance = 10f; private float blockedDistanceV; public float x { get; private set; } public float y { get; private set; } public float distanceTarget { get; private set; } private float zoomAdd { get { float axis = Input.GetAxis("Mouse ScrollWheel"); if (axis > 0f) { return 0f - zoomSensitivity; } if (axis < 0f) { return zoomSensitivity; } return 0f; } } public void SetAngles(Quaternion rotation) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles; x = eulerAngles.y; y = eulerAngles.x; } public void SetAngles(float yaw, float pitch) { x = yaw; y = pitch; } protected virtual void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) Vector3 eulerAngles = ((Component)this).transform.eulerAngles; x = eulerAngles.y; y = eulerAngles.x; distanceTarget = distance; smoothPosition = ((Component)this).transform.position; cam = ((Component)this).GetComponent(); lastUp = ((!((Object)(object)rotationSpace != (Object)null)) ? Vector3.up : rotationSpace.up); } protected virtual void Update() { if (updateMode == UpdateMode.Update) { UpdateTransform(); } } protected virtual void FixedUpdate() { fixedFrame = true; fixedDeltaTime += Time.deltaTime; if (updateMode == UpdateMode.FixedUpdate) { UpdateTransform(); } } protected virtual void LateUpdate() { UpdateInput(); if (updateMode == UpdateMode.LateUpdate) { UpdateTransform(); } if (updateMode == UpdateMode.FixedLateUpdate && fixedFrame) { UpdateTransform(fixedDeltaTime); fixedDeltaTime = 0f; fixedFrame = false; } } public void UpdateInput() { if (((Behaviour)cam).enabled) { Cursor.lockState = (CursorLockMode)(lockCursor ? 1 : 0); Cursor.visible = !lockCursor; if (rotateAlways || (rotateOnLeftButton && Input.GetMouseButton(0)) || (rotateOnRightButton && Input.GetMouseButton(1)) || (rotateOnMiddleButton && Input.GetMouseButton(2))) { x += Input.GetAxis("Mouse X") * rotationSensitivity; y = ClampAngle(y - Input.GetAxis("Mouse Y") * rotationSensitivity, yMinLimit, yMaxLimit); } distanceTarget = Mathf.Clamp(distanceTarget + zoomAdd, minDistance, maxDistance); } } public void UpdateTransform() { UpdateTransform(Time.deltaTime); } public void UpdateTransform(float deltaTime) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)cam).enabled) { return; } rotation = Quaternion.AngleAxis(x, Vector3.up) * Quaternion.AngleAxis(y, Vector3.right); if ((Object)(object)rotationSpace != (Object)null) { r = Quaternion.FromToRotation(lastUp, rotationSpace.up) * r; rotation = r * rotation; lastUp = rotationSpace.up; } if ((Object)(object)target != (Object)null) { distance += (distanceTarget - distance) * zoomSpeed * deltaTime; if (!smoothFollow) { smoothPosition = target.position; } else { smoothPosition = Vector3.Lerp(smoothPosition, target.position, deltaTime * followSpeed); } Vector3 val = smoothPosition + rotation * offset; Vector3 val2 = rotation * -Vector3.forward; if (LayerMask.op_Implicit(blockingLayers) != -1) { RaycastHit val3 = default(RaycastHit); if (Physics.SphereCast(val - val2 * blockingOriginOffset, blockingRadius, val2, ref val3, blockingOriginOffset + distanceTarget - blockingRadius, LayerMask.op_Implicit(blockingLayers))) { blockedDistance = Mathf.SmoothDamp(blockedDistance, ((RaycastHit)(ref val3)).distance + blockingRadius * (1f - blockedOffset) - blockingOriginOffset, ref blockedDistanceV, blockingSmoothTime); } else { blockedDistance = distanceTarget; } distance = Mathf.Min(distance, blockedDistance); } position = val + val2 * distance; ((Component)this).transform.position = position; } ((Component)this).transform.rotation = rotation; } private float ClampAngle(float angle, float min, float max) { if (angle < -360f) { angle += 360f; } if (angle > 360f) { angle -= 360f; } return Mathf.Clamp(angle, min, max); } } public class CameraControllerFPS : MonoBehaviour { public float rotationSensitivity = 3f; public float yMinLimit = -89f; public float yMaxLimit = 89f; private float x; private float y; private void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) Vector3 eulerAngles = ((Component)this).transform.eulerAngles; x = eulerAngles.y; y = eulerAngles.x; } public void LateUpdate() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) Cursor.lockState = (CursorLockMode)1; x += Input.GetAxis("Mouse X") * rotationSensitivity; y = ClampAngle(y - Input.GetAxis("Mouse Y") * rotationSensitivity, yMinLimit, yMaxLimit); ((Component)this).transform.rotation = Quaternion.AngleAxis(x, Vector3.up) * Quaternion.AngleAxis(y, Vector3.right); } private float ClampAngle(float angle, float min, float max) { if (angle < -360f) { angle += 360f; } if (angle > 360f) { angle -= 360f; } return Mathf.Clamp(angle, min, max); } } } namespace RootMotion.Demos { public abstract class CharacterAnimationBase : MonoBehaviour { public bool smoothFollow = true; public float smoothFollowSpeed = 20f; protected bool animatePhysics; private Vector3 lastPosition; private Vector3 localPosition; private Quaternion localRotation; private Quaternion lastRotation; public virtual bool animationGrounded => true; public virtual Vector3 GetPivotPoint() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return ((Component)this).transform.position; } public float GetAngleFromForward(Vector3 worldDirection) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.InverseTransformDirection(worldDirection); return Mathf.Atan2(val.x, val.z) * 57.29578f; } protected virtual void Start() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)((Component)this).transform.parent).GetComponent() == (Object)null) { Debug.LogWarning((object)"Animation controllers should be parented to character controllers!", (Object)(object)((Component)this).transform); } lastPosition = ((Component)this).transform.position; localPosition = ((Component)this).transform.localPosition; lastRotation = ((Component)this).transform.rotation; localRotation = ((Component)this).transform.localRotation; } protected virtual void LateUpdate() { if (!animatePhysics) { SmoothFollow(); } } protected virtual void FixedUpdate() { if (animatePhysics) { SmoothFollow(); } } private void SmoothFollow() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) if (smoothFollow) { ((Component)this).transform.position = Vector3.Lerp(lastPosition, ((Component)this).transform.parent.TransformPoint(localPosition), Time.deltaTime * smoothFollowSpeed); ((Component)this).transform.rotation = Quaternion.Lerp(lastRotation, ((Component)this).transform.parent.rotation * localRotation, Time.deltaTime * smoothFollowSpeed); } else { ((Component)this).transform.localPosition = localPosition; ((Component)this).transform.localRotation = localRotation; } lastPosition = ((Component)this).transform.position; lastRotation = ((Component)this).transform.rotation; } } public class CharacterAnimationSimple : CharacterAnimationBase { public CharacterThirdPerson characterController; public float pivotOffset; public AnimationCurve moveSpeed; private Animator animator; protected override void Start() { base.Start(); animator = ((Component)this).GetComponentInChildren(); } public override Vector3 GetPivotPoint() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (pivotOffset == 0f) { return ((Component)this).transform.position; } return ((Component)this).transform.position + ((Component)this).transform.forward * pivotOffset; } private void Update() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) float num = moveSpeed.Evaluate(characterController.animState.moveDirection.z); animator.SetFloat("Speed", num); characterController.Move(((Component)characterController).transform.forward * Time.deltaTime * num, Quaternion.identity); } } public class CharacterAnimationThirdPerson : CharacterAnimationBase { public CharacterThirdPerson characterController; [SerializeField] private float turnSensitivity = 0.2f; [SerializeField] private float turnSpeed = 5f; [SerializeField] private float runCycleLegOffset = 0.2f; [Range(0.1f, 3f)] [SerializeField] private float animSpeedMultiplier = 1f; protected Animator animator; private Vector3 lastForward; private const string groundedDirectional = "Grounded Directional"; private const string groundedStrafe = "Grounded Strafe"; private float deltaAngle; private float jumpLeg; private bool lastJump; public override bool animationGrounded { get { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); int result; if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Grounded Directional")) { AnimatorStateInfo currentAnimatorStateInfo2 = animator.GetCurrentAnimatorStateInfo(0); result = (((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).IsName("Grounded Strafe") ? 1 : 0); } else { result = 1; } return (byte)result != 0; } } protected override void Start() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) base.Start(); animator = ((Component)this).GetComponent(); lastForward = ((Component)this).transform.forward; } public override Vector3 GetPivotPoint() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return animator.pivotPosition; } protected virtual void Update() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (Time.deltaTime != 0f) { animatePhysics = (int)animator.updateMode == 1; if (characterController.animState.jump && !lastJump) { AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); float num = Mathf.Repeat(((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime + runCycleLegOffset, 1f); float num2 = (float)((num < 0.5f) ? 1 : (-1)) * characterController.animState.moveDirection.z; animator.SetFloat("JumpLeg", num2); } lastJump = characterController.animState.jump; float num3 = 0f - GetAngleFromForward(lastForward) - deltaAngle; deltaAngle = 0f; lastForward = ((Component)this).transform.forward; num3 *= turnSensitivity * 0.01f; num3 = Mathf.Clamp(num3 / Time.deltaTime, -1f, 1f); animator.SetFloat("Turn", Mathf.Lerp(animator.GetFloat("Turn"), num3, Time.deltaTime * turnSpeed)); animator.SetFloat("Forward", characterController.animState.moveDirection.z); animator.SetFloat("Right", characterController.animState.moveDirection.x); animator.SetBool("Crouch", characterController.animState.crouch); animator.SetBool("OnGround", characterController.animState.onGround); animator.SetBool("IsStrafing", characterController.animState.isStrafing); if (!characterController.animState.onGround) { animator.SetFloat("Jump", characterController.animState.yVelocity); } if (characterController.doubleJumpEnabled) { animator.SetBool("DoubleJump", characterController.animState.doubleJump); } characterController.animState.doubleJump = false; if (characterController.animState.onGround && characterController.animState.moveDirection.z > 0f) { animator.speed = animSpeedMultiplier; } else { animator.speed = 1f; } } } private void OnAnimatorMove() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) Vector3 val = animator.deltaRotation * Vector3.forward; deltaAngle += Mathf.Atan2(val.x, val.z) * 57.29578f; characterController.Move(animator.deltaPosition, animator.deltaRotation); } } public abstract class CharacterBase : MonoBehaviour { [Header("Base Parameters")] [Tooltip("If specified, will use the direction from the character to this Transform as the gravity vector instead of Physics.gravity. Physics.gravity.magnitude will be used as the magnitude of the gravity vector.")] public Transform gravityTarget; [Tooltip("Multiplies gravity applied to the character even if 'Individual Gravity' is unchecked.")] public float gravityMultiplier = 2f; public float airborneThreshold = 0.6f; public float slopeStartAngle = 50f; public float slopeEndAngle = 85f; public float spherecastRadius = 0.1f; public LayerMask groundLayers; private PhysicMaterial zeroFrictionMaterial; private PhysicMaterial highFrictionMaterial; protected Rigidbody r; protected const float half = 0.5f; protected float originalHeight; protected Vector3 originalCenter; protected CapsuleCollider capsule; public abstract void Move(Vector3 deltaPosition, Quaternion deltaRotation); protected Vector3 GetGravity() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)gravityTarget != (Object)null) { Vector3 val = gravityTarget.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 gravity = Physics.gravity; return normalized * ((Vector3)(ref gravity)).magnitude; } return Physics.gravity; } protected virtual void Start() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown ref CapsuleCollider reference = ref capsule; Collider component = ((Component)this).GetComponent(); reference = (CapsuleCollider)(object)((component is CapsuleCollider) ? component : null); r = ((Component)this).GetComponent(); originalHeight = capsule.height; originalCenter = capsule.center; zeroFrictionMaterial = new PhysicMaterial(); zeroFrictionMaterial.dynamicFriction = 0f; zeroFrictionMaterial.staticFriction = 0f; zeroFrictionMaterial.frictionCombine = (PhysicMaterialCombine)2; zeroFrictionMaterial.bounciness = 0f; zeroFrictionMaterial.bounceCombine = (PhysicMaterialCombine)2; highFrictionMaterial = new PhysicMaterial(); r.constraints = (RigidbodyConstraints)112; } protected virtual RaycastHit GetSpherecastHit() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) Vector3 up = ((Component)this).transform.up; Ray val = default(Ray); ((Ray)(ref val))..ctor(r.position + up * airborneThreshold, -up); RaycastHit result = default(RaycastHit); ((RaycastHit)(ref result)).point = ((Component)this).transform.position - ((Component)((Component)this).transform).transform.up * airborneThreshold; ((RaycastHit)(ref result)).normal = ((Component)this).transform.up; Physics.SphereCast(val, spherecastRadius, ref result, airborneThreshold * 2f, LayerMask.op_Implicit(groundLayers)); return result; } public float GetAngleFromForward(Vector3 worldDirection) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.InverseTransformDirection(worldDirection); return Mathf.Atan2(val.x, val.z) * 57.29578f; } protected void RigidbodyRotateAround(Vector3 point, Vector3 axis, float angle) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.AngleAxis(angle, axis); Vector3 val2 = ((Component)this).transform.position - point; r.MovePosition(point + val * val2); r.MoveRotation(val * ((Component)this).transform.rotation); } protected void ScaleCapsule(float mlp) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (capsule.height != originalHeight * mlp) { capsule.height = Mathf.MoveTowards(capsule.height, originalHeight * mlp, Time.deltaTime * 4f); capsule.center = Vector3.MoveTowards(capsule.center, originalCenter * mlp, Time.deltaTime * 2f); } } protected void HighFriction() { ((Collider)capsule).material = highFrictionMaterial; } protected void ZeroFriction() { ((Collider)capsule).material = zeroFrictionMaterial; } protected float GetSlopeDamper(Vector3 velocity, Vector3 groundNormal) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) float num = 90f - Vector3.Angle(velocity, groundNormal); num -= slopeStartAngle; float num2 = slopeEndAngle - slopeStartAngle; return 1f - Mathf.Clamp(num / num2, 0f, 1f); } } public class CharacterThirdPerson : CharacterBase { [Serializable] public enum MoveMode { Directional, Strafe } public struct AnimState { public Vector3 moveDirection; public bool jump; public bool crouch; public bool onGround; public bool isStrafing; public float yVelocity; public bool doubleJump; } [Header("References")] public CharacterAnimationBase characterAnimation; public UserControlThirdPerson userControl; public CameraController cam; [Header("Movement")] public MoveMode moveMode; public bool smoothPhysics = true; public float smoothAccelerationTime = 0.2f; public float linearAccelerationSpeed = 3f; public float platformFriction = 7f; public float groundStickyEffect = 4f; public float maxVerticalVelocityOnGround = 3f; public float velocityToGroundTangentWeight = 0f; [Header("Rotation")] public bool lookInCameraDirection; public float turnSpeed = 5f; public float stationaryTurnSpeedMlp = 1f; [Header("Jumping and Falling")] public bool smoothJump = true; public float airSpeed = 6f; public float airControl = 2f; public float jumpPower = 12f; public float jumpRepeatDelayTime = 0f; public bool doubleJumpEnabled; public float doubleJumpPowerMlp = 1f; [Header("Wall Running")] public LayerMask wallRunLayers; public float wallRunMaxLength = 1f; public float wallRunMinMoveMag = 0.6f; public float wallRunMinVelocityY = -1f; public float wallRunRotationSpeed = 1.5f; public float wallRunMaxRotationAngle = 70f; public float wallRunWeightSpeed = 5f; [Header("Crouching")] public float crouchCapsuleScaleMlp = 0.6f; public AnimState animState = default(AnimState); protected Vector3 moveDirection; private Animator animator; private Vector3 normal; private Vector3 platformVelocity; private Vector3 platformAngularVelocity; private RaycastHit hit; private float jumpLeg; private float jumpEndTime; private float forwardMlp; private float groundDistance; private float lastAirTime; private float stickyForce; private Vector3 wallNormal = Vector3.up; private Vector3 moveDirectionVelocity; private float wallRunWeight; private float lastWallRunWeight; private float fixedDeltaTime; private Vector3 fixedDeltaPosition; private Quaternion fixedDeltaRotation = Quaternion.identity; private bool fixedFrame; private float wallRunEndTime; private Vector3 gravity; private Vector3 verticalVelocity; private float velocityY; private bool doubleJumped; private bool jumpReleased; public bool onGround { get; private set; } protected override void Start() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) base.Start(); animator = ((Component)this).GetComponent(); if ((Object)(object)animator == (Object)null) { animator = ((Component)characterAnimation).GetComponent(); } wallNormal = -((Vector3)(ref gravity)).normalized; onGround = true; animState.onGround = true; if ((Object)(object)cam != (Object)null) { ((Behaviour)cam).enabled = false; } } private void OnAnimatorMove() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) Move(animator.deltaPosition, animator.deltaRotation); } public override void Move(Vector3 deltaPosition, Quaternion deltaRotation) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) fixedDeltaTime += Time.deltaTime; fixedDeltaPosition += deltaPosition; fixedDeltaRotation *= deltaRotation; } private void FixedUpdate() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) gravity = GetGravity(); verticalVelocity = V3Tools.ExtractVertical(r.velocity, gravity, 1f); velocityY = ((Vector3)(ref verticalVelocity)).magnitude; if (Vector3.Dot(verticalVelocity, gravity) > 0f) { velocityY = 0f - velocityY; } r.interpolation = (RigidbodyInterpolation)(smoothPhysics ? 1 : 0); characterAnimation.smoothFollow = smoothPhysics; MoveFixed(fixedDeltaPosition); fixedDeltaTime = 0f; fixedDeltaPosition = Vector3.zero; r.MoveRotation(((Component)this).transform.rotation * fixedDeltaRotation); fixedDeltaRotation = Quaternion.identity; Rotate(); GroundCheck(); if (userControl.state.move == Vector3.zero && groundDistance < airborneThreshold * 0.5f) { HighFriction(); } else { ZeroFriction(); } int num; if (onGround && userControl.state.move == Vector3.zero) { Vector3 velocity = r.velocity; if (((Vector3)(ref velocity)).magnitude < 0.5f) { num = ((groundDistance < airborneThreshold * 0.5f) ? 1 : 0); goto IL_0194; } } num = 0; goto IL_0194; IL_0194: bool flag = (byte)num != 0; if ((Object)(object)gravityTarget != (Object)null) { r.useGravity = false; if (!flag) { r.AddForce(gravity); } } if (flag) { r.useGravity = false; r.velocity = Vector3.zero; } else if ((Object)(object)gravityTarget == (Object)null) { r.useGravity = true; } if (onGround) { animState.jump = Jump(); jumpReleased = false; doubleJumped = false; } else { if (!userControl.state.jump) { jumpReleased = true; } if (jumpReleased && userControl.state.jump && !doubleJumped && doubleJumpEnabled) { jumpEndTime = Time.time + 0.1f; animState.doubleJump = true; Vector3 velocity2 = userControl.state.move * airSpeed; r.velocity = velocity2; Rigidbody obj = r; obj.velocity += ((Component)this).transform.up * jumpPower * doubleJumpPowerMlp; doubleJumped = true; } } ScaleCapsule((!userControl.state.crouch) ? 1f : crouchCapsuleScaleMlp); fixedFrame = true; } protected virtual void Update() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) animState.onGround = onGround; animState.moveDirection = GetMoveDirection(); animState.yVelocity = Mathf.Lerp(animState.yVelocity, velocityY, Time.deltaTime * 10f); animState.crouch = userControl.state.crouch; animState.isStrafing = moveMode == MoveMode.Strafe; } protected virtual void LateUpdate() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)cam == (Object)null)) { cam.UpdateInput(); if (fixedFrame || (int)r.interpolation != 0) { cam.UpdateTransform(((int)r.interpolation != 0) ? Time.deltaTime : Time.fixedDeltaTime); fixedFrame = false; } } } private void MoveFixed(Vector3 deltaPosition) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) WallRun(); Vector3 val = ((!(fixedDeltaTime > 0f)) ? Vector3.zero : (deltaPosition / fixedDeltaTime)); val += V3Tools.ExtractHorizontal(platformVelocity, gravity, 1f); if (onGround) { if (velocityToGroundTangentWeight > 0f) { Quaternion val2 = Quaternion.FromToRotation(((Component)this).transform.up, normal); val = Quaternion.Lerp(Quaternion.identity, val2, velocityToGroundTangentWeight) * val; } } else { Vector3 val3 = V3Tools.ExtractHorizontal(userControl.state.move * airSpeed, gravity, 1f); val = Vector3.Lerp(r.velocity, val3, Time.deltaTime * airControl); } if (onGround && Time.time > jumpEndTime) { r.velocity -= ((Component)this).transform.up * stickyForce * Time.deltaTime; } Vector3 val4 = V3Tools.ExtractVertical(r.velocity, gravity, 1f); Vector3 val5 = V3Tools.ExtractHorizontal(val, gravity, 1f); if (onGround && Vector3.Dot(val4, gravity) < 0f) { val4 = Vector3.ClampMagnitude(val4, maxVerticalVelocityOnGround); } r.velocity = val5 + val4; forwardMlp = 1f; } private void WallRun() { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) bool flag = CanWallRun(); if (wallRunWeight > 0f && !flag) { wallRunEndTime = Time.time; } if (Time.time < wallRunEndTime + 0.5f) { flag = false; } wallRunWeight = Mathf.MoveTowards(wallRunWeight, (!flag) ? 0f : 1f, Time.deltaTime * wallRunWeightSpeed); if (wallRunWeight <= 0f && lastWallRunWeight > 0f) { Vector3 val = V3Tools.ExtractHorizontal(((Component)this).transform.forward, gravity, 1f); ((Component)this).transform.rotation = Quaternion.LookRotation(val, -gravity); wallNormal = -((Vector3)(ref gravity)).normalized; } lastWallRunWeight = wallRunWeight; if (!(wallRunWeight <= 0f)) { if (onGround && velocityY < 0f) { r.velocity = V3Tools.ExtractHorizontal(r.velocity, gravity, 1f); } Vector3 val2 = V3Tools.ExtractHorizontal(((Component)this).transform.forward, gravity, 1f); RaycastHit val3 = default(RaycastHit); ((RaycastHit)(ref val3)).normal = -((Vector3)(ref gravity)).normalized; Vector3 val4; if (onGround) { val4 = ((Component)this).transform.position; } else { Bounds bounds = ((Collider)capsule).bounds; val4 = ((Bounds)(ref bounds)).center; } Physics.Raycast(val4, val2, ref val3, 3f, LayerMask.op_Implicit(wallRunLayers)); wallNormal = Vector3.Lerp(wallNormal, ((RaycastHit)(ref val3)).normal, Time.deltaTime * wallRunRotationSpeed); wallNormal = Vector3.RotateTowards(-((Vector3)(ref gravity)).normalized, wallNormal, wallRunMaxRotationAngle * ((float)Math.PI / 180f), 0f); Vector3 forward = ((Component)this).transform.forward; Vector3 val5 = wallNormal; Vector3.OrthoNormalize(ref val5, ref forward); ((Component)this).transform.rotation = Quaternion.Slerp(Quaternion.LookRotation(val2, -gravity), Quaternion.LookRotation(forward, wallNormal), wallRunWeight); } } private bool CanWallRun() { if (Time.time < jumpEndTime - 0.1f) { return false; } if (Time.time > jumpEndTime - 0.1f + wallRunMaxLength) { return false; } if (velocityY < wallRunMinVelocityY) { return false; } if (((Vector3)(ref userControl.state.move)).magnitude < wallRunMinMoveMag) { return false; } return true; } private Vector3 GetMoveDirection() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) switch (moveMode) { case MoveMode.Directional: moveDirection = Vector3.SmoothDamp(moveDirection, new Vector3(0f, 0f, ((Vector3)(ref userControl.state.move)).magnitude), ref moveDirectionVelocity, smoothAccelerationTime); moveDirection = Vector3.MoveTowards(moveDirection, new Vector3(0f, 0f, ((Vector3)(ref userControl.state.move)).magnitude), Time.deltaTime * linearAccelerationSpeed); return moveDirection * forwardMlp; case MoveMode.Strafe: moveDirection = Vector3.SmoothDamp(moveDirection, userControl.state.move, ref moveDirectionVelocity, smoothAccelerationTime); moveDirection = Vector3.MoveTowards(moveDirection, userControl.state.move, Time.deltaTime * linearAccelerationSpeed); return ((Component)this).transform.InverseTransformDirection(moveDirection); default: return Vector3.zero; } } protected virtual void Rotate() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)gravityTarget != (Object)null) { r.MoveRotation(Quaternion.FromToRotation(((Component)this).transform.up, ((Component)this).transform.position - gravityTarget.position) * ((Component)this).transform.rotation); } if (platformAngularVelocity != Vector3.zero) { r.MoveRotation(Quaternion.Euler(platformAngularVelocity) * ((Component)this).transform.rotation); } float num = GetAngleFromForward(GetForwardDirection()); if (userControl.state.move == Vector3.zero) { num *= (1.01f - Mathf.Abs(num) / 180f) * stationaryTurnSpeedMlp; } r.MoveRotation(Quaternion.AngleAxis(num * Time.deltaTime * turnSpeed, ((Component)this).transform.up) * r.rotation); } private Vector3 GetForwardDirection() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) bool flag = userControl.state.move != Vector3.zero; switch (moveMode) { case MoveMode.Directional: if (flag) { return userControl.state.move; } return (!lookInCameraDirection) ? ((Component)this).transform.forward : (userControl.state.lookPos - r.position); case MoveMode.Strafe: if (flag) { return userControl.state.lookPos - r.position; } return (!lookInCameraDirection) ? ((Component)this).transform.forward : (userControl.state.lookPos - r.position); default: return Vector3.zero; } } protected virtual bool Jump() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) if (!userControl.state.jump) { return false; } if (userControl.state.crouch) { return false; } if (!characterAnimation.animationGrounded) { return false; } if (Time.time < lastAirTime + jumpRepeatDelayTime) { return false; } onGround = false; jumpEndTime = Time.time + 0.1f; Vector3 val = userControl.state.move * airSpeed; val += ((Component)this).transform.up * jumpPower; if (smoothJump) { ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(JumpSmooth(val - r.velocity)); } else { r.velocity = val; } return true; } private IEnumerator JumpSmooth(Vector3 jumpVelocity) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) int steps = 0; int stepsToTake = 3; while (steps < stepsToTake) { r.AddForce(jumpVelocity / (float)stepsToTake, (ForceMode)2); steps++; yield return (object)new WaitForFixedUpdate(); } } private void GroundCheck() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; platformAngularVelocity = Vector3.zero; float num = 0f; hit = GetSpherecastHit(); normal = ((Component)this).transform.up; Vector3 val2 = Vector3.Project(r.position - ((RaycastHit)(ref hit)).point, ((Component)this).transform.up); groundDistance = ((Vector3)(ref val2)).magnitude; if (Time.time > jumpEndTime && velocityY < jumpPower * 0.5f) { bool flag = onGround; onGround = false; float num2 = (flag ? airborneThreshold : (airborneThreshold * 0.5f)); Vector3 val3 = V3Tools.ExtractHorizontal(r.velocity, gravity, 1f); float magnitude = ((Vector3)(ref val3)).magnitude; if (groundDistance < num2) { num = groundStickyEffect * magnitude * num2; if ((Object)(object)((RaycastHit)(ref hit)).rigidbody != (Object)null) { val = ((RaycastHit)(ref hit)).rigidbody.GetPointVelocity(((RaycastHit)(ref hit)).point); platformAngularVelocity = Vector3.Project(((RaycastHit)(ref hit)).rigidbody.angularVelocity, ((Component)this).transform.up); } onGround = true; } } platformVelocity = Vector3.Lerp(platformVelocity, val, Time.deltaTime * platformFriction); stickyForce = num; if (!onGround) { lastAirTime = Time.time; } } } public class SimpleLocomotion : MonoBehaviour { [Serializable] public enum RotationMode { Smooth, Linear } [Tooltip("The component that updates the camera.")] public CameraController cameraController; [Tooltip("Acceleration of movement.")] public float accelerationTime = 0.2f; [Tooltip("Turning speed.")] public float turnTime = 0.2f; [Tooltip("If true, will run on left shift, if not will walk on left shift.")] public bool walkByDefault = true; [Tooltip("Smooth or linear rotation.")] public RotationMode rotationMode; [Tooltip("Procedural motion speed (if not using root motion).")] public float moveSpeed = 3f; private Animator animator; private float speed; private float angleVel; private float speedVel; private Vector3 linearTargetDirection; private CharacterController characterController; public bool isGrounded { get; private set; } private void Start() { animator = ((Component)this).GetComponent(); characterController = ((Component)this).GetComponent(); ((Behaviour)cameraController).enabled = false; } private void Update() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) isGrounded = ((Component)this).transform.position.y < 0.1f; Rotate(); Move(); } private void LateUpdate() { cameraController.UpdateInput(); cameraController.UpdateTransform(); } private void Rotate() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if (!isGrounded) { return; } Vector3 inputVector = GetInputVector(); if (inputVector == Vector3.zero) { return; } Vector3 forward = ((Component)this).transform.forward; switch (rotationMode) { case RotationMode.Smooth: { Vector3 val = ((Component)cameraController).transform.rotation * inputVector; float num = Mathf.Atan2(forward.x, forward.z) * 57.29578f; float num2 = Mathf.Atan2(val.x, val.z) * 57.29578f; float num3 = Mathf.SmoothDampAngle(num, num2, ref angleVel, turnTime); ((Component)this).transform.rotation = Quaternion.AngleAxis(num3, Vector3.up); break; } case RotationMode.Linear: { Vector3 inputVectorRaw = GetInputVectorRaw(); if (inputVectorRaw != Vector3.zero) { linearTargetDirection = ((Component)cameraController).transform.rotation * inputVectorRaw; } forward = Vector3.RotateTowards(forward, linearTargetDirection, Time.deltaTime * (1f / turnTime), 1f); forward.y = 0f; ((Component)this).transform.rotation = Quaternion.LookRotation(forward); break; } } } private void Move() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) float num = (walkByDefault ? ((!Input.GetKey((KeyCode)304)) ? 0.5f : 1f) : ((!Input.GetKey((KeyCode)304)) ? 1f : 0.5f)); speed = Mathf.SmoothDamp(speed, num, ref speedVel, accelerationTime); Vector3 inputVector = GetInputVector(); float num2 = ((Vector3)(ref inputVector)).magnitude * speed; animator.SetFloat("Speed", num2); if (!animator.hasRootMotion && isGrounded) { Vector3 val = ((Component)this).transform.forward * num2 * moveSpeed; if ((Object)(object)characterController != (Object)null) { characterController.SimpleMove(val); return; } Transform transform = ((Component)this).transform; transform.position += val * Time.deltaTime; } } private Vector3 GetInputVector() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) Vector3 result = default(Vector3); ((Vector3)(ref result))..ctor(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical")); result.z += Mathf.Abs(result.x) * 0.05f; result.x -= Mathf.Abs(result.z) * 0.05f; return result; } private Vector3 GetInputVectorRaw() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) return new Vector3(Input.GetAxisRaw("Horizontal"), 0f, Input.GetAxisRaw("Vertical")); } } public class UserControlAI : UserControlThirdPerson { public Transform moveTarget; public float stoppingDistance = 0.5f; public float stoppingThreshold = 1.5f; public Navigator navigator; protected override void Start() { base.Start(); navigator.Initiate(((Component)this).transform); } protected override void Update() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) float num = ((!walkByDefault) ? 1f : 0.5f); if (navigator.activeTargetSeeking) { navigator.Update(moveTarget.position); state.move = navigator.normalizedDeltaPosition * num; return; } Vector3 val = moveTarget.position - ((Component)this).transform.position; float magnitude = ((Vector3)(ref val)).magnitude; Vector3 up = ((Component)this).transform.up; Vector3.OrthoNormalize(ref up, ref val); float num2 = ((!(state.move != Vector3.zero)) ? (stoppingDistance * stoppingThreshold) : stoppingDistance); state.move = ((!(magnitude > num2)) ? Vector3.zero : (val * num)); state.lookPos = moveTarget.position; } private void OnDrawGizmos() { if (navigator.activeTargetSeeking) { navigator.Visualize(); } } } public class UserControlThirdPerson : MonoBehaviour { public struct State { public Vector3 move; public Vector3 lookPos; public bool crouch; public bool jump; public int actionIndex; } public bool walkByDefault; public bool canCrouch = true; public bool canJump = true; public State state = default(State); protected Transform cam; protected virtual void Start() { cam = ((Component)Camera.main).transform; } protected virtual void Update() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) state.crouch = canCrouch && Input.GetKey((KeyCode)99); state.jump = canJump && Input.GetButton("Jump"); float axisRaw = Input.GetAxisRaw("Horizontal"); float axisRaw2 = Input.GetAxisRaw("Vertical"); Quaternion rotation = cam.rotation; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(axisRaw, 0f, axisRaw2); Vector3 val2 = rotation * ((Vector3)(ref val)).normalized; if (val2 != Vector3.zero) { Vector3 up = ((Component)this).transform.up; Vector3.OrthoNormalize(ref up, ref val2); state.move = val2; } else { state.move = Vector3.zero; } bool key = Input.GetKey((KeyCode)304); float num = (walkByDefault ? ((!key) ? 0.5f : 1f) : ((!key) ? 1f : 0.5f)); ref State reference = ref state; reference.move *= num; state.lookPos = ((Component)this).transform.position + cam.forward * 100f; } } public class ApplicationQuit : MonoBehaviour { private void Update() { if (Input.GetKeyDown((KeyCode)113) || Input.GetKeyDown((KeyCode)27)) { Application.Quit(); } } } public class SlowMo : MonoBehaviour { public KeyCode[] keyCodes; public bool mouse0; public bool mouse1; public float slowMoTimeScale = 0.3f; private void Update() { Time.timeScale = ((!IsSlowMotion()) ? 1f : slowMoTimeScale); } private bool IsSlowMotion() { if (mouse0 && Input.GetMouseButton(0)) { return true; } if (mouse1 && Input.GetMouseButton(1)) { return true; } for (int i = 0; i < keyCodes.Length; i++) { if (Input.GetKey(keyCodes[i])) { return true; } } return false; } } public class HitReactionVRIKTrigger : MonoBehaviour { public HitReactionVRIK hitReaction; public float hitForce = 1f; private string colliderName; private void Update() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (Input.GetMouseButtonDown(0)) { Ray val = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 100f)) { hitReaction.Hit(((RaycastHit)(ref val2)).collider, ((Ray)(ref val)).direction * hitForce, ((RaycastHit)(ref val2)).point); colliderName = ((Object)((RaycastHit)(ref val2)).collider).name; } } } private void OnGUI() { GUILayout.Label("LMB to shoot the Dummy, RMB to rotate the camera.", (GUILayoutOption[])(object)new GUILayoutOption[0]); if (colliderName != string.Empty) { GUILayout.Label("Last Bone Hit: " + colliderName, (GUILayoutOption[])(object)new GUILayoutOption[0]); } } } } namespace RootMotion1.Demos { public class VRIKCalibrationBasic : MonoBehaviour { [Tooltip("The VRIK component.")] public VRIK ik; [Header("Head")] [Tooltip("HMD.")] public Transform centerEyeAnchor; [Tooltip("Position offset of the camera from the head bone (root space).")] public Vector3 headAnchorPositionOffset; [Tooltip("Rotation offset of the camera from the head bone (root space).")] public Vector3 headAnchorRotationOffset; [Header("Hands")] [Tooltip("Left Hand Controller")] public Transform leftHandAnchor; [Tooltip("Right Hand Controller")] public Transform rightHandAnchor; [Tooltip("Position offset of the hand controller from the hand bone (controller space).")] public Vector3 handAnchorPositionOffset; [Tooltip("Rotation offset of the hand controller from the hand bone (controller space).")] public Vector3 handAnchorRotationOffset; [Header("Scale")] [Tooltip("Multiplies the scale of the root.")] public float scaleMlp = 1f; [Header("Data stored by Calibration")] public VRIKCalibrator.CalibrationData data = new VRIKCalibrator.CalibrationData(); private void LateUpdate() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown((KeyCode)99)) { data = VRIKCalibrator.Calibrate(ik, centerEyeAnchor, leftHandAnchor, rightHandAnchor, headAnchorPositionOffset, headAnchorRotationOffset, handAnchorPositionOffset, handAnchorRotationOffset, scaleMlp); } if (Input.GetKeyDown((KeyCode)100)) { if (data.scale == 0f) { Debug.LogError((object)"No Calibration Data to calibrate to, please calibrate with 'C' first."); } else { VRIKCalibrator.Calibrate(ik, data, centerEyeAnchor, null, leftHandAnchor, rightHandAnchor); } } if (Input.GetKeyDown((KeyCode)115)) { if (data.scale == 0f) { Debug.LogError((object)"Avatar needs to be calibrated before RecalibrateScale is called."); } VRIKCalibrator.RecalibrateScale(ik, data, scaleMlp); } } } public class VRIKCalibrationController : MonoBehaviour { [Tooltip("Reference to the VRIK component on the avatar.")] public VRIK ik; [Tooltip("The settings for VRIK calibration.")] public VRIKCalibrator.Settings settings; [Tooltip("The HMD.")] public Transform headTracker; [Tooltip("(Optional) A tracker placed anywhere on the body of the player, preferrably close to the pelvis, on the belt area.")] public Transform bodyTracker; [Tooltip("(Optional) A tracker or hand controller device placed anywhere on or in the player's left hand.")] public Transform leftHandTracker; [Tooltip("(Optional) A tracker or hand controller device placed anywhere on or in the player's right hand.")] public Transform rightHandTracker; [Tooltip("(Optional) A tracker placed anywhere on the ankle or toes of the player's left leg.")] public Transform leftFootTracker; [Tooltip("(Optional) A tracker placed anywhere on the ankle or toes of the player's right leg.")] public Transform rightFootTracker; [Header("Data stored by Calibration")] public VRIKCalibrator.CalibrationData data = new VRIKCalibrator.CalibrationData(); private void LateUpdate() { if (Input.GetKeyDown((KeyCode)99)) { data = VRIKCalibrator.Calibrate(ik, settings, headTracker, bodyTracker, leftHandTracker, rightHandTracker, leftFootTracker, rightFootTracker); } if (Input.GetKeyDown((KeyCode)100)) { if (data.scale == 0f) { Debug.LogError((object)"No Calibration Data to calibrate to, please calibrate with settings first."); } else { VRIKCalibrator.Calibrate(ik, data, headTracker, bodyTracker, leftHandTracker, rightHandTracker, leftFootTracker, rightFootTracker); } } if (Input.GetKeyDown((KeyCode)115)) { if (data.scale == 0f) { Debug.LogError((object)"Avatar needs to be calibrated before RecalibrateScale is called."); } VRIKCalibrator.RecalibrateScale(ik, data, settings); } } } } namespace RootMotion.Demos { public class VRIKPlatform : MonoBehaviour { public VRIK ik; private Vector3 lastPosition; private Quaternion lastRotation = Quaternion.identity; private void OnEnable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) lastPosition = ((Component)this).transform.position; lastRotation = ((Component)this).transform.rotation; } private void LateUpdate() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) ik.solver.AddPlatformMotion(((Component)this).transform.position - lastPosition, ((Component)this).transform.rotation * Quaternion.Inverse(lastRotation), ((Component)this).transform.position); lastRotation = ((Component)this).transform.rotation; lastPosition = ((Component)this).transform.position; } } public class VRIKPlatformController : MonoBehaviour { public VRIK ik; public Transform trackingSpace; public Transform platform; public bool moveToPlatform = true; private Transform lastPlatform; private Vector3 lastPosition; private Quaternion lastRotation = Quaternion.identity; private void LateUpdate() { //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)platform != (Object)(object)lastPlatform) { if ((Object)(object)platform != (Object)null) { if (moveToPlatform) { lastPosition = ((Component)ik).transform.position; lastRotation = ((Component)ik).transform.rotation; ((Component)ik).transform.position = platform.position; ((Component)ik).transform.rotation = platform.rotation; trackingSpace.position = platform.position; trackingSpace.rotation = platform.rotation; ik.solver.AddPlatformMotion(platform.position - lastPosition, platform.rotation * Quaternion.Inverse(lastRotation), platform.position); } lastPosition = platform.position; lastRotation = platform.rotation; } ((Component)ik).transform.parent = platform; trackingSpace.parent = platform; lastPlatform = platform; } if ((Object)(object)platform != (Object)null) { ik.solver.AddPlatformMotion(platform.position - lastPosition, platform.rotation * Quaternion.Inverse(lastRotation), platform.position); lastRotation = platform.rotation; lastPosition = platform.position; } } } } namespace RootMotion1 { [Serializable] public enum Axis { X, Y, Z } public class AxisTools { public static Vector3 ToVector3(Axis axis) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) return (Vector3)(axis switch { Axis.X => Vector3.right, Axis.Y => Vector3.up, _ => Vector3.forward, }); } public static Axis ToAxis(Vector3 v) { float num = Mathf.Abs(v.x); float num2 = Mathf.Abs(v.y); float num3 = Mathf.Abs(v.z); Axis result = Axis.X; if (num2 > num && num2 > num3) { result = Axis.Y; } if (num3 > num && num3 > num2) { result = Axis.Z; } return result; } public static Axis GetAxisToPoint(Transform t, Vector3 worldPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) Vector3 axisVectorToPoint = GetAxisVectorToPoint(t, worldPosition); if (axisVectorToPoint == Vector3.right) { return Axis.X; } if (axisVectorToPoint == Vector3.up) { return Axis.Y; } return Axis.Z; } public static Axis GetAxisToDirection(Transform t, Vector3 direction) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) Vector3 axisVectorToDirection = GetAxisVectorToDirection(t, direction); if (axisVectorToDirection == Vector3.right) { return Axis.X; } if (axisVectorToDirection == Vector3.up) { return Axis.Y; } return Axis.Z; } public static Vector3 GetAxisVectorToPoint(Transform t, Vector3 worldPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) return GetAxisVectorToDirection(t, worldPosition - t.position); } public static Vector3 GetAxisVectorToDirection(Transform t, Vector3 direction) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return GetAxisVectorToDirection(t.rotation, direction); } public static Vector3 GetAxisVectorToDirection(Quaternion r, Vector3 direction) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) direction = ((Vector3)(ref direction)).normalized; Vector3 result = Vector3.right; float num = Mathf.Abs(Vector3.Dot(Vector3.Normalize(r * Vector3.right), direction)); float num2 = Mathf.Abs(Vector3.Dot(Vector3.Normalize(r * Vector3.up), direction)); if (num2 > num) { result = Vector3.up; } float num3 = Mathf.Abs(Vector3.Dot(Vector3.Normalize(r * Vector3.forward), direction)); if (num3 > num && num3 > num2) { result = Vector3.forward; } return result; } } [Serializable] public class BipedLimbOrientations { [Serializable] public class LimbOrientation { public Vector3 upperBoneForwardAxis; public Vector3 lowerBoneForwardAxis; public Vector3 lastBoneLeftAxis; public LimbOrientation(Vector3 upperBoneForwardAxis, Vector3 lowerBoneForwardAxis, Vector3 lastBoneLeftAxis) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) this.upperBoneForwardAxis = upperBoneForwardAxis; this.lowerBoneForwardAxis = lowerBoneForwardAxis; this.lastBoneLeftAxis = lastBoneLeftAxis; } } public LimbOrientation leftArm; public LimbOrientation rightArm; public LimbOrientation leftLeg; public LimbOrientation rightLeg; public static BipedLimbOrientations UMA => new BipedLimbOrientations(new LimbOrientation(Vector3.forward, Vector3.forward, Vector3.forward), new LimbOrientation(Vector3.forward, Vector3.forward, Vector3.back), new LimbOrientation(Vector3.forward, Vector3.forward, Vector3.down), new LimbOrientation(Vector3.forward, Vector3.forward, Vector3.down)); public static BipedLimbOrientations MaxBiped => new BipedLimbOrientations(new LimbOrientation(Vector3.down, Vector3.down, Vector3.down), new LimbOrientation(Vector3.down, Vector3.down, Vector3.up), new LimbOrientation(Vector3.up, Vector3.up, Vector3.back), new LimbOrientation(Vector3.up, Vector3.up, Vector3.back)); public BipedLimbOrientations(LimbOrientation leftArm, LimbOrientation rightArm, LimbOrientation leftLeg, LimbOrientation rightLeg) { this.leftArm = leftArm; this.rightArm = rightArm; this.leftLeg = leftLeg; this.rightLeg = rightLeg; } } public static class BipedNaming { [Serializable] public enum BoneType { Unassigned, Spine, Head, Arm, Leg, Tail, Eye } [Serializable] public enum BoneSide { Center, Left, Right } public static string[] typeLeft = new string[9] { " L ", "_L_", "-L-", " l ", "_l_", "-l-", "Left", "left", "CATRigL" }; public static string[] typeRight = new string[9] { " R ", "_R_", "-R-", " r ", "_r_", "-r-", "Right", "right", "CATRigR" }; public static string[] typeSpine = new string[16] { "Spine", "spine", "Pelvis", "pelvis", "Root", "root", "Torso", "torso", "Body", "body", "Hips", "hips", "Neck", "neck", "Chest", "chest" }; public static string[] typeHead = new string[2] { "Head", "head" }; public static string[] typeArm = new string[10] { "Arm", "arm", "Hand", "hand", "Wrist", "Wrist", "Elbow", "elbow", "Palm", "palm" }; public static string[] typeLeg = new string[16] { "Leg", "leg", "Thigh", "thigh", "Calf", "calf", "Femur", "femur", "Knee", "knee", "Foot", "foot", "Ankle", "ankle", "Hip", "hip" }; public static string[] typeTail = new string[2] { "Tail", "tail" }; public static string[] typeEye = new string[2] { "Eye", "eye" }; public static string[] typeExclude = new string[6] { "Nub", "Dummy", "dummy", "Tip", "IK", "Mesh" }; public static string[] typeExcludeSpine = new string[2] { "Head", "head" }; public static string[] typeExcludeHead = new string[2] { "Top", "End" }; public static string[] typeExcludeArm = new string[19] { "Collar", "collar", "Clavicle", "clavicle", "Finger", "finger", "Index", "index", "Mid", "mid", "Pinky", "pinky", "Ring", "Thumb", "thumb", "Adjust", "adjust", "Twist", "twist" }; public static string[] typeExcludeLeg = new string[7] { "Toe", "toe", "Platform", "Adjust", "adjust", "Twist", "twist" }; public static string[] typeExcludeTail = new string[0]; public static string[] typeExcludeEye = new string[6] { "Lid", "lid", "Brow", "brow", "Lash", "lash" }; public static string[] pelvis = new string[4] { "Pelvis", "pelvis", "Hip", "hip" }; public static string[] hand = new string[6] { "Hand", "hand", "Wrist", "wrist", "Palm", "palm" }; public static string[] foot = new string[4] { "Foot", "foot", "Ankle", "ankle" }; public static Transform[] GetBonesOfType(BoneType boneType, Transform[] bones) { Transform[] array = (Transform[])(object)new Transform[0]; foreach (Transform val in bones) { if ((Object)(object)val != (Object)null && GetBoneType(((Object)val).name) == boneType) { Array.Resize(ref array, array.Length + 1); array[^1] = val; } } return array; } public static Transform[] GetBonesOfSide(BoneSide boneSide, Transform[] bones) { Transform[] array = (Transform[])(object)new Transform[0]; foreach (Transform val in bones) { if ((Object)(object)val != (Object)null && GetBoneSide(((Object)val).name) == boneSide) { Array.Resize(ref array, array.Length + 1); array[^1] = val; } } return array; } public static Transform[] GetBonesOfTypeAndSide(BoneType boneType, BoneSide boneSide, Transform[] bones) { Transform[] bonesOfType = GetBonesOfType(boneType, bones); return GetBonesOfSide(boneSide, bonesOfType); } public static Transform GetFirstBoneOfTypeAndSide(BoneType boneType, BoneSide boneSide, Transform[] bones) { Transform[] bonesOfTypeAndSide = GetBonesOfTypeAndSide(boneType, boneSide, bones); if (bonesOfTypeAndSide.Length == 0) { return null; } return bonesOfTypeAndSide[0]; } public static Transform GetNamingMatch(Transform[] transforms, params string[][] namings) { foreach (Transform val in transforms) { bool flag = true; foreach (string[] namingConvention in namings) { if (!matchesNaming(((Object)val).name, namingConvention)) { flag = false; break; } } if (flag) { return val; } } return null; } public static BoneType GetBoneType(string boneName) { if (isSpine(boneName)) { return BoneType.Spine; } if (isHead(boneName)) { return BoneType.Head; } if (isArm(boneName)) { return BoneType.Arm; } if (isLeg(boneName)) { return BoneType.Leg; } if (isTail(boneName)) { return BoneType.Tail; } if (isEye(boneName)) { return BoneType.Eye; } return BoneType.Unassigned; } public static BoneSide GetBoneSide(string boneName) { if (isLeft(boneName)) { return BoneSide.Left; } if (isRight(boneName)) { return BoneSide.Right; } return BoneSide.Center; } public static Transform GetBone(Transform[] transforms, BoneType boneType, BoneSide boneSide = BoneSide.Center, params string[][] namings) { Transform[] bonesOfTypeAndSide = GetBonesOfTypeAndSide(boneType, boneSide, transforms); return GetNamingMatch(bonesOfTypeAndSide, namings); } private static bool isLeft(string boneName) { return matchesNaming(boneName, typeLeft) || lastLetter(boneName) == "L" || firstLetter(boneName) == "L"; } private static bool isRight(string boneName) { return matchesNaming(boneName, typeRight) || lastLetter(boneName) == "R" || firstLetter(boneName) == "R"; } private static bool isSpine(string boneName) { return matchesNaming(boneName, typeSpine) && !excludesNaming(boneName, typeExcludeSpine); } private static bool isHead(string boneName) { return matchesNaming(boneName, typeHead) && !excludesNaming(boneName, typeExcludeHead); } private static bool isArm(string boneName) { return matchesNaming(boneName, typeArm) && !excludesNaming(boneName, typeExcludeArm); } private static bool isLeg(string boneName) { return matchesNaming(boneName, typeLeg) && !excludesNaming(boneName, typeExcludeLeg); } private static bool isTail(string boneName) { return matchesNaming(boneName, typeTail) && !excludesNaming(boneName, typeExcludeTail); } private static bool isEye(string boneName) { return matchesNaming(boneName, typeEye) && !excludesNaming(boneName, typeExcludeEye); } private static bool isTypeExclude(string boneName) { return matchesNaming(boneName, typeExclude); } private static bool matchesNaming(string boneName, string[] namingConvention) { if (excludesNaming(boneName, typeExclude)) { return false; } foreach (string value in namingConvention) { if (boneName.Contains(value)) { return true; } } return false; } private static bool excludesNaming(string boneName, string[] namingConvention) { foreach (string value in namingConvention) { if (boneName.Contains(value)) { return true; } } return false; } private static bool matchesLastLetter(string boneName, string[] namingConvention) { foreach (string letter in namingConvention) { if (LastLetterIs(boneName, letter)) { return true; } } return false; } private static bool LastLetterIs(string boneName, string letter) { string text = boneName.Substring(boneName.Length - 1, 1); return text == letter; } private static string firstLetter(string boneName) { if (boneName.Length > 0) { return boneName.Substring(0, 1); } return ""; } private static string lastLetter(string boneName) { if (boneName.Length > 0) { return boneName.Substring(boneName.Length - 1, 1); } return ""; } } [Serializable] public class BipedReferences { public struct AutoDetectParams { public bool legsParentInSpine; public bool includeEyes; public static AutoDetectParams Default => new AutoDetectParams(legsParentInSpine: true, includeEyes: true); public AutoDetectParams(bool legsParentInSpine, bool includeEyes) { this.legsParentInSpine = legsParentInSpine; this.includeEyes = includeEyes; } } public Transform root; public Transform pelvis; public Transform leftThigh; public Transform leftCalf; public Transform leftFoot; public Transform rightThigh; public Transform rightCalf; public Transform rightFoot; public Transform leftUpperArm; public Transform leftForearm; public Transform leftHand; public Transform rightUpperArm; public Transform rightForearm; public Transform rightHand; public Transform head; public Transform[] spine = (Transform[])(object)new Transform[0]; public Transform[] eyes = (Transform[])(object)new Transform[0]; public virtual bool isFilled { get { if ((Object)(object)root == (Object)null) { return false; } if ((Object)(object)pelvis == (Object)null) { return false; } if ((Object)(object)leftThigh == (Object)null || (Object)(object)leftCalf == (Object)null || (Object)(object)leftFoot == (Object)null) { return false; } if ((Object)(object)rightThigh == (Object)null || (Object)(object)rightCalf == (Object)null || (Object)(object)rightFoot == (Object)null) { return false; } if ((Object)(object)leftUpperArm == (Object)null || (Object)(object)leftForearm == (Object)null || (Object)(object)leftHand == (Object)null) { return false; } if ((Object)(object)rightUpperArm == (Object)null || (Object)(object)rightForearm == (Object)null || (Object)(object)rightHand == (Object)null) { return false; } Transform[] array = spine; foreach (Transform val in array) { if ((Object)(object)val == (Object)null) { return false; } } Transform[] array2 = eyes; foreach (Transform val2 in array2) { if ((Object)(object)val2 == (Object)null) { return false; } } return true; } } public bool isEmpty => IsEmpty(includeRoot: true); public virtual bool IsEmpty(bool includeRoot) { if (includeRoot && (Object)(object)root != (Object)null) { return false; } if ((Object)(object)pelvis != (Object)null || (Object)(object)head != (Object)null) { return false; } if ((Object)(object)leftThigh != (Object)null || (Object)(object)leftCalf != (Object)null || (Object)(object)leftFoot != (Object)null) { return false; } if ((Object)(object)rightThigh != (Object)null || (Object)(object)rightCalf != (Object)null || (Object)(object)rightFoot != (Object)null) { return false; } if ((Object)(object)leftUpperArm != (Object)null || (Object)(object)leftForearm != (Object)null || (Object)(object)leftHand != (Object)null) { return false; } if ((Object)(object)rightUpperArm != (Object)null || (Object)(object)rightForearm != (Object)null || (Object)(object)rightHand != (Object)null) { return false; } Transform[] array = spine; foreach (Transform val in array) { if ((Object)(object)val != (Object)null) { return false; } } Transform[] array2 = eyes; foreach (Transform val2 in array2) { if ((Object)(object)val2 != (Object)null) { return false; } } return true; } public virtual bool Contains(Transform t, bool ignoreRoot = false) { if (!ignoreRoot && (Object)(object)root == (Object)(object)t) { return true; } if ((Object)(object)pelvis == (Object)(object)t) { return true; } if ((Object)(object)leftThigh == (Object)(object)t) { return true; } if ((Object)(object)leftCalf == (Object)(object)t) { return true; } if ((Object)(object)leftFoot == (Object)(object)t) { return true; } if ((Object)(object)rightThigh == (Object)(object)t) { return true; } if ((Object)(object)rightCalf == (Object)(object)t) { return true; } if ((Object)(object)rightFoot == (Object)(object)t) { return true; } if ((Object)(object)leftUpperArm == (Object)(object)t) { return true; } if ((Object)(object)leftForearm == (Object)(object)t) { return true; } if ((Object)(object)leftHand == (Object)(object)t) { return true; } if ((Object)(object)rightUpperArm == (Object)(object)t) { return true; } if ((Object)(object)rightForearm == (Object)(object)t) { return true; } if ((Object)(object)rightHand == (Object)(object)t) { return true; } if ((Object)(object)head == (Object)(object)t) { return true; } Transform[] array = spine; foreach (Transform val in array) { if ((Object)(object)val == (Object)(object)t) { return true; } } Transform[] array2 = eyes; foreach (Transform val2 in array2) { if ((Object)(object)val2 == (Object)(object)t) { return true; } } return false; } public static bool AutoDetectReferences(ref BipedReferences references, Transform root, AutoDetectParams autoDetectParams) { if (references == null) { references = new BipedReferences(); } references.root = root; Animator component = ((Component)root).GetComponent(); if ((Object)(object)component != (Object)null && component.isHuman) { AssignHumanoidReferences(ref references, component, autoDetectParams); return true; } DetectReferencesByNaming(ref references, root, autoDetectParams); Warning.logged = false; if (!references.isFilled) { Warning.Log("BipedReferences contains one or more missing Transforms.", root, logInEditMode: true); return false; } string errorMessage = ""; if (SetupError(references, ref errorMessage)) { Warning.Log(errorMessage, references.root, logInEditMode: true); return false; } if (SetupWarning(references, ref errorMessage)) { Warning.Log(errorMessage, references.root, logInEditMode: true); } return true; } public static void DetectReferencesByNaming(ref BipedReferences references, Transform root, AutoDetectParams autoDetectParams) { if (references == null) { references = new BipedReferences(); } Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren(); DetectLimb(BipedNaming.BoneType.Arm, BipedNaming.BoneSide.Left, ref references.leftUpperArm, ref references.leftForearm, ref references.leftHand, componentsInChildren); DetectLimb(BipedNaming.BoneType.Arm, BipedNaming.BoneSide.Right, ref references.rightUpperArm, ref references.rightForearm, ref references.rightHand, componentsInChildren); DetectLimb(BipedNaming.BoneType.Leg, BipedNaming.BoneSide.Left, ref references.leftThigh, ref references.leftCalf, ref references.leftFoot, componentsInChildren); DetectLimb(BipedNaming.BoneType.Leg, BipedNaming.BoneSide.Right, ref references.rightThigh, ref references.rightCalf, ref references.rightFoot, componentsInChildren); references.head = BipedNaming.GetBone(componentsInChildren, BipedNaming.BoneType.Head, BipedNaming.BoneSide.Center); references.pelvis = BipedNaming.GetNamingMatch(componentsInChildren, BipedNaming.pelvis); if (((Object)(object)references.pelvis == (Object)null || !Hierarchy.IsAncestor(references.leftThigh, references.pelvis)) && (Object)(object)references.leftThigh != (Object)null) { references.pelvis = references.leftThigh.parent; } if ((Object)(object)references.leftUpperArm != (Object)null && (Object)(object)references.rightUpperArm != (Object)null && (Object)(object)references.pelvis != (Object)null && (Object)(object)references.leftThigh != (Object)null) { Transform firstCommonAncestor = Hierarchy.GetFirstCommonAncestor(references.leftUpperArm, references.rightUpperArm); if ((Object)(object)firstCommonAncestor != (Object)null) { Transform[] array = (Transform[])(object)new Transform[1] { firstCommonAncestor }; Hierarchy.AddAncestors(array[0], references.pelvis, ref array); references.spine = (Transform[])(object)new Transform[0]; for (int num = array.Length - 1; num > -1; num--) { if (AddBoneToSpine(array[num], ref references, autoDetectParams)) { Array.Resize(ref references.spine, references.spine.Length + 1); references.spine[references.spine.Length - 1] = array[num]; } } if ((Object)(object)references.head == (Object)null) { for (int i = 0; i < firstCommonAncestor.childCount; i++) { Transform child = firstCommonAncestor.GetChild(i); if (!Hierarchy.ContainsChild(child, references.leftUpperArm) && !Hierarchy.ContainsChild(child, references.rightUpperArm)) { references.head = child; break; } } } } } Transform[] bonesOfType = BipedNaming.GetBonesOfType(BipedNaming.BoneType.Eye, componentsInChildren); references.eyes = (Transform[])(object)new Transform[0]; if (!autoDetectParams.includeEyes) { return; } for (int j = 0; j < bonesOfType.Length; j++) { if (AddBoneToEyes(bonesOfType[j], ref references, autoDetectParams)) { Array.Resize(ref references.eyes, references.eyes.Length + 1); references.eyes[references.eyes.Length - 1] = bonesOfType[j]; } } } public static void AssignHumanoidReferences(ref BipedReferences references, Animator animator, AutoDetectParams autoDetectParams) { if (references == null) { references = new BipedReferences(); } if (!((Object)(object)animator == (Object)null) && animator.isHuman) { references.spine = (Transform[])(object)new Transform[0]; references.eyes = (Transform[])(object)new Transform[0]; references.head = animator.GetBoneTransform((HumanBodyBones)10); references.leftThigh = animator.GetBoneTransform((HumanBodyBones)1); references.leftCalf = animator.GetBoneTransform((HumanBodyBones)3); references.leftFoot = animator.GetBoneTransform((HumanBodyBones)5); references.rightThigh = animator.GetBoneTransform((HumanBodyBones)2); references.rightCalf = animator.GetBoneTransform((HumanBodyBones)4); references.rightFoot = animator.GetBoneTransform((HumanBodyBones)6); references.leftUpperArm = animator.GetBoneTransform((HumanBodyBones)13); references.leftForearm = animator.GetBoneTransform((HumanBodyBones)15); references.leftHand = animator.GetBoneTransform((HumanBodyBones)17); references.rightUpperArm = animator.GetBoneTransform((HumanBodyBones)14); references.rightForearm = animator.GetBoneTransform((HumanBodyBones)16); references.rightHand = animator.GetBoneTransform((HumanBodyBones)18); references.pelvis = animator.GetBoneTransform((HumanBodyBones)0); AddBoneToHierarchy(ref references.spine, animator.GetBoneTransform((HumanBodyBones)7)); AddBoneToHierarchy(ref references.spine, animator.GetBoneTransform((HumanBodyBones)8)); if ((Object)(object)references.leftUpperArm != (Object)null && !IsNeckBone(animator.GetBoneTransform((HumanBodyBones)9), references.leftUpperArm)) { AddBoneToHierarchy(ref references.spine, animator.GetBoneTransform((HumanBodyBones)9)); } if (autoDetectParams.includeEyes) { AddBoneToHierarchy(ref references.eyes, animator.GetBoneTransform((HumanBodyBones)21)); AddBoneToHierarchy(ref references.eyes, animator.GetBoneTransform((HumanBodyBones)22)); } } } public static bool SetupError(BipedReferences references, ref string errorMessage) { if (!references.isFilled) { errorMessage = "BipedReferences contains one or more missing Transforms."; return true; } if (LimbError(references.leftThigh, references.leftCalf, references.leftFoot, ref errorMessage)) { return true; } if (LimbError(references.rightThigh, references.rightCalf, references.rightFoot, ref errorMessage)) { return true; } if (LimbError(references.leftUpperArm, references.leftForearm, references.leftHand, ref errorMessage)) { return true; } if (LimbError(references.rightUpperArm, references.rightForearm, references.rightHand, ref errorMessage)) { return true; } if (SpineError(references, ref errorMessage)) { return true; } if (EyesError(references, ref errorMessage)) { return true; } return false; } public static bool SetupWarning(BipedReferences references, ref string warningMessage) { if (LimbWarning(references.leftThigh, references.leftCalf, references.leftFoot, ref warningMessage)) { return true; } if (LimbWarning(references.rightThigh, references.rightCalf, references.rightFoot, ref warningMessage)) { return true; } if (LimbWarning(references.leftUpperArm, references.leftForearm, references.leftHand, ref warningMessage)) { return true; } if (LimbWarning(references.rightUpperArm, references.rightForearm, references.rightHand, ref warningMessage)) { return true; } if (SpineWarning(references, ref warningMessage)) { return true; } if (EyesWarning(references, ref warningMessage)) { return true; } if (RootHeightWarning(references, ref warningMessage)) { return true; } if (FacingAxisWarning(references, ref warningMessage)) { return true; } return false; } private static bool IsNeckBone(Transform bone, Transform leftUpperArm) { if ((Object)(object)leftUpperArm.parent != (Object)null && (Object)(object)leftUpperArm.parent == (Object)(object)bone) { return false; } if (Hierarchy.IsAncestor(leftUpperArm, bone)) { return false; } return true; } private static bool AddBoneToEyes(Transform bone, ref BipedReferences references, AutoDetectParams autoDetectParams) { if ((Object)(object)references.head != (Object)null && !Hierarchy.IsAncestor(bone, references.head)) { return false; } if ((Object)(object)((Component)bone).GetComponent() != (Object)null) { return false; } return true; } private static bool AddBoneToSpine(Transform bone, ref BipedReferences references, AutoDetectParams autoDetectParams) { if ((Object)(object)bone == (Object)(object)references.root) { return false; } if ((Object)(object)bone == (Object)(object)references.leftThigh.parent && !autoDetectParams.legsParentInSpine) { return false; } if ((Object)(object)references.pelvis != (Object)null) { if ((Object)(object)bone == (Object)(object)references.pelvis) { return false; } if (Hierarchy.IsAncestor(references.pelvis, bone)) { return false; } } return true; } private static void DetectLimb(BipedNaming.BoneType boneType, BipedNaming.BoneSide boneSide, ref Transform firstBone, ref Transform secondBone, ref Transform lastBone, Transform[] transforms) { Transform[] bonesOfTypeAndSide = BipedNaming.GetBonesOfTypeAndSide(boneType, boneSide, transforms); if (bonesOfTypeAndSide.Length >= 3) { if (bonesOfTypeAndSide.Length == 3) { firstBone = bonesOfTypeAndSide[0]; secondBone = bonesOfTypeAndSide[1]; lastBone = bonesOfTypeAndSide[2]; } if (bonesOfTypeAndSide.Length > 3) { firstBone = bonesOfTypeAndSide[0]; secondBone = bonesOfTypeAndSide[2]; lastBone = bonesOfTypeAndSide[^1]; } } } private static void AddBoneToHierarchy(ref Transform[] bones, Transform transform) { if (!((Object)(object)transform == (Object)null)) { Array.Resize(ref bones, bones.Length + 1); bones[bones.Length - 1] = transform; } } private static bool LimbError(Transform bone1, Transform bone2, Transform bone3, ref string errorMessage) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bone1 == (Object)null) { errorMessage = "Bone 1 of a BipedReferences limb is null."; return true; } if ((Object)(object)bone2 == (Object)null) { errorMessage = "Bone 2 of a BipedReferences limb is null."; return true; } if ((Object)(object)bone3 == (Object)null) { errorMessage = "Bone 3 of a BipedReferences limb is null."; return true; } Transform val = (Transform)Hierarchy.ContainsDuplicate((Object[])(object)new Transform[3] { bone1, bone2, bone3 }); if ((Object)(object)val != (Object)null) { errorMessage = ((Object)val).name + " is represented multiple times in the same BipedReferences limb."; return true; } if (bone2.position == bone1.position) { errorMessage = "Second bone's position equals first bone's position in the biped's limb."; return true; } if (bone3.position == bone2.position) { errorMessage = "Third bone's position equals second bone's position in the biped's limb."; return true; } if (!Hierarchy.HierarchyIsValid((Transform[])(object)new Transform[3] { bone1, bone2, bone3 })) { errorMessage = "BipedReferences limb hierarchy is invalid. Bone transforms in a limb do not belong to the same ancestry. Please make sure the bones are parented to each other. Bones: " + ((Object)bone1).name + ", " + ((Object)bone2).name + ", " + ((Object)bone3).name; return true; } return false; } private static bool LimbWarning(Transform bone1, Transform bone2, Transform bone3, ref string warningMessage) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(bone2.position - bone1.position, bone3.position - bone1.position); if (val == Vector3.zero) { warningMessage = "BipedReferences limb is completely stretched out in the initial pose. IK solver can not calculate the default bend plane for the limb. Please make sure you character's limbs are at least slightly bent in the initial pose. First bone: " + ((Object)bone1).name + ", second bone: " + ((Object)bone2).name + "."; return true; } return false; } private static bool SpineError(BipedReferences references, ref string errorMessage) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) if (references.spine.Length == 0) { return false; } for (int i = 0; i < references.spine.Length; i++) { if ((Object)(object)references.spine[i] == (Object)null) { errorMessage = "BipedReferences spine bone at index " + i + " is null."; return true; } } Transform val = (Transform)Hierarchy.ContainsDuplicate((Object[])(object)references.spine); if ((Object)(object)val != (Object)null) { errorMessage = ((Object)val).name + " is represented multiple times in BipedReferences spine."; return true; } if (!Hierarchy.HierarchyIsValid(references.spine)) { errorMessage = "BipedReferences spine hierarchy is invalid. Bone transforms in the spine do not belong to the same ancestry. Please make sure the bones are parented to each other."; return true; } for (int j = 0; j < references.spine.Length; j++) { bool flag = false; if (j == 0 && references.spine[j].position == references.pelvis.position) { flag = true; } if (j != 0 && references.spine.Length > 1 && references.spine[j].position == references.spine[j - 1].position) { flag = true; } if (flag) { errorMessage = "Biped's spine bone nr " + j + " position is the same as it's parent spine/pelvis bone's position. Please remove this bone from the spine."; return true; } } return false; } private static bool SpineWarning(BipedReferences references, ref string warningMessage) { return false; } private static bool EyesError(BipedReferences references, ref string errorMessage) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown if (references.eyes.Length == 0) { return false; } for (int i = 0; i < references.eyes.Length; i++) { if ((Object)(object)references.eyes[i] == (Object)null) { errorMessage = "BipedReferences eye bone at index " + i + " is null."; return true; } } Transform val = (Transform)Hierarchy.ContainsDuplicate((Object[])(object)references.eyes); if ((Object)(object)val != (Object)null) { errorMessage = ((Object)val).name + " is represented multiple times in BipedReferences eyes."; return true; } return false; } private static bool EyesWarning(BipedReferences references, ref string warningMessage) { return false; } private static bool RootHeightWarning(BipedReferences references, ref string warningMessage) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)references.head == (Object)null) { return false; } float verticalOffset = GetVerticalOffset(references.head.position, references.leftFoot.position, references.root.rotation); float verticalOffset2 = GetVerticalOffset(references.root.position, references.leftFoot.position, references.root.rotation); if (verticalOffset2 / verticalOffset > 0.2f) { warningMessage = "Biped's root Transform's position should be at ground level relative to the character (at the character's feet not at it's pelvis)."; return true; } return false; } private static bool FacingAxisWarning(BipedReferences references, ref string warningMessage) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = references.rightHand.position - references.leftHand.position; Vector3 val2 = references.rightFoot.position - references.leftFoot.position; float num = Vector3.Dot(((Vector3)(ref val)).normalized, references.root.right); float num2 = Vector3.Dot(((Vector3)(ref val2)).normalized, references.root.right); if (num < 0f || num2 < 0f) { warningMessage = "Biped does not seem to be facing it's forward axis. Please make sure that in the initial pose the character is facing towards the positive Z axis of the Biped root gameobject."; return true; } return false; } private static float GetVerticalOffset(Vector3 p1, Vector3 p2, Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return (Quaternion.Inverse(rotation) * (p1 - p2)).y; } } public class Comments : MonoBehaviour { [Multiline] public string text; } public class DemoGUIMessage : MonoBehaviour { public string text; public Color color = Color.white; private void OnGUI() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) GUI.color = color; GUILayout.Label(text, (GUILayoutOption[])(object)new GUILayoutOption[0]); GUI.color = Color.white; } } public class Hierarchy { public static bool HierarchyIsValid(Transform[] bones) { for (int i = 1; i < bones.Length; i++) { if (!IsAncestor(bones[i], bones[i - 1])) { return false; } } return true; } public static Object ContainsDuplicate(Object[] objects) { for (int i = 0; i < objects.Length; i++) { for (int j = 0; j < objects.Length; j++) { if (i != j && objects[i] == objects[j]) { return objects[i]; } } } return null; } public static bool IsAncestor(Transform transform, Transform ancestor) { if ((Object)(object)transform == (Object)null) { return true; } if ((Object)(object)ancestor == (Object)null) { return true; } if ((Object)(object)transform.parent == (Object)null) { return false; } if ((Object)(object)transform.parent == (Object)(object)ancestor) { return true; } return IsAncestor(transform.parent, ancestor); } public static bool ContainsChild(Transform transform, Transform child) { if ((Object)(object)transform == (Object)(object)child) { return true; } Transform[] componentsInChildren = ((Component)transform).GetComponentsInChildren(); Transform[] array = componentsInChildren; foreach (Transform val in array) { if ((Object)(object)val == (Object)(object)child) { return true; } } return false; } public static void AddAncestors(Transform transform, Transform blocker, ref Transform[] array) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)transform.parent != (Object)null && (Object)(object)transform.parent != (Object)(object)blocker) { if (transform.parent.position != transform.position && transform.parent.position != blocker.position) { Array.Resize(ref array, array.Length + 1); array[array.Length - 1] = transform.parent; } AddAncestors(transform.parent, blocker, ref array); } } public static Transform GetAncestor(Transform transform, int minChildCount) { if ((Object)(object)transform == (Object)null) { return null; } if ((Object)(object)transform.parent != (Object)null) { if (transform.parent.childCount >= minChildCount) { return transform.parent; } return GetAncestor(transform.parent, minChildCount); } return null; } public static Transform GetFirstCommonAncestor(Transform t1, Transform t2) { if ((Object)(object)t1 == (Object)null) { return null; } if ((Object)(object)t2 == (Object)null) { return null; } if ((Object)(object)t1.parent == (Object)null) { return null; } if ((Object)(object)t2.parent == (Object)null) { return null; } if (IsAncestor(t2, t1.parent)) { return t1.parent; } return GetFirstCommonAncestor(t1.parent, t2); } public static Transform GetFirstCommonAncestor(Transform[] transforms) { if (transforms == null) { Debug.LogWarning((object)"Transforms is null."); return null; } if (transforms.Length == 0) { Debug.LogWarning((object)"Transforms.Length is 0."); return null; } for (int i = 0; i < transforms.Length; i++) { if ((Object)(object)transforms[i] == (Object)null) { return null; } if (IsCommonAncestor(transforms[i], transforms)) { return transforms[i]; } } return GetFirstCommonAncestorRecursive(transforms[0], transforms); } public static Transform GetFirstCommonAncestorRecursive(Transform transform, Transform[] transforms) { if ((Object)(object)transform == (Object)null) { Debug.LogWarning((object)"Transform is null."); return null; } if (transforms == null) { Debug.LogWarning((object)"Transforms is null."); return null; } if (transforms.Length == 0) { Debug.LogWarning((object)"Transforms.Length is 0."); return null; } if (IsCommonAncestor(transform, transforms)) { return transform; } if ((Object)(object)transform.parent == (Object)null) { return null; } return GetFirstCommonAncestorRecursive(transform.parent, transforms); } public static bool IsCommonAncestor(Transform transform, Transform[] transforms) { if ((Object)(object)transform == (Object)null) { Debug.LogWarning((object)"Transform is null."); return false; } for (int i = 0; i < transforms.Length; i++) { if ((Object)(object)transforms[i] == (Object)null) { Debug.Log((object)("Transforms[" + i + "] is null.")); return false; } if (!IsAncestor(transforms[i], transform) && (Object)(object)transforms[i] != (Object)(object)transform) { return false; } } return true; } } public class InspectorComment : PropertyAttribute { public string name; public string color = "white"; public InspectorComment(string name) { this.name = name; color = "white"; } public InspectorComment(string name, string color) { this.name = name; this.color = color; } } [Serializable] public enum InterpolationMode { None, InOutCubic, InOutQuintic, InOutSine, InQuintic, InQuartic, InCubic, InQuadratic, InElastic, InElasticSmall, InElasticBig, InSine, InBack, OutQuintic, OutQuartic, OutCubic, OutInCubic, OutInQuartic, OutElastic, OutElasticSmall, OutElasticBig, OutSine, OutBack, OutBackCubic, OutBackQuartic, BackInCubic, BackInQuartic } public class Interp { public static float Float(float t, InterpolationMode mode) { float num = 0f; return mode switch { InterpolationMode.None => None(t, 0f, 1f), InterpolationMode.InOutCubic => InOutCubic(t, 0f, 1f), InterpolationMode.InOutQuintic => InOutQuintic(t, 0f, 1f), InterpolationMode.InQuintic => InQuintic(t, 0f, 1f), InterpolationMode.InQuartic => InQuartic(t, 0f, 1f), InterpolationMode.InCubic => InCubic(t, 0f, 1f), InterpolationMode.InQuadratic => InQuadratic(t, 0f, 1f), InterpolationMode.OutQuintic => OutQuintic(t, 0f, 1f), InterpolationMode.OutQuartic => OutQuartic(t, 0f, 1f), InterpolationMode.OutCubic => OutCubic(t, 0f, 1f), InterpolationMode.OutInCubic => OutInCubic(t, 0f, 1f), InterpolationMode.OutInQuartic => OutInCubic(t, 0f, 1f), InterpolationMode.BackInCubic => BackInCubic(t, 0f, 1f), InterpolationMode.BackInQuartic => BackInQuartic(t, 0f, 1f), InterpolationMode.OutBackCubic => OutBackCubic(t, 0f, 1f), InterpolationMode.OutBackQuartic => OutBackQuartic(t, 0f, 1f), InterpolationMode.OutElasticSmall => OutElasticSmall(t, 0f, 1f), InterpolationMode.OutElasticBig => OutElasticBig(t, 0f, 1f), InterpolationMode.InElasticSmall => InElasticSmall(t, 0f, 1f), InterpolationMode.InElasticBig => InElasticBig(t, 0f, 1f), InterpolationMode.InSine => InSine(t, 0f, 1f), InterpolationMode.OutSine => OutSine(t, 0f, 1f), InterpolationMode.InOutSine => InOutSine(t, 0f, 1f), InterpolationMode.InElastic => OutElastic(t, 0f, 1f), InterpolationMode.OutElastic => OutElastic(t, 0f, 1f), InterpolationMode.InBack => InBack(t, 0f, 1f), InterpolationMode.OutBack => OutBack(t, 0f, 1f), _ => 0f, }; } public static Vector3 V3(Vector3 v1, Vector3 v2, float t, InterpolationMode mode) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) float num = Float(t, mode); return (1f - num) * v1 + num * v2; } public static float LerpValue(float value, float target, float increaseSpeed, float decreaseSpeed) { if (value == target) { return target; } if (value < target) { return Mathf.Clamp(value + Time.deltaTime * increaseSpeed, float.NegativeInfinity, target); } return Mathf.Clamp(value - Time.deltaTime * decreaseSpeed, target, float.PositiveInfinity); } private static float None(float t, float b, float c) { return b + c * t; } private static float InOutCubic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (-2f * num2 + 3f * num); } private static float InOutQuintic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (6f * num2 * num + -15f * num * num + 10f * num2); } private static float InQuintic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (num2 * num); } private static float InQuartic(float t, float b, float c) { float num = t * t; return b + c * (num * num); } private static float InCubic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * num2; } private static float InQuadratic(float t, float b, float c) { float num = t * t; return b + c * num; } private static float OutQuintic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (num2 * num + -5f * num * num + 10f * num2 + -10f * num + 5f * t); } private static float OutQuartic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (-1f * num * num + 4f * num2 + -6f * num + 4f * t); } private static float OutCubic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (num2 + -3f * num + 3f * t); } private static float OutInCubic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (4f * num2 + -6f * num + 3f * t); } private static float OutInQuartic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (6f * num2 + -9f * num + 4f * t); } private static float BackInCubic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (4f * num2 + -3f * num); } private static float BackInQuartic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (2f * num * num + 2f * num2 + -3f * num); } private static float OutBackCubic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (4f * num2 + -9f * num + 6f * t); } private static float OutBackQuartic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (-2f * num * num + 10f * num2 + -15f * num + 8f * t); } private static float OutElasticSmall(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (33f * num2 * num + -106f * num * num + 126f * num2 + -67f * num + 15f * t); } private static float OutElasticBig(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (56f * num2 * num + -175f * num * num + 200f * num2 + -100f * num + 20f * t); } private static float InElasticSmall(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (33f * num2 * num + -59f * num * num + 32f * num2 + -5f * num); } private static float InElasticBig(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (56f * num2 * num + -105f * num * num + 60f * num2 + -10f * num); } private static float InSine(float t, float b, float c) { c -= b; return (0f - c) * Mathf.Cos(t / 1f * ((float)Math.PI / 2f)) + c + b; } private static float OutSine(float t, float b, float c) { c -= b; return c * Mathf.Sin(t / 1f * ((float)Math.PI / 2f)) + b; } private static float InOutSine(float t, float b, float c) { c -= b; return (0f - c) / 2f * (Mathf.Cos((float)Math.PI * t / 1f) - 1f) + b; } private static float InElastic(float t, float b, float c) { c -= b; float num = 1f; float num2 = num * 0.3f; float num3 = 0f; float num4 = 0f; if (t == 0f) { return b; } if ((t /= num) == 1f) { return b + c; } if (num4 == 0f || num4 < Mathf.Abs(c)) { num4 = c; num3 = num2 / 4f; } else { num3 = num2 / ((float)Math.PI * 2f) * Mathf.Asin(c / num4); } return 0f - num4 * Mathf.Pow(2f, 10f * (t -= 1f)) * Mathf.Sin((t * num - num3) * ((float)Math.PI * 2f) / num2) + b; } private static float OutElastic(float t, float b, float c) { c -= b; float num = 1f; float num2 = num * 0.3f; float num3 = 0f; float num4 = 0f; if (t == 0f) { return b; } if ((t /= num) == 1f) { return b + c; } if (num4 == 0f || num4 < Mathf.Abs(c)) { num4 = c; num3 = num2 / 4f; } else { num3 = num2 / ((float)Math.PI * 2f) * Mathf.Asin(c / num4); } return num4 * Mathf.Pow(2f, -10f * t) * Mathf.Sin((t * num - num3) * ((float)Math.PI * 2f) / num2) + c + b; } private static float InBack(float t, float b, float c) { c -= b; t /= 1f; float num = 1.70158f; return c * t * t * ((num + 1f) * t - num) + b; } private static float OutBack(float t, float b, float c) { float num = 1.70158f; c -= b; t = t / 1f - 1f; return c * (t * t * ((num + 1f) * t + num) + 1f) + b; } } public class LargeHeader : PropertyAttribute { public string name; public string color = "white"; public LargeHeader(string name) { this.name = name; color = "white"; } public LargeHeader(string name, string color) { this.name = name; this.color = color; } } public static class LayerMaskExtensions { public static bool Contains(LayerMask mask, int layer) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return LayerMask.op_Implicit(mask) == (LayerMask.op_Implicit(mask) | (1 << layer)); } public static LayerMask Create(params string[] layerNames) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return NamesToMask(layerNames); } public static LayerMask Create(params int[] layerNumbers) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return LayerNumbersToMask(layerNumbers); } public static LayerMask NamesToMask(params string[] layerNames) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) LayerMask val = LayerMask.op_Implicit(0); foreach (string text in layerNames) { val = LayerMask.op_Implicit(LayerMask.op_Implicit(val) | (1 << LayerMask.NameToLayer(text))); } return val; } public static LayerMask LayerNumbersToMask(params int[] layerNumbers) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) LayerMask val = LayerMask.op_Implicit(0); foreach (int num in layerNumbers) { val = LayerMask.op_Implicit(LayerMask.op_Implicit(val) | (1 << num)); } return val; } public static LayerMask Inverse(this LayerMask original) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return LayerMask.op_Implicit(~LayerMask.op_Implicit(original)); } public static LayerMask AddToMask(this LayerMask original, params string[] layerNames) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) return LayerMask.op_Implicit(LayerMask.op_Implicit(original) | LayerMask.op_Implicit(NamesToMask(layerNames))); } public static LayerMask RemoveFromMask(this LayerMask original, params string[] layerNames) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) LayerMask val = LayerMask.op_Implicit(~LayerMask.op_Implicit(original)); return LayerMask.op_Implicit(~(LayerMask.op_Implicit(val) | LayerMask.op_Implicit(NamesToMask(layerNames)))); } public static string[] MaskToNames(this LayerMask original) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < 32; i++) { int num = 1 << i; if ((LayerMask.op_Implicit(original) & num) == num) { string text = LayerMask.LayerToName(i); if (!string.IsNullOrEmpty(text)) { list.Add(text); } } } return list.ToArray(); } public static int[] MaskToNumbers(this LayerMask original) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < 32; i++) { int num = 1 << i; if ((LayerMask.op_Implicit(original) & num) == num) { list.Add(i); } } return list.ToArray(); } public static string MaskToString(this LayerMask original) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return original.MaskToString(", "); } public static string MaskToString(this LayerMask original, string delimiter) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return string.Join(delimiter, original.MaskToNames()); } } } namespace RootMotion.Demos { [Serializable] public class Navigator { public enum State { Idle, Seeking, OnPath } [Tooltip("Should this Navigator be actively seeking a path.")] public bool activeTargetSeeking; [Tooltip("Increase this value if the character starts running in a circle, not able to reach the corner because of a too large turning radius.")] public float cornerRadius = 0.5f; [Tooltip("Recalculate path if target position has moved by this distance from the position it was at when the path was originally calculated")] public float recalculateOnPathDistance = 1f; [Tooltip("Sample within this distance from sourcePosition.")] public float maxSampleDistance = 5f; [Tooltip("Interval of updating the path")] public float nextPathInterval = 3f; private Transform transform; private int cornerIndex; private Vector3[] corners = (Vector3[])(object)new Vector3[0]; private NavMeshPath path; private Vector3 lastTargetPosition; private bool initiated; private float nextPathTime; public Vector3 normalizedDeltaPosition { get; private set; } public State state { get; private set; } public void Initiate(Transform transform) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) this.transform = transform; path = new NavMeshPath(); initiated = true; cornerIndex = 0; corners = (Vector3[])(object)new Vector3[0]; state = State.Idle; lastTargetPosition = new Vector3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity); } public void Update(Vector3 targetPosition) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Invalid comparison between Unknown and I4 //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { Debug.LogError((object)"Trying to update an uninitiated Navigator."); return; } switch (state) { case State.Seeking: normalizedDeltaPosition = Vector3.zero; if ((int)path.status == 0) { corners = path.corners; cornerIndex = 0; if (corners.Length == 0) { Debug.LogWarning((object)"Zero Corner Path", (Object)(object)transform); Stop(); } else { state = State.OnPath; } } if ((int)path.status == 1) { Debug.LogWarning((object)"Path Partial", (Object)(object)transform); } if ((int)path.status == 2) { Debug.LogWarning((object)"Path Invalid", (Object)(object)transform); } break; case State.OnPath: if (activeTargetSeeking && Time.time > nextPathTime && HorDistance(targetPosition, lastTargetPosition) > recalculateOnPathDistance) { CalculatePath(targetPosition); } else { if (cornerIndex >= corners.Length) { break; } Vector3 val = corners[cornerIndex] - transform.position; val.y = 0f; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude > 0f) { normalizedDeltaPosition = val / ((Vector3)(ref val)).magnitude; } else { normalizedDeltaPosition = Vector3.zero; } if (magnitude < cornerRadius) { cornerIndex++; if (cornerIndex >= corners.Length) { Stop(); } } } break; case State.Idle: if (activeTargetSeeking && Time.time > nextPathTime) { CalculatePath(targetPosition); } break; } } private void CalculatePath(Vector3 targetPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (Find(targetPosition)) { lastTargetPosition = targetPosition; state = State.Seeking; } else { Stop(); } nextPathTime = Time.time + nextPathInterval; } private bool Find(Vector3 targetPosition) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if (HorDistance(transform.position, targetPosition) < cornerRadius * 2f) { return false; } if (NavMesh.CalculatePath(transform.position, targetPosition, -1, path)) { return true; } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(targetPosition, ref val, maxSampleDistance, -1) && NavMesh.CalculatePath(transform.position, ((NavMeshHit)(ref val)).position, -1, path)) { return true; } return false; } private void Stop() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) state = State.Idle; normalizedDeltaPosition = Vector3.zero; } private float HorDistance(Vector3 p1, Vector3 p2) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) return Vector2.Distance(new Vector2(p1.x, p1.z), new Vector2(p2.x, p2.z)); } public void Visualize() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) if (state == State.Idle) { Gizmos.color = Color.gray; } if (state == State.Seeking) { Gizmos.color = Color.red; } if (state == State.OnPath) { Gizmos.color = Color.green; } if (corners.Length > 0 && state == State.OnPath && cornerIndex == 0) { Gizmos.DrawLine(transform.position, corners[0]); } for (int i = 0; i < corners.Length; i++) { Gizmos.DrawSphere(corners[i], 0.1f); } if (corners.Length > 1) { for (int j = 0; j < corners.Length - 1; j++) { Gizmos.DrawLine(corners[j], corners[j + 1]); } } Gizmos.color = Color.white; } } } namespace RootMotion1 { public static class QuaTools { public static float GetYaw(Quaternion space, Vector3 forward) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Quaternion.Inverse(space) * forward; return Mathf.Atan2(val.x, val.z) * 57.29578f; } public static float GetPitch(Quaternion space, Vector3 forward) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) forward = ((Vector3)(ref forward)).normalized; return (0f - Mathf.Asin((Quaternion.Inverse(space) * forward).y)) * 57.29578f; } public static float GetBank(Quaternion space, Vector3 forward, Vector3 up) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = space * Vector3.up; Quaternion val2 = Quaternion.Inverse(space); forward = val2 * forward; up = val2 * up; Quaternion val3 = Quaternion.Inverse(Quaternion.LookRotation(val, forward)); up = val3 * up; return Mathf.Atan2(up.x, up.z) * 57.29578f; } public static float GetYaw(Quaternion space, Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Quaternion.Inverse(space) * (rotation * Vector3.forward); return Mathf.Atan2(val.x, val.z) * 57.29578f; } public static float GetPitch(Quaternion space, Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) return (0f - Mathf.Asin((Quaternion.Inverse(space) * (rotation * Vector3.forward)).y)) * 57.29578f; } public static float GetBank(Quaternion space, Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = space * Vector3.up; Quaternion val2 = Quaternion.Inverse(space); Vector3 val3 = val2 * (rotation * Vector3.forward); Vector3 val4 = val2 * (rotation * Vector3.up); Quaternion val5 = Quaternion.Inverse(Quaternion.LookRotation(val, val3)); val4 = val5 * val4; return Mathf.Atan2(val4.x, val4.z) * 57.29578f; } public static Quaternion Lerp(Quaternion fromRotation, Quaternion toRotation, float weight) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return fromRotation; } if (weight >= 1f) { return toRotation; } return Quaternion.Lerp(fromRotation, toRotation, weight); } public static Quaternion Slerp(Quaternion fromRotation, Quaternion toRotation, float weight) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return fromRotation; } if (weight >= 1f) { return toRotation; } return Quaternion.Slerp(fromRotation, toRotation, weight); } public static Quaternion LinearBlend(Quaternion q, float weight) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return Quaternion.identity; } if (weight >= 1f) { return q; } return Quaternion.Lerp(Quaternion.identity, q, weight); } public static Quaternion SphericalBlend(Quaternion q, float weight) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return Quaternion.identity; } if (weight >= 1f) { return q; } return Quaternion.Slerp(Quaternion.identity, q, weight); } public static Quaternion FromToAroundAxis(Vector3 fromDirection, Vector3 toDirection, Vector3 axis) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(fromDirection, toDirection); float num = 0f; Vector3 zero = Vector3.zero; ((Quaternion)(ref val)).ToAngleAxis(ref num, ref zero); float num2 = Vector3.Dot(zero, axis); if (num2 < 0f) { num = 0f - num; } return Quaternion.AngleAxis(num, axis); } public static Quaternion RotationToLocalSpace(Quaternion space, Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) return Quaternion.Inverse(Quaternion.Inverse(space) * rotation); } public static Quaternion FromToRotation(Quaternion from, Quaternion to) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (to == from) { return Quaternion.identity; } return to * Quaternion.Inverse(from); } public static Vector3 GetAxis(Vector3 v) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.right; bool flag = false; float num = Vector3.Dot(v, Vector3.right); float num2 = Mathf.Abs(num); if (num < 0f) { flag = true; } float num3 = Vector3.Dot(v, Vector3.up); float num4 = Mathf.Abs(num3); if (num4 > num2) { num2 = num4; val = Vector3.up; flag = num3 < 0f; } float num5 = Vector3.Dot(v, Vector3.forward); num4 = Mathf.Abs(num5); if (num4 > num2) { val = Vector3.forward; flag = num5 < 0f; } if (flag) { val = -val; } return val; } public static Quaternion ClampRotation(Quaternion rotation, float clampWeight, int clampSmoothing) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if (clampWeight >= 1f) { return Quaternion.identity; } if (clampWeight <= 0f) { return rotation; } float num = Quaternion.Angle(Quaternion.identity, rotation); float num2 = 1f - num / 180f; float num3 = Mathf.Clamp(1f - (clampWeight - num2) / (1f - num2), 0f, 1f); float num4 = Mathf.Clamp(num2 / clampWeight, 0f, 1f); for (int i = 0; i < clampSmoothing; i++) { float num5 = num4 * (float)Math.PI * 0.5f; num4 = Mathf.Sin(num5); } return Quaternion.Slerp(Quaternion.identity, rotation, num4 * num3); } public static float ClampAngle(float angle, float clampWeight, int clampSmoothing) { if (clampWeight >= 1f) { return 0f; } if (clampWeight <= 0f) { return angle; } float num = 1f - Mathf.Abs(angle) / 180f; float num2 = Mathf.Clamp(1f - (clampWeight - num) / (1f - num), 0f, 1f); float num3 = Mathf.Clamp(num / clampWeight, 0f, 1f); for (int i = 0; i < clampSmoothing; i++) { float num4 = num3 * (float)Math.PI * 0.5f; num3 = Mathf.Sin(num4); } return Mathf.Lerp(0f, angle, num3 * num2); } public static Quaternion MatchRotation(Quaternion targetRotation, Vector3 targetforwardAxis, Vector3 targetUpAxis, Vector3 forwardAxis, Vector3 upAxis) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.LookRotation(forwardAxis, upAxis); Quaternion val2 = Quaternion.LookRotation(targetforwardAxis, targetUpAxis); Quaternion val3 = targetRotation * val2; return val3 * Quaternion.Inverse(val); } public static Vector3 ToBiPolar(Vector3 euler) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) return new Vector3(ToBiPolar(euler.x), ToBiPolar(euler.y), ToBiPolar(euler.z)); } public static float ToBiPolar(float angle) { angle %= 360f; if (angle >= 180f) { return angle - 360f; } if (angle <= -180f) { return angle + 360f; } return angle; } } public abstract class Singleton : MonoBehaviour where T : Singleton { private static T sInstance = (T)null; public static T instance => sInstance; protected virtual void Awake() { if ((Object)(object)sInstance != (Object)null) { Debug.LogError((object)(((Object)this).name + "error: already initialized"), (Object)(object)this); } sInstance = (T)this; } } public class SolverManager : MonoBehaviour { [Tooltip("If true, will fix all the Transforms used by the solver to their initial state in each Update. This prevents potential problems with unanimated bones and animator culling with a small cost of performance. Not recommended for CCD and FABRIK solvers.")] public bool fixTransforms = true; private Animator animator; private Animation legacy; private bool updateFrame; private bool componentInitiated; private bool skipSolverUpdate; private bool animatePhysics { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 if ((Object)(object)animator != (Object)null) { return (int)animator.updateMode == 1; } if ((Object)(object)legacy != (Object)null) { return legacy.animatePhysics; } return false; } } private bool isAnimated => (Object)(object)animator != (Object)null || (Object)(object)legacy != (Object)null; public void Disable() { Debug.Log((object)"IK.Disable() is deprecated. Use enabled = false instead", (Object)(object)((Component)this).transform); ((Behaviour)this).enabled = false; } protected virtual void InitiateSolver() { } protected virtual void UpdateSolver() { } protected virtual void FixTransforms() { } private void OnDisable() { if (Application.isPlaying) { Initiate(); } } private void Start() { Initiate(); } private void Initiate() { if (!componentInitiated) { FindAnimatorRecursive(((Component)this).transform, findInChildren: true); InitiateSolver(); componentInitiated = true; } } private void Update() { if (!skipSolverUpdate && !animatePhysics && fixTransforms) { FixTransforms(); } } private void FindAnimatorRecursive(Transform t, bool findInChildren) { if (isAnimated) { return; } animator = ((Component)t).GetComponent(); legacy = ((Component)t).GetComponent(); if (!isAnimated) { if ((Object)(object)animator == (Object)null && findInChildren) { animator = ((Component)t).GetComponentInChildren(); } if ((Object)(object)legacy == (Object)null && findInChildren) { legacy = ((Component)t).GetComponentInChildren(); } if (!isAnimated && (Object)(object)t.parent != (Object)null) { FindAnimatorRecursive(t.parent, findInChildren: false); } } } private void FixedUpdate() { if (skipSolverUpdate) { skipSolverUpdate = false; } updateFrame = true; if (animatePhysics && fixTransforms) { FixTransforms(); } } private void LateUpdate() { if (!skipSolverUpdate) { if (!animatePhysics) { updateFrame = true; } if (updateFrame) { updateFrame = false; UpdateSolver(); } } } public void UpdateSolverExternal() { if (((Behaviour)this).enabled) { skipSolverUpdate = true; UpdateSolver(); } } } public class TriggerEventBroadcaster : MonoBehaviour { public GameObject target; private void OnTriggerEnter(Collider collider) { if ((Object)(object)target != (Object)null) { target.SendMessage("OnTriggerEnter", (object)collider, (SendMessageOptions)1); } } private void OnTriggerStay(Collider collider) { if ((Object)(object)target != (Object)null) { target.SendMessage("OnTriggerStay", (object)collider, (SendMessageOptions)1); } } private void OnTriggerExit(Collider collider) { if ((Object)(object)target != (Object)null) { target.SendMessage("OnTriggerExit", (object)collider, (SendMessageOptions)1); } } } public static class V2Tools { public static Vector2 XZ(Vector3 v) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return new Vector2(v.x, v.z); } public static float DeltaAngle(Vector2 dir1, Vector2 dir2) { float num = Mathf.Atan2(dir1.x, dir1.y) * 57.29578f; float num2 = Mathf.Atan2(dir2.x, dir2.y) * 57.29578f; return Mathf.DeltaAngle(num, num2); } public static float DeltaAngleXZ(Vector3 dir1, Vector3 dir2) { float num = Mathf.Atan2(dir1.x, dir1.z) * 57.29578f; float num2 = Mathf.Atan2(dir2.x, dir2.z) * 57.29578f; return Mathf.DeltaAngle(num, num2); } public static bool LineCircleIntersect(Vector2 p1, Vector2 p2, Vector2 c, float r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Vector2 val = p2 - p1; Vector2 val2 = c - p1; float num = Vector2.Dot(val, val); float num2 = 2f * Vector2.Dot(val2, val); float num3 = Vector2.Dot(val2, val2) - r * r; float num4 = num2 * num2 - 4f * num * num3; if (num4 < 0f) { return false; } num4 = Mathf.Sqrt(num4); float num5 = 2f * num; float num6 = (num2 - num4) / num5; float num7 = (num2 + num4) / num5; if (num6 >= 0f && num6 <= 1f) { return true; } if (num7 >= 0f && num7 <= 1f) { return true; } return false; } public static bool RayCircleIntersect(Vector2 p1, Vector2 dir, Vector2 c, float r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Vector2 val = p1 + dir; p1 -= c; val -= c; float num = val.x - p1.x; float num2 = val.y - p1.y; float num3 = Mathf.Sqrt(Mathf.Pow(num, 2f) + Mathf.Pow(num2, 2f)); float num4 = p1.x * val.y - val.x * p1.y; float num5 = Mathf.Pow(r, 2f) * Mathf.Pow(num3, 2f) - Mathf.Pow(num4, 2f); return num5 >= 0f; } } public static class V3Tools { public static float GetYaw(Vector3 forward) { return Mathf.Atan2(forward.x, forward.z) * 57.29578f; } public static float GetPitch(Vector3 forward) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) forward = ((Vector3)(ref forward)).normalized; return (0f - Mathf.Asin(forward.y)) * 57.29578f; } public static float GetBank(Vector3 forward, Vector3 up) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.Inverse(Quaternion.LookRotation(Vector3.up, forward)); up = val * up; return Mathf.Atan2(up.x, up.z) * 57.29578f; } public static float GetYaw(Vector3 spaceForward, Vector3 spaceUp, Vector3 forward) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.Inverse(Quaternion.LookRotation(spaceForward, spaceUp)); Vector3 val2 = val * forward; return Mathf.Atan2(val2.x, val2.z) * 57.29578f; } public static float GetPitch(Vector3 spaceForward, Vector3 spaceUp, Vector3 forward) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.Inverse(Quaternion.LookRotation(spaceForward, spaceUp)); return (0f - Mathf.Asin((val * forward).y)) * 57.29578f; } public static float GetBank(Vector3 spaceForward, Vector3 spaceUp, Vector3 forward, Vector3 up) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.Inverse(Quaternion.LookRotation(spaceForward, spaceUp)); forward = val * forward; up = val * up; Quaternion val2 = Quaternion.Inverse(Quaternion.LookRotation(spaceUp, forward)); up = val2 * up; return Mathf.Atan2(up.x, up.z) * 57.29578f; } public static Vector3 Lerp(Vector3 fromVector, Vector3 toVector, float weight) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return fromVector; } if (weight >= 1f) { return toVector; } return Vector3.Lerp(fromVector, toVector, weight); } public static Vector3 Slerp(Vector3 fromVector, Vector3 toVector, float weight) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return fromVector; } if (weight >= 1f) { return toVector; } return Vector3.Slerp(fromVector, toVector, weight); } public static Vector3 ExtractVertical(Vector3 v, Vector3 verticalAxis, float weight) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (weight == 0f) { return Vector3.zero; } return Vector3.Project(v, verticalAxis) * weight; } public static Vector3 ExtractHorizontal(Vector3 v, Vector3 normal, float weight) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (weight == 0f) { return Vector3.zero; } Vector3 val = v; Vector3.OrthoNormalize(ref normal, ref val); return Vector3.Project(v, val) * weight; } public static Vector3 ClampDirection(Vector3 direction, Vector3 normalDirection, float clampWeight, int clampSmoothing) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) if (clampWeight <= 0f) { return direction; } if (clampWeight >= 1f) { return normalDirection; } float num = Vector3.Angle(normalDirection, direction); float num2 = 1f - num / 180f; if (num2 > clampWeight) { return direction; } float num3 = ((!(clampWeight > 0f)) ? 1f : Mathf.Clamp(1f - (clampWeight - num2) / (1f - num2), 0f, 1f)); float num4 = ((!(clampWeight > 0f)) ? 1f : Mathf.Clamp(num2 / clampWeight, 0f, 1f)); for (int i = 0; i < clampSmoothing; i++) { float num5 = num4 * (float)Math.PI * 0.5f; num4 = Mathf.Sin(num5); } return Vector3.Slerp(normalDirection, direction, num4 * num3); } public static Vector3 ClampDirection(Vector3 direction, Vector3 normalDirection, float clampWeight, int clampSmoothing, out bool changed) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) changed = false; if (clampWeight <= 0f) { return direction; } if (clampWeight >= 1f) { changed = true; return normalDirection; } float num = Vector3.Angle(normalDirection, direction); float num2 = 1f - num / 180f; if (num2 > clampWeight) { return direction; } changed = true; float num3 = ((!(clampWeight > 0f)) ? 1f : Mathf.Clamp(1f - (clampWeight - num2) / (1f - num2), 0f, 1f)); float num4 = ((!(clampWeight > 0f)) ? 1f : Mathf.Clamp(num2 / clampWeight, 0f, 1f)); for (int i = 0; i < clampSmoothing; i++) { float num5 = num4 * (float)Math.PI * 0.5f; num4 = Mathf.Sin(num5); } return Vector3.Slerp(normalDirection, direction, num4 * num3); } public static Vector3 ClampDirection(Vector3 direction, Vector3 normalDirection, float clampWeight, int clampSmoothing, out float clampValue) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) clampValue = 1f; if (clampWeight <= 0f) { return direction; } if (clampWeight >= 1f) { return normalDirection; } float num = Vector3.Angle(normalDirection, direction); float num2 = 1f - num / 180f; if (num2 > clampWeight) { clampValue = 0f; return direction; } float num3 = ((!(clampWeight > 0f)) ? 1f : Mathf.Clamp(1f - (clampWeight - num2) / (1f - num2), 0f, 1f)); float num4 = ((!(clampWeight > 0f)) ? 1f : Mathf.Clamp(num2 / clampWeight, 0f, 1f)); for (int i = 0; i < clampSmoothing; i++) { float num5 = num4 * (float)Math.PI * 0.5f; num4 = Mathf.Sin(num5); } float num6 = num4 * num3; clampValue = 1f - num6; return Vector3.Slerp(normalDirection, direction, num6); } public static Vector3 LineToPlane(Vector3 origin, Vector3 direction, Vector3 planeNormal, Vector3 planePoint) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Dot(planePoint - origin, planeNormal); float num2 = Vector3.Dot(direction, planeNormal); if (num2 == 0f) { return Vector3.zero; } float num3 = num / num2; return origin + ((Vector3)(ref direction)).normalized * num3; } public static Vector3 PointToPlane(Vector3 point, Vector3 planePosition, Vector3 planeNormal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (planeNormal == Vector3.up) { return new Vector3(point.x, planePosition.y, point.z); } Vector3 val = point - planePosition; Vector3 val2 = planeNormal; Vector3.OrthoNormalize(ref val2, ref val); return planePosition + Vector3.Project(point - planePosition, val); } public static Vector3 TransformPointUnscaled(Transform t, Vector3 point) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) return t.position + t.rotation * point; } public static Vector3 InverseTransformPointUnscaled(Transform t, Vector3 point) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) return Quaternion.Inverse(t.rotation) * (point - t.position); } public static Vector3 InverseTransformPoint(Vector3 tPos, Quaternion tRot, Vector3 tScale, Vector3 point) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) return Div(Quaternion.Inverse(tRot) * (point - tPos), tScale); } public static Vector3 TransformPoint(Vector3 tPos, Quaternion tRot, Vector3 tScale, Vector3 point) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return tPos + Vector3.Scale(tRot * point, tScale); } public static Vector3 Div(Vector3 v1, Vector3 v2) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) return new Vector3(v1.x / v2.x, v1.y / v2.y, v1.z / v2.z); } } public static class Warning { public delegate void Logger(string message); public static bool logged; public static void Log(string message, Logger logger, bool logInEditMode = false) { if ((logInEditMode || Application.isPlaying) && !logged) { logger?.Invoke(message); logged = true; } } public static void Log(string message, Transform context, bool logInEditMode = false) { if ((logInEditMode || Application.isPlaying) && !logged) { Debug.LogWarning((object)message, (Object)(object)context); logged = true; } } } } namespace JerryComponent { public class GeneralAIsystem : MonoBehaviour { public GameObject headpos; public GameObject lowpos; public GameObject highpos; public string otherunit; public GameObject otherunitobj; public NavMeshAgent agent; public float curv = 0f; public bool up = false; public bool down = false; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Distance(headpos.transform.localPosition, lowpos.transform.localPosition) < 0.01f) { up = true; down = false; } else if (Vector3.Distance(headpos.transform.localPosition, highpos.transform.localPosition) < 0.01f) { up = false; down = true; } if (!up && down) { headpos.transform.localPosition = new Vector3(0f, Mathf.SmoothDamp(headpos.transform.localPosition.y, lowpos.transform.localPosition.y, ref curv, 1f), 0f); headpos.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } else if (up && !down) { headpos.transform.localPosition = new Vector3(0f, Mathf.SmoothDamp(headpos.transform.localPosition.y, highpos.transform.localPosition.y, ref curv, 1f), 0f); headpos.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if ((Object)(object)GameObject.Find(otherunit) != (Object)null) { otherunitobj = GameObject.Find(otherunit); agent.SetDestination(otherunitobj.transform.position); } } public void Low() { up = false; down = true; } public void High() { up = true; down = false; } } public class HideIfQBsloted : MonoBehaviour { public FVRQuickBeltSlot QBSLOT; public GameObject obj; public FVRPhysicalObject phyobj; private void Start() { } private void FixedUpdate() { if ((Object)(object)phyobj == (Object)null) { } if ((Object)(object)QBSLOT.CurObject != (Object)null) { obj.SetActive(true); phyobj = QBSLOT.CurObject; ((FVRInteractiveObject)phyobj).SetAllCollidersToLayer(false, "NoCol"); if (phyobj.AttachmentsList.Count > 0) { for (int i = 0; i < phyobj.AttachmentsList.Count; i++) { ((FVRInteractiveObject)phyobj.AttachmentsList[i]).SetAllCollidersToLayer(false, "NoCol"); } } } else { if (!((Object)(object)QBSLOT.CurObject == (Object)null)) { return; } if ((Object)(object)phyobj != (Object)null) { ((FVRInteractiveObject)phyobj).SetAllCollidersToLayer(false, "Default"); if (phyobj.AttachmentsList.Count > 0) { for (int j = 0; j < phyobj.AttachmentsList.Count; j++) { ((FVRInteractiveObject)phyobj.AttachmentsList[j]).SetAllCollidersToLayer(false, "Default"); } } phyobj = null; } else if (!((Object)(object)phyobj == (Object)null)) { } obj.SetActive(false); } } } public class SIGNALISRelationship : MonoBehaviour { public GameObject plushieobj; public string plushie; public GameObject otherunitsobj; public string otherunit; public Texture2D browsnormal; public Texture2D mouthnormal; public Texture2D browsreact; public Texture2D mouthreact; public Texture2D eyesopen; public Texture2D eyesclose; public Texture2D eyeballLopen; public Texture2D eyeballRopen; public Texture2D eyewhiteopen; public Texture2D eyewhiteclose; public Material brows; public Material mouth; public Material eyes; public Material eyewhite; public Material eyeballL; public Material eyeballR; private void Start() { brows.SetTexture("_MainTex", (Texture)(object)browsnormal); mouth.SetTexture("_MainTex", (Texture)(object)mouthnormal); ((MonoBehaviour)this).InvokeRepeating("openeye", 5f, 5f); ((MonoBehaviour)this).InvokeRepeating("closeeye", 5.04f, 5f); ((MonoBehaviour)this).InvokeRepeating("openeye2", 5.16f, 5f); } private void Update() { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) otherunitsobj = GameObject.Find(otherunit); plushieobj = GameObject.Find(plushie); if ((Object)(object)otherunitsobj == (Object)null && (Object)(object)plushieobj == (Object)null) { brows.SetTexture("_MainTex", (Texture)(object)browsnormal); mouth.SetTexture("_MainTex", (Texture)(object)mouthnormal); } else if ((Object)(object)otherunitsobj != (Object)null) { if (Vector3.Distance(((Component)this).gameObject.transform.position, otherunitsobj.transform.position) < 5f) { brows.SetTexture("_MainTex", (Texture)(object)browsreact); mouth.SetTexture("_MainTex", (Texture)(object)mouthreact); } else if (Vector3.Distance(((Component)this).gameObject.transform.position, otherunitsobj.transform.position) > 5f) { brows.SetTexture("_MainTex", (Texture)(object)browsnormal); mouth.SetTexture("_MainTex", (Texture)(object)mouthnormal); } } else if (plushie != null) { if (Vector3.Distance(((Component)this).gameObject.transform.position, plushieobj.transform.position) < 5f) { brows.SetTexture("_MainTex", (Texture)(object)browsreact); mouth.SetTexture("_MainTex", (Texture)(object)mouthreact); } else if (Vector3.Distance(((Component)this).gameObject.transform.position, plushieobj.transform.position) > 5f) { brows.SetTexture("_MainTex", (Texture)(object)browsnormal); mouth.SetTexture("_MainTex", (Texture)(object)mouthnormal); } } } public void openeye() { eyes.SetTexture("_MainTex", (Texture)(object)eyesopen); eyewhite.SetTexture("_MainTex", (Texture)(object)eyewhiteopen); eyeballL.SetTexture("_MainTex", (Texture)(object)eyeballLopen); eyeballR.SetTexture("_MainTex", (Texture)(object)eyeballRopen); } public void closeeye() { eyes.SetTexture("_MainTex", (Texture)(object)eyesclose); eyewhite.SetTexture("_MainTex", (Texture)(object)eyewhiteclose); eyeballL.SetTexture("_MainTex", (Texture)(object)eyewhiteclose); eyeballR.SetTexture("_MainTex", (Texture)(object)eyewhiteclose); } public void openeye2() { eyes.SetTexture("_MainTex", (Texture)(object)eyesopen); eyewhite.SetTexture("_MainTex", (Texture)(object)eyewhiteopen); eyeballL.SetTexture("_MainTex", (Texture)(object)eyeballLopen); eyeballR.SetTexture("_MainTex", (Texture)(object)eyeballRopen); } } } namespace DigitalRuby.SimpleLUT { [ExecuteInEditMode] public class SimpleLUT : MonoBehaviour { [Tooltip("Shader to use for the lookup.")] public Shader Shader; private Shader previousShader; [Tooltip("Texture to use for the lookup. Make sure it has read/write enabled and mipmaps disabled. The height must equal the square root of the width.")] public Texture2D LookupTexture; private Texture2D previousTexture; [Range(0f, 1f)] [Tooltip("Lerp between original (0) and corrected color (1)")] public float Amount = 1f; [Tooltip("Tint color, applied to the final pixel")] public Color TintColor = Color.white; [Range(0f, 360f)] [Tooltip("Hue")] public float Hue = 0f; [Range(-1f, 1f)] [Tooltip("Saturation")] public float Saturation = 0f; [Range(-1f, 1f)] [Tooltip("Brightness")] public float Brightness = 0f; [Range(-1f, 1f)] [Tooltip("Contrast")] public float Contrast = 0f; [Range(0f, 1f)] [Tooltip("Sharpness")] public float Sharpness = 0f; private Material material; private Texture3D converted3DLut = null; private int lutSize; private void CreateMaterial() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if ((Object)(object)Shader == (Object)null) { material = null; Debug.LogError((object)"Must set a shader to use LUT"); } else { material = new Material(Shader); ((Object)material).hideFlags = (HideFlags)52; } } private void OnEnable() { if ((Object)(object)((Component)this).GetComponent() == (Object)null) { Debug.LogError((object)"This script must be attached to a Camera"); } } private void Update() { if ((Object)(object)Shader != (Object)(object)previousShader) { previousShader = Shader; CreateMaterial(); } if ((Object)(object)LookupTexture != (Object)(object)previousTexture) { previousTexture = LookupTexture; Convert(LookupTexture); } } private void OnDestroy() { if ((Object)(object)converted3DLut != (Object)null) { Object.DestroyImmediate((Object)(object)converted3DLut); } converted3DLut = null; } public void SetIdentityLut() { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) if (!SystemInfo.supports3DTextures) { return; } if ((Object)(object)converted3DLut != (Object)null) { Object.DestroyImmediate((Object)(object)converted3DLut); } int num = 16; Color[] array = (Color[])(object)new Color[num * num * num]; float num2 = 1f / (1f * (float)num - 1f); for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { for (int k = 0; k < num; k++) { ref Color reference = ref array[i + j * num + k * num * num]; reference = new Color((float)i * 1f * num2, (float)j * 1f * num2, (float)k * 1f * num2, 1f); } } } converted3DLut = new Texture3D(num, num, num, (TextureFormat)5, false); converted3DLut.SetPixels(array); converted3DLut.Apply(); lutSize = ((Texture)converted3DLut).width; ((Texture)converted3DLut).wrapMode = (TextureWrapMode)1; } public bool ValidDimensions(Texture2D tex2d) { if ((Object)(object)tex2d == (Object)null) { return false; } int height = ((Texture)tex2d).height; if (height != Mathf.FloorToInt(Mathf.Sqrt((float)((Texture)tex2d).width))) { return false; } return true; } internal bool Convert(Texture2D lookupTexture) { //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) if (!SystemInfo.supports3DTextures) { Debug.LogError((object)"System does not support 3D textures"); return false; } if ((Object)(object)lookupTexture == (Object)null) { SetIdentityLut(); } else { if ((Object)(object)converted3DLut != (Object)null) { Object.DestroyImmediate((Object)(object)converted3DLut); } if (lookupTexture.mipmapCount > 1) { Debug.LogError((object)"Lookup texture must not have mipmaps"); return false; } try { int num = ((Texture)lookupTexture).width * ((Texture)lookupTexture).height; num = ((Texture)lookupTexture).height; if (!ValidDimensions(lookupTexture)) { Debug.LogError((object)"Lookup texture dimensions must be a power of two. The height must equal the square root of the width."); return false; } Color[] pixels = lookupTexture.GetPixels(); Color[] array = (Color[])(object)new Color[pixels.Length]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { for (int k = 0; k < num; k++) { int num2 = num - j - 1; ref Color reference = ref array[i + j * num + k * num * num]; reference = pixels[k * num + i + num2 * num * num]; } } } converted3DLut = new Texture3D(num, num, num, (TextureFormat)5, false); converted3DLut.SetPixels(array); converted3DLut.Apply(); lutSize = ((Texture)converted3DLut).width; ((Texture)converted3DLut).wrapMode = (TextureWrapMode)1; } catch (Exception ex) { Debug.LogError((object)("Unable to convert texture to LUT texture, make sure it is read/write. Error: " + ex)); } } return true; } private void OnRenderImage(RenderTexture source, RenderTexture destination) { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Invalid comparison between Unknown and I4 if ((Object)(object)converted3DLut == (Object)null) { SetIdentityLut(); } if ((Object)(object)converted3DLut == (Object)null || (Object)(object)material == (Object)null) { Graphics.Blit((Texture)(object)source, destination); return; } material.SetTexture("_MainTex", (Texture)(object)source); material.SetTexture("_ClutTex", (Texture)(object)converted3DLut); material.SetFloat("_Amount", Amount); material.SetColor("_TintColor", TintColor); material.SetFloat("_Hue", Hue); material.SetFloat("_Saturation", Saturation + 1f); material.SetFloat("_Brightness", Brightness + 1f); material.SetFloat("_Contrast", Contrast + 1f); material.SetFloat("_Scale", (float)(lutSize - 1) / (1f * (float)lutSize)); material.SetFloat("_Offset", 1f / (2f * (float)lutSize)); float num = Sharpness * 4f * 0.2f; material.SetFloat("_SharpnessCenterMultiplier", 1f + 4f * num); material.SetFloat("_SharpnessEdgeMultiplier", num); Graphics.Blit((Texture)(object)source, destination, material, ((int)QualitySettings.activeColorSpace == 1) ? 1 : 0); } } } namespace JerryComponent { public class SosigSeatAnimation : MonoBehaviour { public bool is_seated = false; private Collider seat; private GameObject sitpos; public GameObject seatswitch; public Collider col; public GameObject sensor; public GameObject head; public GameObject HeadGeoSeated; public GameObject HeadGeoNormal; public GameObject TorsoNormal; public GameObject TorsoSeated; public GameObject TorsoSeatedChest; public GameObject FootTar; private void Start() { } private void OnTriggerStay(Collider other) { if (((Object)((Component)other).gameObject).name == "VehicleSeat") { is_seated = true; seat = other; sitpos = ((Component)seat).gameObject; col = other; } if (!(((Object)((Component)other).gameObject).name != "VehicleSeat")) { } } private void OnTriggerExit(Collider other) { if (((Object)((Component)other).gameObject).name == "VehicleSeat") { is_seated = false; } if (!(((Object)((Component)other).gameObject).name != "VehicleSeat")) { } } private void Update() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)sitpos == (Object)null || (Object)(object)seat == (Object)null) { } sensor.transform.position = head.transform.position; if ((Object)(object)col != (Object)null) { if (is_seated && seatswitch.transform.localEulerAngles.x > 45f && col.enabled) { sitpos = ((Component)seat).gameObject; TorsoSeated.SetActive(true); TorsoNormal.SetActive(false); HeadGeoNormal.SetActive(false); HeadGeoSeated.SetActive(true); TorsoSeated.transform.parent = sitpos.transform; FootTar.transform.position = (sitpos.transform.GetChild(1).position + sitpos.transform.GetChild(0).position) / 2f; float num = Mathf.Clamp(TorsoSeated.transform.localPosition.x, -10f, 10f); float num2 = Mathf.Clamp(TorsoSeated.transform.localPosition.y, 400f, 435f); float num3 = Mathf.Clamp(TorsoSeated.transform.localPosition.z, -75f, -55f); TorsoSeated.transform.localPosition = new Vector3(num, num2, num3); TorsoSeated.transform.position = head.transform.position; HeadGeoSeated.transform.eulerAngles = head.transform.eulerAngles; TorsoSeatedChest.transform.eulerAngles = new Vector3(sitpos.transform.eulerAngles.x, head.transform.eulerAngles.y, sitpos.transform.eulerAngles.z); TorsoSeated.transform.eulerAngles = new Vector3(sitpos.transform.eulerAngles.x, sitpos.transform.eulerAngles.y, sitpos.transform.eulerAngles.z); } if (!is_seated || seatswitch.transform.localEulerAngles.x < 45f || !col.enabled) { col = null; } } else if ((Object)(object)col == (Object)null) { seat = null; sitpos = null; TorsoSeated.SetActive(false); TorsoNormal.SetActive(true); HeadGeoNormal.SetActive(true); HeadGeoSeated.SetActive(false); TorsoSeated.transform.parent = head.transform; TorsoSeated.transform.localEulerAngles = new Vector3(0f, 0f, 0f); TorsoSeated.transform.localPosition = new Vector3(0f, 0f, 0f); } } } } [ExecuteInEditMode] [AddComponentMenu("Physics/Swing Bone")] public class SwingBone : MonoBehaviour { private bool IsRoot = true; private Transform baseTransform; private Vector3 m_LastPos = Vector3.zero; private Quaternion m_LastRot = Quaternion.identity; private List m_Bones = new List(); [Range(0.01f, 100f)] public float drag = 50f; [Range(0.01f, 100f)] public float angelDrag = 50f; public bool affectChild = true; [ExecuteInEditMode] private void Start() { baseTransform = ((Component)this).transform; for (int i = 0; i < ((Component)this).transform.childCount; i++) { Transform child = ((Component)this).transform.GetChild(i); SwingBone swingBone = ((Component)child).GetComponent(); if ((Object)(object)swingBone == (Object)null) { swingBone = ((Component)child).gameObject.AddComponent(); swingBone.drag = drag; swingBone.angelDrag = angelDrag; } swingBone.IsRoot = false; m_Bones.Add(swingBone); } } [ExecuteInEditMode] private void LateUpdate() { if (IsRoot) { UpdateBone(); } } private void UpdateBone() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)baseTransform == (Object)null) { return; } if (m_LastRot != Quaternion.identity) { baseTransform.rotation = Quaternion.Lerp(m_LastRot, baseTransform.rotation, Mathf.Clamp01(angelDrag * Time.deltaTime)); } if (m_LastRot != baseTransform.rotation) { if (m_LastPos != Vector3.zero && m_LastPos != baseTransform.position) { Vector3 val = baseTransform.position - ((Component)this).transform.parent.position; Vector3 val2 = m_LastPos - ((Component)this).transform.parent.position; Vector3 val3 = val + (val2 - val) / 2f; m_LastRot = Quaternion.FromToRotation(val, val2) * baseTransform.rotation; baseTransform.rotation = Quaternion.Lerp(m_LastRot, baseTransform.rotation, Mathf.Clamp01(drag * Time.deltaTime)); } else { m_LastRot = baseTransform.rotation; } } m_LastPos = baseTransform.position; for (int i = 0; i < m_Bones.Count; i++) { if (affectChild) { m_Bones[i].affectChild = affectChild; m_Bones[i].drag = drag; m_Bones[i].angelDrag = angelDrag; } m_Bones[i].UpdateBone(); } } } namespace JerryComponent { public class HorseStuff : MonoBehaviour { public GameObject Head; public WheelCollider W1; public WheelCollider W2; public WheelCollider W3; public WheelCollider W4; public rotate ROT1; public rotate ROT2; public rotate ROT3; public rotate ROT4; public rotate ROT5; public float horsepower = 5000f; public float pwrref; public bool isForward = false; public bool isLeft = false; public bool isRight = false; public bool isStraight = true; public Transform RopeEnd; public Transform RopeL; public Transform RopeR; public LineRenderer Wire; public Transform PH; private KeywordRecognizer keyword; private Dictionary dic = new Dictionary(); private void Start() { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown dic.Add("Giddyup!", Move); dic.Add("Heya!", Move); dic.Add("Stop.", Stop); dic.Add("Hold it.", Stop); dic.Add("Turn Left.", Left); dic.Add("Turn Right.", Right); dic.Add("Go Straight.", Straight); keyword = new KeywordRecognizer(dic.Keys.ToArray()); ((PhraseRecognizer)keyword).OnPhraseRecognized += new PhraseRecognizedDelegate(Keyword_OnPhraseRecognized); ((PhraseRecognizer)keyword).Start(); } public void Move() { isForward = true; } public void Stop() { isForward = false; } public void Left() { isLeft = true; isRight = false; isStraight = false; } public void Right() { isLeft = false; isRight = true; isStraight = false; } public void Straight() { isLeft = false; isRight = false; isStraight = true; } private void Keyword_OnPhraseRecognized(PhraseRecognizedEventArgs args) { Debug.Log((object)args.text); dic[args.text](); } private void Update() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) Head.transform.position = GM.CurrentMovementManager.Head.position; if (Head.transform.localPosition.x < 1.5f && Head.transform.localPosition.x > -1.5f && Head.transform.localPosition.y > 0f && Head.transform.localPosition.y < 4f && Head.transform.localPosition.z < 3f && Head.transform.localPosition.z > -4f) { ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent(((Component)PH).transform); } else if (Head.transform.localPosition.x > 1.5f || Head.transform.localPosition.x < -1.5f || Head.transform.localPosition.y < 0f || Head.transform.localPosition.y > 4f || Head.transform.localPosition.z > 3f || Head.transform.localPosition.z < -4f) { ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null); } Wire.SetPosition(0, RopeL.position); Wire.SetPosition(1, RopeEnd.position); Wire.SetPosition(2, RopeR.position); Wire.loop = true; if (isForward) { ((Behaviour)ROT1).enabled = true; ((Behaviour)ROT2).enabled = true; ((Behaviour)ROT3).enabled = true; ((Behaviour)ROT4).enabled = true; ((Behaviour)ROT5).enabled = true; W1.motorTorque = Mathf.SmoothDamp(W1.motorTorque, horsepower, ref pwrref, 0.5f); W2.motorTorque = Mathf.SmoothDamp(W2.motorTorque, horsepower, ref pwrref, 0.5f); W3.motorTorque = Mathf.SmoothDamp(W3.motorTorque, horsepower, ref pwrref, 0.5f); W4.motorTorque = Mathf.SmoothDamp(W4.motorTorque, horsepower, ref pwrref, 0.5f); } if (!isForward) { ((Behaviour)ROT1).enabled = false; ((Behaviour)ROT2).enabled = false; ((Behaviour)ROT3).enabled = false; ((Behaviour)ROT4).enabled = false; ((Behaviour)ROT5).enabled = false; W1.motorTorque = Mathf.SmoothDamp(W1.motorTorque, 0f, ref pwrref, 0.2f); W2.motorTorque = Mathf.SmoothDamp(W2.motorTorque, 0f, ref pwrref, 0.2f); W3.motorTorque = Mathf.SmoothDamp(W3.motorTorque, 0f, ref pwrref, 0.2f); W4.motorTorque = Mathf.SmoothDamp(W4.motorTorque, 0f, ref pwrref, 0.2f); } if (isStraight) { W1.steerAngle = 0f; W2.steerAngle = 0f; } if (isLeft) { W1.steerAngle = 340f; W2.steerAngle = 340f; } if (isRight) { W1.steerAngle = 20f; W2.steerAngle = 20f; } } private void OnDestroy() { ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null); } } } public class IKFootSolver : MonoBehaviour { public bool isMovingForward; [SerializeField] private LayerMask terrainLayer; [SerializeField] private Transform body; [SerializeField] private IKFootSolver otherFoot; public float speed = 6f; public float stepDistance = 0.15f; public float stepLength = 0.1f; public float sideStepLength = 0.07f; public float stepHeight = 0.1f; [SerializeField] private Vector3 footOffset; public Vector3 footRotOffset; public float footYPosOffset = 0.1f; public float rayStartYOffset = 0f; public float rayLength = 1.5f; private float footSpacing; public Vector3 oldPosition; public Vector3 currentPosition; public Vector3 newPosition; public Vector3 oldNormal; public Vector3 currentNormal; public Vector3 newNormal; private float lerp; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) footSpacing = ((Component)this).transform.localPosition.x; currentPosition = (newPosition = (oldPosition = ((Component)this).transform.position)); currentNormal = (newNormal = (oldNormal = ((Component)this).transform.up)); lerp = 1f; } private void Update() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = currentPosition + Vector3.up * footYPosOffset; ((Component)this).transform.localRotation = Quaternion.Euler(footRotOffset); Ray val = default(Ray); ((Ray)(ref val))..ctor(body.position + body.right * footSpacing + Vector3.up * rayStartYOffset, Vector3.down); Debug.DrawRay(body.position + body.right * footSpacing + Vector3.up * rayStartYOffset, Vector3.down); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, rayLength, ((LayerMask)(ref terrainLayer)).value) && Vector3.Distance(newPosition, ((RaycastHit)(ref val2)).point) > stepDistance && !otherFoot.IsMoving() && lerp >= 1f) { lerp = 0f; Vector3 val3 = Vector3.ProjectOnPlane(((RaycastHit)(ref val2)).point - currentPosition, Vector3.up); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(body.forward, body.InverseTransformDirection(normalized)); isMovingForward = num < 50f || num > 130f; if (isMovingForward) { newPosition = ((RaycastHit)(ref val2)).point + normalized * stepLength + footOffset; newNormal = ((RaycastHit)(ref val2)).normal; } else { newPosition = ((RaycastHit)(ref val2)).point + normalized * sideStepLength + footOffset; newNormal = ((RaycastHit)(ref val2)).normal; } } if (lerp < 1f) { Vector3 val4 = Vector3.Lerp(oldPosition, newPosition, lerp); val4.y += Mathf.Sin(lerp * (float)Math.PI) * stepHeight; currentPosition = val4; currentNormal = Vector3.Lerp(oldNormal, newNormal, lerp); lerp += Time.deltaTime * speed; } else { oldPosition = newPosition; oldNormal = newNormal; } } private void OnDrawGizmos() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.red; Gizmos.DrawSphere(newPosition, 0.1f); } public bool IsMoving() { return lerp < 1f; } } [Serializable] public class VRMap { public Transform vrTarget; public Transform ikTarget; public Vector3 trackingPositionOffset; public Vector3 trackingRotationOffset; public void Map() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) ikTarget.position = vrTarget.TransformPoint(trackingPositionOffset); ikTarget.rotation = vrTarget.rotation * Quaternion.Euler(trackingRotationOffset); } } public class IKTargetFollowVRRig : MonoBehaviour { [Range(0f, 1f)] public float turnSmoothness = 0.1f; public VRMap head; public VRMap leftHand; public VRMap rightHand; public Vector3 headBodyPositionOffset; public float headBodyYawOffset; private void LateUpdate() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = head.ikTarget.position + headBodyPositionOffset; float y = head.vrTarget.eulerAngles.y; ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(((Component)this).transform.eulerAngles.x, y, ((Component)this).transform.eulerAngles.z), turnSmoothness); head.Map(); leftHand.Map(); rightHand.Map(); } } namespace JerryComponent { public class MechScript : MonoBehaviour { public GameObject mechHandL; public GameObject mechHandR; public GameObject HandL; public GameObject HandR; public GameObject Rot; public LockToPoint _lock; private void Start() { } private void Update() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) HandL.transform.position = GM.CurrentMovementManager.LeftHand.position; HandL.transform.rotation = GM.CurrentMovementManager.LeftHand.rotation; HandR.transform.position = GM.CurrentMovementManager.RightHand.position; HandR.transform.rotation = GM.CurrentMovementManager.RightHand.rotation; mechHandL.transform.localPosition = HandL.transform.localPosition; mechHandL.transform.localRotation = HandL.transform.localRotation; mechHandR.transform.localPosition = HandR.transform.localPosition; mechHandR.transform.localRotation = HandR.transform.localRotation; if (Rot.transform.localEulerAngles.x > 45f) { ((Behaviour)_lock).enabled = true; } else if (Rot.transform.localEulerAngles.x < 45f) { ((Behaviour)_lock).enabled = false; } } } public class seatanimation : MonoBehaviour { public bool is_seated = false; public GameObject seatbody; public GameObject seatgeo; public GameObject normalbody; private Collider seat; private GameObject sitpos; public GameObject head; public GameObject headrot; public GameObject headGEO; public GameObject lockpos; public GameObject lowerbody; public GameObject helmetreal; public GameObject helmetseat; public GameObject leftfootsit; public GameObject rightfootsit; public GameObject seatswitch; public GameObject hands; public GameObject handsbase; public GameObject handL; public GameObject handR; public GameObject handLGeo; public GameObject handRGeo; public GameObject handLpos; public GameObject handRpos; public GameObject rootreal; public GameObject rootreallock; public GameObject rootgeo; public GameObject rootgeolock; public GameObject sensor; public GameObject Slots1; public GameObject Slots2; public GameObject Slots3; public Transform SlotPos11; public Transform SlotPos12; public Transform SlotPos21; public Transform SlotPos22; public Transform SlotPos31; public Transform SlotPos32; public Collider col; private void Start() { } private void OnTriggerStay(Collider other) { if (((Object)((Component)other).gameObject).name == "VehicleSeat") { is_seated = true; seat = other; sitpos = ((Component)seat).gameObject; col = other; } if (!(((Object)((Component)other).gameObject).name != "VehicleSeat")) { } } private void OnTriggerExit(Collider other) { if (((Object)((Component)other).gameObject).name == "VehicleSeat") { is_seated = false; } if (!(((Object)((Component)other).gameObject).name != "VehicleSeat")) { } } private void Update() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_0826: Unknown result type (might be due to invalid IL or missing references) //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_08bf: Unknown result type (might be due to invalid IL or missing references) //IL_08e3: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_076a: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0662: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06bd: Unknown result type (might be due to invalid IL or missing references) //IL_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_06f4: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0723: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) Slots1.transform.localPosition = new Vector3(0f, 0f, 0f); Slots1.transform.localEulerAngles = new Vector3(0f, 0f, 0f); Slots2.transform.localPosition = new Vector3(0f, 0f, 0f); Slots2.transform.localEulerAngles = new Vector3(0f, 0f, 0f); Slots3.transform.localPosition = new Vector3(0f, 0f, 0f); Slots3.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if (is_seated) { Slots1.transform.SetParent(SlotPos12); Slots2.transform.SetParent(SlotPos22); Slots3.transform.SetParent(SlotPos32); } else if (!is_seated) { Slots1.transform.SetParent(SlotPos11); Slots2.transform.SetParent(SlotPos21); Slots3.transform.SetParent(SlotPos31); } if ((Object)(object)sitpos == (Object)null || (Object)(object)seat == (Object)null) { } seatbody.transform.position = head.transform.position; handL.transform.position = handLpos.transform.position; handR.transform.position = handRpos.transform.position; handL.transform.eulerAngles = handLpos.transform.eulerAngles; handR.transform.eulerAngles = handRpos.transform.eulerAngles; handLGeo.transform.position = handL.transform.position; handRGeo.transform.position = handR.transform.position; rootreal.transform.localPosition = rootreallock.transform.localPosition; rootgeo.transform.localPosition = rootgeolock.transform.localPosition; sensor.transform.position = seatbody.transform.position; if ((Object)(object)col != (Object)null) { if (is_seated && seatswitch.transform.localEulerAngles.x > 45f && col.enabled) { sitpos = ((Component)seat).gameObject; seatgeo.SetActive(true); normalbody.SetActive(false); helmetreal.SetActive(false); helmetseat.SetActive(true); seatbody.transform.parent = sitpos.transform; handL.transform.parent = sitpos.transform; handR.transform.parent = sitpos.transform; hands.transform.parent = sitpos.transform; hands.transform.localPosition = new Vector3(0f, 375f, 0f); float num = Mathf.Clamp(seatbody.transform.localPosition.x, -10f, 10f); float num2 = Mathf.Clamp(seatbody.transform.localPosition.y, 400f, 435f); float num3 = Mathf.Clamp(seatbody.transform.localPosition.z, -75f, -55f); float num4 = Mathf.Clamp(handL.transform.localPosition.x, -50f, 45f); float num5 = Mathf.Clamp(handL.transform.localPosition.y, 300f, 460f); float num6 = Mathf.Clamp(handL.transform.localPosition.z, -80f, 10f); float num7 = Mathf.Clamp(handR.transform.localPosition.x, -45f, 50f); float num8 = Mathf.Clamp(handR.transform.localPosition.y, 300f, 460f); float num9 = Mathf.Clamp(handR.transform.localPosition.z, -80f, 10f); seatbody.transform.localPosition = new Vector3(num, num2, num3); headGEO.transform.eulerAngles = headrot.transform.eulerAngles; lockpos.transform.eulerAngles = new Vector3(sitpos.transform.eulerAngles.x, headrot.transform.eulerAngles.y, sitpos.transform.eulerAngles.z); handL.transform.localPosition = new Vector3(num4, num5, num6); handR.transform.localPosition = new Vector3(num7, num8, num9); seatbody.transform.eulerAngles = new Vector3(sitpos.transform.eulerAngles.x, sitpos.transform.eulerAngles.y, sitpos.transform.eulerAngles.z); lowerbody.transform.eulerAngles = new Vector3(sitpos.transform.eulerAngles.x, sitpos.transform.eulerAngles.y, sitpos.transform.eulerAngles.z); rightfootsit.transform.position = sitpos.transform.GetChild(1).position; leftfootsit.transform.position = sitpos.transform.GetChild(0).position; } if (!is_seated || seatswitch.transform.localEulerAngles.x < 45f || !col.enabled) { col = null; } } else if ((Object)(object)col == (Object)null) { seat = null; sitpos = null; seatgeo.SetActive(false); normalbody.SetActive(true); helmetreal.SetActive(true); helmetseat.SetActive(false); seatbody.transform.parent = head.transform; seatbody.transform.localEulerAngles = new Vector3(0f, 0f, 0f); seatbody.transform.localPosition = new Vector3(0f, 0f, 0f); handL.transform.parent = hands.transform; handR.transform.parent = hands.transform; hands.transform.parent = handsbase.transform; hands.transform.localEulerAngles = new Vector3(0f, 0f, 0f); hands.transform.localPosition = new Vector3(0f, 0f, 0f); } } } public class seathands : MonoBehaviour { private GameObject interactobject; public bool is_inposL = false; public bool is_inposR = false; private Collider intobj; public VRIK vrik; public GameObject handL; public GameObject handR; public GameObject seatswitch; private void OnTriggerStay(Collider other) { if (((Object)((Component)other).gameObject).name == "UV26" || ((Object)((Component)other).gameObject).name == "FlightHandleCo") { is_inposR = true; intobj = other; interactobject = ((Component)intobj).gameObject; } if (((Object)((Component)other).gameObject).name == "ThrottleCo") { is_inposL = true; intobj = other; interactobject = ((Component)intobj).gameObject; } } private void OnTriggerExit(Collider other) { if (((Object)((Component)other).gameObject).name == "UV26" || ((Object)((Component)other).gameObject).name == "FlightHandleCo") { is_inposR = false; vrik.solver.rightArm.target = handR.transform; } if (((Object)((Component)other).gameObject).name == "ThrottleCo") { is_inposL = false; vrik.solver.leftArm.target = handL.transform; } } private void Start() { } private void FixedUpdate() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)intobj == (Object)null || (Object)(object)interactobject == (Object)null) { vrik.solver.leftArm.target = handL.transform; vrik.solver.rightArm.target = handR.transform; } if (is_inposL && seatswitch.transform.localEulerAngles.x > 45f) { vrik.solver.leftArm.target = ((Component)interactobject.transform.GetChild(0)).transform; } if (is_inposR && seatswitch.transform.localEulerAngles.x > 45f) { vrik.solver.rightArm.target = ((Component)interactobject.transform.GetChild(0)).transform; } if (seatswitch.transform.localEulerAngles.x < 45f) { vrik.solver.leftArm.target = handL.transform; vrik.solver.rightArm.target = handR.transform; interactobject = null; intobj = null; is_inposL = false; is_inposR = false; } } } public class seathandsL : MonoBehaviour { private GameObject interactobject; public bool is_inposL = false; private Collider intobj; public VRIK vrik; public GameObject handL; public GameObject seatswitch; private void OnTriggerStay(Collider other) { if (((Object)((Component)other).gameObject).name == "ThrottleCo") { is_inposL = true; intobj = other; interactobject = ((Component)intobj).gameObject; } } private void OnTriggerExit(Collider other) { if (((Object)((Component)other).gameObject).name == "ThrottleCo") { is_inposL = false; vrik.solver.leftArm.target = handL.transform; } } private void Start() { } private void FixedUpdate() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)intobj == (Object)null || (Object)(object)interactobject == (Object)null) { vrik.solver.leftArm.target = handL.transform; } if (is_inposL && seatswitch.transform.localEulerAngles.x > 45f) { vrik.solver.leftArm.target = ((Component)interactobject.transform.GetChild(0)).transform; } if (seatswitch.transform.localEulerAngles.x < 45f) { vrik.solver.leftArm.target = handL.transform; interactobject = null; intobj = null; is_inposL = false; } } } public class seathandsR : MonoBehaviour { private GameObject interactobject; public bool is_inposR = false; private Collider intobj; public VRIK vrik; public GameObject handR; public GameObject seatswitch; private void OnTriggerStay(Collider other) { if (((Object)((Component)other).gameObject).name == "UV26" || ((Object)((Component)other).gameObject).name == "FlightHandleCo") { is_inposR = true; intobj = other; interactobject = ((Component)intobj).gameObject; } } private void OnTriggerExit(Collider other) { if (((Object)((Component)other).gameObject).name == "UV26" || ((Object)((Component)other).gameObject).name == "FlightHandleCo") { is_inposR = false; vrik.solver.rightArm.target = handR.transform; } } private void Start() { } private void FixedUpdate() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)intobj == (Object)null || (Object)(object)interactobject == (Object)null) { vrik.solver.rightArm.target = handR.transform; } if (is_inposR && seatswitch.transform.localEulerAngles.x > 45f) { vrik.solver.rightArm.target = ((Component)interactobject.transform.GetChild(0)).transform; } if (seatswitch.transform.localEulerAngles.x < 45f) { vrik.solver.rightArm.target = handR.transform; interactobject = null; intobj = null; is_inposR = false; } } } } public class ActiveRagdoll : MonoBehaviour { public enum ControlAuthority { None, DynamicGait, ArmIK, Mixed } [Tooltip("The root bone")] public Transform rootBone; [Tooltip("This object shows the direction the body is moving in.")] public Transform moveDir; [Header("IK targets")] public Transform leftFoot; public Transform rightFoot; [Header("standing position values")] [Tooltip("The amount of space between the feet")] public float footGap; [Tooltip("The height of the body relative to the ground")] public float standHeight; [Header("step values")] [Tooltip("The minimum distance away from the body the foot must be to take a step")] public float stepDist; [Tooltip("The distance the foot travels during a step")] public float stepSize; [Tooltip("The amount of time it will take to take a step. The lower the value the faster the feet will move")] public float stepDuration; [Tooltip("How high the foot will go off the ground while taking a step")] public float stepHeight; [Header("physics")] [Tooltip("This doesnt matter")] public bool physics = false; [Tooltip("The force applied to keep the ragdoll standing upright. The higher it is the harder it is to knock the ragdoll over")] public int rotationForce = 10; public int rotationSmoothness = 1; [Tooltip("Add a layer called ragdolls and apply it to this object and all its children")] public LayerMask ragdollLayer; [Header("foot prediction")] [Tooltip("Ԥ\ufffd\ufffdʱ\ufffd䣨\ufffd룩\ufffd\ufffd\u05b5Խ\ufffd\ufffd\ufffdԽ\ufffd\ufffdǰ\ufffd\ufffd")] public float predictionTime = 0.2f; [Tooltip("\ufffd\ufffd\ufffdԤ\ufffd\ufffd\ufffd\ufffd룬\ufffd\ufffd\u05b9\ufffd\ufffdԶ")] public float maxPredictionDistance = 1.5f; [Tooltip("\ufffdǷ\ufffd\ufffd\ufffd\ufffd\ufffdԤ\ufffd\ufffd")] public bool enablePrediction = true; private Vector3 lastFrame; private Transform leftSide; private Transform rightSide; private Vector3 leftTarget; private Vector3 rightTarget; [HideInInspector] public ConfigurableJoint joint; [HideInInspector] public Rigidbody connectedBody; private Rigidbody rb; [HideInInspector] public bool falling; private bool isStepping = false; private Vector3 lastRootPosition; private Vector3 rootVelocity; private bool hasValidGround = false; private float currentStandHeight = 1f; private float heightSmoothVelocity = 0f; private Vector3 leftFootEulerVel; private Vector3 rightFootEulerVel; [Header("Control Flags")] public bool enableBodyHeightControl = true; public bool enableFootOrientation = true; public bool enableJointForces = true; private float heightVelocity; private Vector3 targetConnectedBodyPos; [Header("Slope Adaptation")] [Tooltip("\ufffdǷ\ufffd\ufffd\ufffd\ufffd\ufffd¶\ufffd\ufffdԶ\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd")] public bool adaptToSlope = true; [Tooltip("\ufffd\ufffd\ufffd\ufffd\ufffdߵ\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdף\ufffd")] public float maxHeightAdjustment = 0.3f; [Tooltip("\ufffd\ufffdߵ\ufffd\ufffd\ufffd\ufffdٶ\ufffd")] public float heightAdjustSpeed = 5f; [Tooltip("\ufffd\ufffdʼ\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd¶ȽǶ\ufffd")] public float slopeStartAngle = 15f; [Tooltip("\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd¶ȽǶ\ufffd")] public float slopeMaxAngle = 45f; private float targetStandHeight; private float currentStandHeightSmooth; private NPCCoordinator coordinator; [HideInInspector] public bool isControlledByCoordinator = false; [Header("Dynamic Gait System")] [Tooltip("\ufffdǷ\ufffd\ufffd\ufffd\ufffdö\ufffd\u032c\ufffd\ufffd\u032cϵͳ")] public bool enableDynamicGait = true; [Header("Height Adjustment")] [Tooltip("\ufffd\ufffd\ufffd\ufffd\ufffd\u07f1仯\ufffd\ufffd\ufffd\ufffd\ufffdף\ufffd")] public float maxHeightSwing = 0.08f; [Tooltip("\ufffd\ufffd\u07f1仯\ufffdٶ\ufffd")] public float heightSwingSpeed = 8f; [Header("Arm Swing")] [Tooltip("\ufffd\u05b1۰ڶ\ufffd\ufffd\ufffd\ufffdȣ\ufffd\ufffdȣ\ufffd")] public float armSwingAmplitude = 25f; [Tooltip("\ufffd\u05b1۰ڶ\ufffd\ufffdٶ\ufffd")] public float armSwingSpeed = 6f; [Tooltip("\ufffd\u05b1۸\ufffd\ufffd\ufffdŲ\ufffd\ufffdӳ٣\ufffd\u05b5ԽСԽ\ufffd죩")] public float armSwingDelay = 0.15f; [Header("Body Tilt")] [Tooltip("\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdȣ\ufffd\ufffdȣ\ufffd")] public float bodyTiltAmplitude = 5f; [Tooltip("\ufffd\ufffd\ufffd\ufffdת\ufffdƷ\ufffd\ufffd\ufffd")] public float weightShiftAmplitude = 0.03f; private float gaitPhase = 0f; private float leftLegPhase = 0f; private float rightLegPhase = 0f; private float lastLeftFootDist = 0f; private float lastRightFootDist = 0f; private float targetStandHeightOffset = 0f; private float currentStandHeightOffset = 0f; private float targetArmSwingLeft = 0f; private float targetArmSwingRight = 0f; private float currentArmSwingLeft = 0f; private float currentArmSwingRight = 0f; private float targetBodyTilt = 0f; private float currentBodyTilt = 0f; private Vector3 targetWeightShift = Vector3.zero; private Vector3 currentWeightShift = Vector3.zero; public Transform leftArmTarget; public Transform rightArmTarget; private Vector3 leftArmOriginalPos; private Vector3 rightArmOriginalPos; private Quaternion leftArmOriginalRot; private Quaternion rightArmOriginalRot; public Transform HandL; public Transform HandR; [Header("Arm IK Control")] [Tooltip("\ufffdǷ\ufffdӹ\ufffd\ufffd\u05b1ۿ\ufffd\ufffd\ufffdȨ")] public bool takeArmControl = true; [Tooltip("\ufffdӹ\ufffdʱ\ufffdĻ\ufffd\ufffd\ufffdٶ\ufffd")] public float armControlBlendSpeed = 5f; private bool hasArmControl = false; private float armControlWeight = 0f; public ArmIK leftArmIK; public ArmIK rightArmIK; public Transform leftIKTarget; public Transform rightIKTarget; public Transform leftSwingTarget; public Transform rightSwingTarget; private Vector3 leftSwingOriginalPos; private Quaternion leftSwingOriginalRot; private Vector3 rightSwingOriginalPos; private Quaternion rightSwingOriginalRot; public SOSIGHMGUNNER ai; [Header("Control Authority")] public ControlAuthority currentAuthority = ControlAuthority.None; private float lastStateChangeTime = 0f; private void Start() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) moveDir.position = rootBone.position; lastFrame = rootBone.position; lastRootPosition = rootBone.position; rb = ((Component)rootBone).GetComponent(); connectedBody = new GameObject("joint").AddComponent(); ((Component)connectedBody).transform.parent = ((Component)this).transform; connectedBody.isKinematic = true; setupJoint(); leftSide = new GameObject("left side").transform; rightSide = new GameObject("right side").transform; leftSide.parent = moveDir; rightSide.parent = moveDir; leftSide.localPosition = new Vector3(footGap, 0f, 0f); rightSide.localPosition = new Vector3(0f - footGap, 0f, 0f); leftTarget = leftFoot.position; rightTarget = rightFoot.position; targetStandHeight = standHeight; currentStandHeightSmooth = standHeight; coordinator = ((Component)this).GetComponent(); if ((Object)(object)coordinator != (Object)null) { isControlledByCoordinator = true; } ((Component)leftSwingTarget).gameObject.SetActive(true); ((Component)rightSwingTarget).gameObject.SetActive(true); if (enableDynamicGait) { SetupArmTargets(); } if (enableDynamicGait) { SetupArmControlSystem(); } } private void SetupArmControlSystem() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ai != (Object)null) { leftArmIK = ai.ArmL; rightArmIK = ai.ArmR; if ((Object)(object)leftSwingTarget != (Object)null) { leftSwingOriginalRot = leftSwingTarget.localRotation; leftSwingOriginalPos = leftSwingTarget.localPosition; Debug.Log((object)("[DynamicGait] Left arm bone: " + ((Object)leftSwingTarget).name + " original rotation: " + ((Quaternion)(ref leftSwingOriginalRot)).eulerAngles)); } if ((Object)(object)rightSwingTarget != (Object)null) { rightSwingOriginalRot = rightSwingTarget.localRotation; rightSwingOriginalPos = rightSwingTarget.localPosition; Debug.Log((object)("[DynamicGait] Right arm bone: " + ((Object)rightSwingTarget).name + " original rotation: " + ((Quaternion)(ref rightSwingOriginalRot)).eulerAngles)); } } } private void CreateSwingTargets() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) Transform val = FindChildRecursive(((Component)this).transform, "Hand_L"); Transform val2 = FindChildRecursive(((Component)this).transform, "Hand_R"); if ((Object)(object)val == (Object)null) { val = leftIKTarget; } if ((Object)(object)val2 == (Object)null) { val2 = rightIKTarget; } if ((Object)(object)val != (Object)null) { GameObject val3 = new GameObject("LeftArmSwing_Controller"); val3.transform.parent = val.parent; val3.transform.localPosition = val.localPosition; val3.transform.localRotation = val.localRotation; leftSwingTarget = val3.transform; leftSwingOriginalPos = leftSwingTarget.localPosition; leftSwingOriginalRot = leftSwingTarget.localRotation; Debug.Log((object)("[DynamicGait] Left swing target created at: " + leftSwingTarget.localPosition)); } if ((Object)(object)val2 != (Object)null) { GameObject val3 = new GameObject("RightArmSwing_Controller"); val3.transform.parent = val2.parent; val3.transform.localPosition = val2.localPosition; val3.transform.localRotation = val2.localRotation; rightSwingTarget = val3.transform; rightSwingOriginalPos = rightSwingTarget.localPosition; rightSwingOriginalRot = rightSwingTarget.localRotation; Debug.Log((object)("[DynamicGait] Right swing target created at: " + rightSwingTarget.localPosition)); } if ((Object)(object)leftArmIK != (Object)null && leftArmIK.solver != null && (Object)(object)leftSwingTarget != (Object)null) { leftArmIK.solver.arm.target = leftSwingTarget; Debug.Log((object)"[DynamicGait] Left ArmIK target set to swing controller"); } if ((Object)(object)rightArmIK != (Object)null && rightArmIK.solver != null && (Object)(object)rightSwingTarget != (Object)null) { rightArmIK.solver.arm.target = rightSwingTarget; Debug.Log((object)"[DynamicGait] Right ArmIK target set to swing controller"); } } private void SetupArmTargets() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)HandL != (Object)null) { leftArmTarget = HandL; leftArmOriginalPos = HandL.localPosition; leftArmOriginalRot = HandL.localRotation; } if ((Object)(object)HandR != (Object)null) { rightArmTarget = HandR; rightArmOriginalPos = HandR.localPosition; rightArmOriginalRot = HandR.localRotation; } } private Transform FindChildRecursive(Transform parent, string name) { Transform[] componentsInChildren = ((Component)parent).GetComponentsInChildren(); foreach (Transform val in componentsInChildren) { if (((Object)val).name == name) { return val; } } return null; } private void CalculateRootVelocity() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) Vector3 position = rootBone.position; rootVelocity = (position - lastRootPosition) / Time.deltaTime; lastRootPosition = position; if (((Vector3)(ref rootVelocity)).magnitude > 10f) { rootVelocity = Vector3.zero; } } private Vector3 PredictFootTarget(Vector3 currentGroundPoint, float footOffsetSign) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) if (!enablePrediction) { return currentGroundPoint; } Vector3 val = rootVelocity; val.y = 0f; Vector3 val2 = val * predictionTime; if (((Vector3)(ref val2)).magnitude > maxPredictionDistance) { val2 = ((Vector3)(ref val2)).normalized * maxPredictionDistance; } Vector3 val3 = currentGroundPoint + val2; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3 + Vector3.up * 2f, Vector3.down, ref val4, 5f, LayerMask.op_Implicit(ragdollLayer))) { val3.y = ((RaycastHit)(ref val4)).point.y; } return val3; } private IEnumerator PerformStep(Transform foot, Vector3 target) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (isStepping) { yield break; } isStepping = true; float originalMaxSwing = maxHeightSwing; maxHeightSwing *= 1.5f; Vector3 startPoint = foot.position; Vector3 directionToTarget = target - rootBone.position; directionToTarget.y = 0f; Vector3 rootForward = rootBone.forward; rootForward.y = 0f; ((Vector3)(ref rootForward)).Normalize(); if (((Vector3)(ref directionToTarget)).magnitude > 0.1f && Vector3.Dot(rootForward, ((Vector3)(ref directionToTarget)).normalized) < -0.3f) { target = rootBone.position + rootForward * stepSize; RaycastHit val = default(RaycastHit); if (Physics.Raycast(target + Vector3.up * 2f, Vector3.down, ref val, 5f, LayerMask.op_Implicit(ragdollLayer))) { target.y = ((RaycastHit)(ref val)).point.y; } } Vector3 centerPoint = (startPoint + target) / 2f; centerPoint.y = target.y + stepHeight; float timeElapsed = 0f; float duration = stepDuration; yield return null; while (timeElapsed < duration) { timeElapsed += Time.deltaTime; float normalizedTime = Mathf.Clamp01(timeElapsed / duration); float t = normalizedTime; float heightOffset = Mathf.Sin(t * (float)Math.PI) * stepHeight; Vector3 linearPoint = Vector3.Lerp(startPoint, target, t); linearPoint.y += heightOffset; foot.position = linearPoint; yield return null; } foot.position = target; maxHeightSwing = originalMaxSwing; isStepping = false; } private void FixedUpdate() { } private void Update() { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) UpdateControlAuthority(); switch (currentAuthority) { case ControlAuthority.Mixed: SetIKEnabled(enabled: true); if (enableDynamicGait) { ExecuteDynamicGaitWithBlend(); } break; case ControlAuthority.ArmIK: SetIKEnabled(enabled: true); ResetArmsToOriginal(); break; case ControlAuthority.DynamicGait: if (enableDynamicGait) { ExecuteDynamicGait(); } SetIKEnabled(enabled: false); break; } if (isControlledByCoordinator) { if (enableDynamicGait && !falling && hasValidGround && !isStepping) { UpdateGaitPhase(); ApplyDynamicPosture(); } UpdateFootPlacementOnly(); return; } if (!falling && hasValidGround) { RaycastHit val = default(RaycastHit); bool flag = Physics.Raycast(leftSide.position, Vector3.down, ref val, 5f, LayerMask.op_Implicit(ragdollLayer)); RaycastHit val2 = default(RaycastHit); bool flag2 = Physics.Raycast(rightSide.position, Vector3.down, ref val2, 5f, LayerMask.op_Implicit(ragdollLayer)); if (adaptToSlope) { float slopeAngle = CalculateSlopeAngle(((RaycastHit)(ref val)).point, ((RaycastHit)(ref val2)).point); targetStandHeight = CalculateAdaptedHeight(slopeAngle); currentStandHeightSmooth = Mathf.Lerp(currentStandHeightSmooth, targetStandHeight, Time.deltaTime * heightAdjustSpeed); } else { currentStandHeightSmooth = standHeight; } float num = (((RaycastHit)(ref val)).point.y + ((RaycastHit)(ref val2)).point.y) / 2f; float num2 = num + currentStandHeightSmooth; } if (enableDynamicGait && !falling && hasValidGround && !isStepping) { UpdateGaitPhase(); ApplyDynamicPosture(); } if (enableDynamicGait && !falling) { UpdateArmControlState(); if (takeArmControl && hasArmControl) { ExecuteDynamicGait(); } } if (enableDynamicGait && !falling && hasValidGround && !isStepping) { UpdateGaitPhase(); ApplyDynamicPosture(); } } private void UpdateControlAuthority() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ai == (Object)null)) { int num; if ((Object)(object)ai.NMA != (Object)null) { Vector3 velocity = ai.NMA.velocity; num = ((((Vector3)(ref velocity)).magnitude > 0.5f) ? 1 : 0); } else { num = 0; } bool flag = (byte)num != 0; bool flag2 = (Object)(object)ai.curGun != (Object)null; bool flag3 = (Object)(object)ai.curMag != (Object)null; bool flag4 = (Object)(object)ai.nearestAI != (Object)null; bool flag5 = flag2 && flag3 && flag4 && ai.fire; bool flag6 = flag2 && flag4 && !ai.fire; ControlAuthority controlAuthority = currentAuthority; controlAuthority = (flag5 ? ControlAuthority.ArmIK : (flag6 ? ControlAuthority.ArmIK : (flag2 ? ControlAuthority.ArmIK : ((!flag || !enableDynamicGait) ? ControlAuthority.DynamicGait : ControlAuthority.DynamicGait)))); if (controlAuthority != currentAuthority) { lastStateChangeTime = Time.time; currentAuthority = controlAuthority; } if (Time.time - lastStateChangeTime < 0.3f && currentAuthority != ControlAuthority.Mixed) { currentAuthority = ControlAuthority.Mixed; } } } private void SetIKEnabled(bool enabled) { if (!((Object)(object)ai == (Object)null)) { if ((Object)(object)ai.ArmL != (Object)null && ((Behaviour)ai.ArmL).enabled != enabled) { ((Behaviour)ai.ArmL).enabled = enabled; } if ((Object)(object)ai.ArmR != (Object)null && ((Behaviour)ai.ArmR).enabled != enabled) { ((Behaviour)ai.ArmR).enabled = enabled; } if (!enabled && (Object)(object)ai.handL != (Object)null && !((Object)(object)ai.handR != (Object)null)) { } } } private void ResetArmsToOriginal() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)leftSwingTarget != (Object)null) { leftSwingTarget.localRotation = leftSwingOriginalRot; } if ((Object)(object)rightSwingTarget != (Object)null) { rightSwingTarget.localRotation = rightSwingOriginalRot; } } private void ExecuteDynamicGaitWithBlend() { float num = Mathf.Clamp01(Time.time - lastStateChangeTime); float num2 = armSwingAmplitude; float num3 = maxHeightSwing; armSwingAmplitude *= num; maxHeightSwing *= num; ExecuteDynamicGait(); armSwingAmplitude = num2; maxHeightSwing = num3; } private void UpdateArmControlState() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) SOSIGHMGUNNER component = ((Component)this).GetComponent(); bool flag = (Object)(object)component != (Object)null && (Object)(object)component.nearestAI != (Object)null && component.fire; int num; if ((Object)(object)component != (Object)null && (Object)(object)component.NMA != (Object)null) { Vector3 velocity = component.NMA.velocity; num = ((((Vector3)(ref velocity)).magnitude > 0.5f) ? 1 : 0); } else { num = 0; } bool flag2 = (byte)num != 0; bool flag3 = !flag && (!flag2 || true); hasArmControl = flag3; float num2 = (hasArmControl ? 1f : 0f); armControlWeight = Mathf.Lerp(armControlWeight, num2, Time.deltaTime * armControlBlendSpeed); } private void ExecuteDynamicGait() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) if (!enableDynamicGait) { return; } float num = 0f; if ((Object)(object)ai != (Object)null && (Object)(object)ai.NMA != (Object)null) { Vector3 velocity = ai.NMA.velocity; num = ((Vector3)(ref velocity)).magnitude; } else if ((Object)(object)rootBone != (Object)null) { Rigidbody component = ((Component)rootBone).GetComponent(); if ((Object)(object)component != (Object)null) { Vector3 velocity2 = component.velocity; num = ((Vector3)(ref velocity2)).magnitude; } } float num2 = Mathf.Clamp01(num / 3f); if (!(num2 >= 0.1f)) { return; } float num3 = Mathf.Lerp(2f, 4.5f, num2); gaitPhase += Time.deltaTime * num3; if (gaitPhase > 1f) { gaitPhase -= 1f; } leftLegPhase = gaitPhase; rightLegPhase = Mathf.Repeat(gaitPhase + 0.5f, 1f); float num4 = Mathf.Sin(gaitPhase * (float)Math.PI * 2f); float num5 = (0f - num4) * maxHeightSwing * num2; currentStandHeightOffset = Mathf.Lerp(currentStandHeightOffset, num5, Time.deltaTime * 8f); RaycastHit val = default(RaycastHit); RaycastHit val2 = default(RaycastHit); if ((Object)(object)connectedBody != (Object)null && hasValidGround && Physics.Raycast(leftSide.position, Vector3.down, ref val, 5f, LayerMask.op_Implicit(ragdollLayer)) && Physics.Raycast(rightSide.position, Vector3.down, ref val2, 5f, LayerMask.op_Implicit(ragdollLayer))) { float num6 = (((RaycastHit)(ref val)).point.y + ((RaycastHit)(ref val2)).point.y) / 2f; float num7 = num6 + standHeight + currentStandHeightOffset; Vector3 position = ((Component)connectedBody).transform.position; ((Component)connectedBody).transform.position = new Vector3(position.x, Mathf.Lerp(position.y, num7, Time.deltaTime * 10f), position.z); } if ((Object)(object)leftArmTarget != (Object)null && (Object)(object)rightArmTarget != (Object)null) { float num8 = Mathf.Sin(rightLegPhase * (float)Math.PI * 2f) * armSwingAmplitude * num2; float num9 = Mathf.Sin(leftLegPhase * (float)Math.PI * 2f) * armSwingAmplitude * num2; num8 = Mathf.Clamp(num8, -45f, 45f); num9 = Mathf.Clamp(num9, -45f, 45f); if (leftArmOriginalRot == Quaternion.identity) { leftArmOriginalRot = leftArmTarget.localRotation; } if (rightArmOriginalRot == Quaternion.identity) { rightArmOriginalRot = rightArmTarget.localRotation; } leftArmTarget.localRotation = leftArmOriginalRot * Quaternion.Euler(0f, num8, 0f); rightArmTarget.localRotation = rightArmOriginalRot * Quaternion.Euler(0f, 0f - num9, 0f); } } private void ApplyArmSwingWithBlend() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) if (!hasArmControl || (Object)(object)leftSwingTarget == (Object)null || (Object)(object)rightSwingTarget == (Object)null) { return; } Vector3 velocity = ((Component)rootBone).GetComponent().velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; float num = Mathf.Clamp01(magnitude / 3f); if (num >= 0.1f) { UpdateGaitPhase(); float num2 = Mathf.Sin(rightLegPhase * (float)Math.PI * 2f) * armSwingAmplitude * num; float num3 = Mathf.Sin(leftLegPhase * (float)Math.PI * 2f) * armSwingAmplitude * num; num2 = Mathf.Clamp(num2, -40f, 40f); num3 = Mathf.Clamp(num3, -40f, 40f); if ((Object)(object)leftSwingTarget != (Object)null) { leftSwingTarget.localRotation = leftSwingOriginalRot * Quaternion.Euler(0f, num2, 0f); } if ((Object)(object)rightSwingTarget != (Object)null) { rightSwingTarget.localRotation = rightSwingOriginalRot * Quaternion.Euler(0f, 0f - num3, 0f); } } } private void UpdateGaitPhase() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) Vector3 position = rootBone.position; Vector3 val = leftFoot.position - position; Vector3 val2 = rightFoot.position - position; float num = Vector3.Dot(val, rootBone.forward); float num2 = Vector3.Dot(val2, rootBone.forward); Vector3 velocity = ((Component)rootBone).GetComponent().velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; if (magnitude > 0.3f) { float num3 = Mathf.Lerp(2f, 5f, Mathf.Clamp01(magnitude / 3f)); float num4 = Time.deltaTime * num3; float num5 = (num + num2) / (stepSize * 2f); num5 = Mathf.Repeat(num5, 1f); gaitPhase = Mathf.Lerp(gaitPhase, num5, num4 * 3f); } else { gaitPhase = Mathf.Lerp(gaitPhase, 0f, Time.deltaTime * 1.5f); } leftLegPhase = gaitPhase; rightLegPhase = Mathf.Repeat(gaitPhase + 0.5f, 1f); } private void ApplyDynamicPosture() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = ((Component)rootBone).GetComponent().velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; float intensity = Mathf.Clamp01(magnitude / 3f); UpdateDynamicHeight(intensity); if ((Object)(object)leftArmTarget != (Object)null && (Object)(object)rightArmTarget != (Object)null) { UpdateArmSwing(intensity); } } private void UpdateDynamicHeight(float intensity) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Sin(gaitPhase * (float)Math.PI * 2f); float num2 = (0f - num) * maxHeightSwing * intensity; targetStandHeightOffset = num2; currentStandHeightOffset = Mathf.Lerp(currentStandHeightOffset, targetStandHeightOffset, Time.deltaTime * heightSwingSpeed); float num3 = standHeight + currentStandHeightOffset; num3 = Mathf.Clamp(num3, standHeight - maxHeightSwing, standHeight + maxHeightSwing); RaycastHit val = default(RaycastHit); RaycastHit val2 = default(RaycastHit); if (hasValidGround && Physics.Raycast(leftSide.position, Vector3.down, ref val, 5f, LayerMask.op_Implicit(ragdollLayer)) && Physics.Raycast(rightSide.position, Vector3.down, ref val2, 5f, LayerMask.op_Implicit(ragdollLayer))) { float num4 = (((RaycastHit)(ref val)).point.y + ((RaycastHit)(ref val2)).point.y) / 2f; Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(rootBone.position.x, num4 + num3, rootBone.position.z); ((Component)connectedBody).transform.position = Vector3.Lerp(((Component)connectedBody).transform.position, val3, Time.deltaTime * 6f); } } private void UpdateArmSwing(float intensity) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) float num = rightLegPhase; float num2 = leftLegPhase; float num3 = Mathf.Sin(num * (float)Math.PI * 2f) * armSwingAmplitude * intensity; float num4 = Mathf.Sin(num2 * (float)Math.PI * 2f) * armSwingAmplitude * intensity; targetArmSwingLeft = num3; targetArmSwingRight = num4; currentArmSwingLeft = Mathf.Lerp(currentArmSwingLeft, targetArmSwingLeft, Time.deltaTime * armSwingSpeed); currentArmSwingRight = Mathf.Lerp(currentArmSwingRight, targetArmSwingRight, Time.deltaTime * armSwingSpeed); leftArmTarget.localRotation = leftArmOriginalRot * Quaternion.Euler(num3, 0f, 0f); rightArmTarget.localRotation = rightArmOriginalRot * Quaternion.Euler(0f - num4, 0f, 0f); float num5 = (0f - Mathf.Abs(Mathf.Sin(num * (float)Math.PI * 2f))) * 0.02f * intensity; float num6 = (0f - Mathf.Abs(Mathf.Sin(num2 * (float)Math.PI * 2f))) * 0.02f * intensity; leftArmTarget.localPosition = leftArmOriginalPos + new Vector3(0f, num5, 0f); rightArmTarget.localPosition = rightArmOriginalPos + new Vector3(0f, num6, 0f); } private void UpdateBodyTilt(float intensity) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) float num = 0f - Mathf.Sin(gaitPhase * (float)Math.PI * 2f); float num2 = (targetBodyTilt = num * bodyTiltAmplitude * intensity); currentBodyTilt = Mathf.Lerp(currentBodyTilt, targetBodyTilt, Time.deltaTime * 5f); if (!falling) { Vector3 localEulerAngles = rootBone.localEulerAngles; rootBone.localEulerAngles = new Vector3(num2, localEulerAngles.y, 0f); } } private void UpdateWeightShift(float intensity) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Sin(gaitPhase * (float)Math.PI * 2f); float num2 = num * weightShiftAmplitude * intensity; targetWeightShift = new Vector3(num2, 0f, 0f); currentWeightShift = Vector3.Lerp(currentWeightShift, targetWeightShift, Time.deltaTime * 6f); Vector3 localPosition = ((Component)connectedBody).transform.localPosition; localPosition.x = currentWeightShift.x; ((Component)connectedBody).transform.localPosition = localPosition; } private void UpdateFootPlacementOnly() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) setMoveDir(); CalculateRootVelocity(); RaycastHit val = default(RaycastHit); bool flag = Physics.Raycast(leftSide.position, Vector3.down, ref val, 5f, LayerMask.op_Implicit(ragdollLayer)); RaycastHit val2 = default(RaycastHit); bool flag2 = Physics.Raycast(rightSide.position, Vector3.down, ref val2, 5f, LayerMask.op_Implicit(ragdollLayer)); if (!flag || !flag2) { falling = true; hasValidGround = false; return; } falling = false; hasValidGround = true; Vector3 val3 = PredictFootTarget(((RaycastHit)(ref val2)).point, 1f); Vector3 val4 = PredictFootTarget(((RaycastHit)(ref val)).point, -1f); leftTarget = Vector3.Lerp(leftTarget, val3, Time.deltaTime * 8f); rightTarget = Vector3.Lerp(rightTarget, val4, Time.deltaTime * 8f); float num = Vector3.Distance(leftFoot.position, leftTarget); float num2 = Vector3.Distance(rightFoot.position, rightTarget); bool flag3 = num >= stepDist && !isStepping; bool flag4 = num2 >= stepDist && !isStepping; if (flag3 && flag4) { if (num > num2) { ((MonoBehaviour)this).StartCoroutine(PerformStep(leftFoot, leftTarget)); } else { ((MonoBehaviour)this).StartCoroutine(PerformStep(rightFoot, rightTarget)); } } else if (flag3) { ((MonoBehaviour)this).StartCoroutine(PerformStep(leftFoot, leftTarget)); } else if (flag4) { ((MonoBehaviour)this).StartCoroutine(PerformStep(rightFoot, rightTarget)); } float num3 = Mathf.SmoothDampAngle(leftFoot.eulerAngles.y, rootBone.eulerAngles.y, ref leftFootEulerVel.y, 0.05f); leftFoot.eulerAngles = new Vector3(leftFoot.eulerAngles.x, num3, leftFoot.eulerAngles.z); float num4 = Mathf.SmoothDampAngle(rightFoot.eulerAngles.y, rootBone.eulerAngles.y, ref rightFootEulerVel.y, 0.05f); rightFoot.eulerAngles = new Vector3(rightFoot.eulerAngles.x, num4, rightFoot.eulerAngles.z); if (!falling && enableBodyHeightControl) { float num5 = (((RaycastHit)(ref val)).point.y + ((RaycastHit)(ref val2)).point.y) / 2f; targetConnectedBodyPos = new Vector3(rootBone.position.x, num5 + standHeight, rootBone.position.z); } if (enableFootOrientation && !isStepping) { float y = rootBone.eulerAngles.y; leftFoot.eulerAngles = new Vector3(leftFoot.eulerAngles.x, y, leftFoot.eulerAngles.z); rightFoot.eulerAngles = new Vector3(rightFoot.eulerAngles.x, y, rightFoot.eulerAngles.z); } } private float CalculateSlopeAngle(Vector3 leftFootPos, Vector3 rightFootPos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Vector3 val = rightFootPos - leftFootPos; val.y = 0f; if (((Vector3)(ref val)).magnitude < 0.01f) { return 0f; } float num = Mathf.Abs(leftFootPos.y - rightFootPos.y); float magnitude = ((Vector3)(ref val)).magnitude; float num2 = Mathf.Atan2(num, magnitude) * 57.29578f; float forwardSlopeAngle = GetForwardSlopeAngle(); return Mathf.Max(num2, forwardSlopeAngle); } private float GetForwardSlopeAngle() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) Vector3 val = rootBone.position + rootBone.forward * 0.5f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val + Vector3.up * 1f, Vector3.down, ref val2, 3f, LayerMask.op_Implicit(ragdollLayer))) { float num = ((RaycastHit)(ref val2)).point.y - rootBone.position.y; float num2 = 0.5f; return Mathf.Atan2(num, num2) * 57.29578f; } return 0f; } private float CalculateAdaptedHeight(float slopeAngle) { if (slopeAngle <= slopeStartAngle) { return standHeight; } if (slopeAngle >= slopeMaxAngle) { return standHeight - maxHeightAdjustment; } float num = (slopeAngle - slopeStartAngle) / (slopeMaxAngle - slopeStartAngle); return standHeight - maxHeightAdjustment * num; } public void setupJoint() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)joint != (Object)null) { Object.Destroy((Object)(object)joint); } joint = ((Component)rootBone).gameObject.AddComponent(); JointDrive angularXDrive = joint.angularXDrive; JointDrive angularYZDrive = joint.angularYZDrive; JointDrive yDrive = joint.yDrive; ((JointDrive)(ref angularXDrive)).positionSpring = rotationForce; ((JointDrive)(ref angularXDrive)).positionDamper = rotationSmoothness; ((JointDrive)(ref angularYZDrive)).positionSpring = rotationForce; ((JointDrive)(ref angularYZDrive)).positionDamper = rotationSmoothness; ((JointDrive)(ref yDrive)).positionSpring = 300f; ((JointDrive)(ref yDrive)).positionDamper = 10f; joint.angularXDrive = angularXDrive; joint.angularYZDrive = angularYZDrive; joint.yDrive = yDrive; ((Component)connectedBody).transform.rotation = rootBone.rotation; ((Joint)joint).connectedBody = connectedBody; ((Component)connectedBody).transform.rotation = Quaternion.identity; } public void setMoveDir() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) if (physics) { Vector3 velocity = rb.velocity; if ((double)((Vector3)(ref velocity)).magnitude > 0.3) { Vector3 velocity2 = rb.velocity; ((Vector3)(ref velocity2)).Normalize(); velocity2.y = 0f; moveDir.position = rootBone.position + velocity2 * stepSize; } else { moveDir.position = rootBone.position; } } else { if ((double)Vector3.Distance(lastFrame, rootBone.position) > 0.005) { Vector3 val = rootBone.position - lastFrame; ((Vector3)(ref val)).Normalize(); val.y = 0f; moveDir.position = rootBone.position + val * stepSize; } else { moveDir.position = rootBone.position; } lastFrame = rootBone.position; } } } public class PlayerLook : MonoBehaviour { [SerializeField] private string mouseXInputName; [SerializeField] private string mouseYInputName; [SerializeField] private float mouseSensitivity; [SerializeField] private Transform playerBody; private float xAxisClamp; private void Awake() { Cursor.lockState = (CursorLockMode)1; xAxisClamp = 0f; } private void toggleCursor() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)Cursor.lockState == 1) { Cursor.lockState = (CursorLockMode)0; } else { Cursor.lockState = (CursorLockMode)1; } } private void Update() { CameraRotation(); if (Input.GetKeyDown((KeyCode)101)) { toggleCursor(); } if (Input.GetKeyDown((KeyCode)108)) { toggleCursor(); } } private void CameraRotation() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) float num = Input.GetAxis(mouseXInputName) * mouseSensitivity * Time.fixedDeltaTime; float num2 = Input.GetAxis(mouseYInputName) * mouseSensitivity * Time.fixedDeltaTime; xAxisClamp += num2; if (xAxisClamp > 90f) { xAxisClamp = 90f; num2 = 0f; ClampXAxisRotationToValue(270f); } else if (xAxisClamp < -90f) { xAxisClamp = -90f; num2 = 0f; ClampXAxisRotationToValue(90f); } ((Component)this).transform.Rotate(Vector3.left * num2); playerBody.Rotate(Vector3.up * num); } private void ClampXAxisRotationToValue(float value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 eulerAngles = ((Component)this).transform.eulerAngles; eulerAngles.x = value; ((Component)this).transform.eulerAngles = eulerAngles; } } public class PlayerMove : MonoBehaviour { public float speed = 10f; public float gravity = 10f; public float maxVelocityChange = 10f; public float jumpHeight = 2f; private bool grounded = false; public Rigidbody rb; public bool running; public Camera cam; private void Awake() { rb.freezeRotation = true; rb.useGravity = false; } private void FixedUpdate() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical")); val = ((Component)this).transform.TransformDirection(val); val *= speed; Vector3 velocity = rb.velocity; Vector3 val2 = val - velocity; val2.x = Mathf.Clamp(val2.x, 0f - maxVelocityChange, maxVelocityChange); val2.z = Mathf.Clamp(val2.z, 0f - maxVelocityChange, maxVelocityChange); val2.y = 0f; rb.AddForce(val2, (ForceMode)2); if (grounded && Input.GetButton("Jump")) { rb.velocity = new Vector3(velocity.x, CalculateJumpVerticalSpeed(), velocity.z); } rb.AddForce(new Vector3(0f, (0f - gravity) * rb.mass, 0f)); grounded = false; } private void OnCollisionStay(Collision collision) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (collision.contacts.Length > 0) { ContactPoint val = collision.contacts[0]; if ((double)Vector3.Dot(((ContactPoint)(ref val)).normal, Vector3.up) > 0.5) { grounded = true; } } } private float CalculateJumpVerticalSpeed() { return Mathf.Sqrt(2f * jumpHeight * gravity); } } public class Throw : MonoBehaviour { public GameObject cubePrefab; public Material[] colors; public Camera cam; public Image aimer; public Transform hand; public ConfigurableJoint grip; private LineRenderer lineRenderer; private GameObject gripPoint; private void Start() { } private void Update() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) if (Input.GetMouseButtonDown(0)) { Rigidbody component = Object.Instantiate(cubePrefab, ((Component)this).transform.position + ((Component)this).transform.forward * 0.5f, ((Component)this).transform.rotation).GetComponent(); component.AddForce(((Component)this).transform.forward * 10f, (ForceMode)1); ((Renderer)((Component)component).GetComponent()).material = colors[Random.Range(0, colors.Length)]; } if (Input.GetMouseButtonDown(1)) { RaycastHit val = default(RaycastHit); Ray val2 = cam.ScreenPointToRay(((Component)aimer).transform.position); if (Physics.Raycast(val2, ref val)) { Rigidbody component2 = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { hand.position = ((RaycastHit)(ref val)).point; ((Joint)grip).connectedBody = component2; gripPoint = new GameObject("grip point"); gripPoint.transform.position = ((RaycastHit)(ref val)).point; gripPoint.transform.parent = ((Component)component2).transform; lineRenderer = new GameObject("Line").AddComponent(); ((Renderer)lineRenderer).material = new Material(Shader.Find("Legacy Shaders/Particles/Alpha Blended Premultiply")); lineRenderer.startColor = Color.black; lineRenderer.endColor = Color.black; lineRenderer.startWidth = 0.05f; lineRenderer.endWidth = 0.05f; lineRenderer.positionCount = 2; lineRenderer.useWorldSpace = true; } } } if (Input.GetMouseButtonUp(1)) { ((Joint)grip).connectedBody = null; Object.Destroy((Object)(object)lineRenderer); Object.Destroy((Object)(object)gripPoint); } if (Object.op_Implicit((Object)(object)((Joint)grip).connectedBody)) { lineRenderer.SetPosition(0, hand.position); lineRenderer.SetPosition(1, gripPoint.transform.position); } if (Input.GetKeyDown((KeyCode)114)) { Scene activeScene = SceneManager.GetActiveScene(); SceneManager.LoadScene(((Scene)(ref activeScene)).name); } } } public class InverseKinematics : MonoBehaviour { public int ChainLength = 2; public Transform Target; public Transform Pole; [Header("Solver Parameters")] public int Iterations = 10; public float Delta = 0.001f; [Range(0f, 1f)] public float SnapBackStrength = 1f; protected float[] BonesLength; protected float CompleteLength; protected Transform[] Bones; protected Vector3[] Positions; protected Vector3[] StartDirectionSucc; protected Quaternion[] StartRotationBone; protected Quaternion StartRotationTarget; protected Transform Root; [Header("Hip Prediction (腰部预判)")] public Transform Hip; public bool UseHipPrediction = true; [Range(0f, 0.5f)] public float PredictionStrength = 0.1f; [Range(0f, 0.5f)] public float MaxPredictionDistance = 0.3f; [Range(0f, 1f)] public float HipInfluenceFactor = 0.7f; [Header("Foot Inertia (脚步惯性)")] public bool UseFootInertia = true; [Range(0f, 0.5f)] public float FootInertiaFactor = 0.1f; [Header("Leg Crossing Prevention (防双脚交叉)")] public bool PreventCrossing = true; public GameObject OtherFootIK; public FootSide FootSide = FootSide.Left; [Range(0f, 0.5f)] public float MinFootDistance = 0.15f; [Range(0f, 0.3f)] public float MinSideDistance = 0.1f; protected int HipPositionMemory = 5; protected Vector3[] previousHipPositions; protected Vector3 previousTargetPosition; protected InverseKinematics otherFootIK; private void Awake() { Init(); } private void Init() { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) Bones = (Transform[])(object)new Transform[ChainLength + 1]; Positions = (Vector3[])(object)new Vector3[ChainLength + 1]; BonesLength = new float[ChainLength]; StartDirectionSucc = (Vector3[])(object)new Vector3[ChainLength + 1]; StartRotationBone = (Quaternion[])(object)new Quaternion[ChainLength + 1]; Root = ((Component)this).transform; for (int i = 0; i <= ChainLength; i++) { if ((Object)(object)Root == (Object)null) { throw new UnityException("The chain value is longer than the ancestor chain!"); } Root = Root.parent; } if ((Object)(object)Target == (Object)null) { Target = new GameObject(((Object)((Component)this).gameObject).name + " Target").transform; SetPositionRootSpace(Target, GetPositionRootSpace(((Component)this).transform)); } StartRotationTarget = GetRotationRootSpace(Target); Transform val = ((Component)this).transform; CompleteLength = 0f; for (int num = Bones.Length - 1; num >= 0; num--) { Bones[num] = val; ref Quaternion reference = ref StartRotationBone[num]; reference = GetRotationRootSpace(val); if (num == Bones.Length - 1) { ref Vector3 reference2 = ref StartDirectionSucc[num]; reference2 = GetPositionRootSpace(Target) - GetPositionRootSpace(val); } else { ref Vector3 reference3 = ref StartDirectionSucc[num]; reference3 = GetPositionRootSpace(Bones[num + 1]) - GetPositionRootSpace(val); BonesLength[num] = ((Vector3)(ref StartDirectionSucc[num])).magnitude; CompleteLength += BonesLength[num]; } val = val.parent; } previousHipPositions = (Vector3[])(object)new Vector3[HipPositionMemory]; for (int j = 0; j < HipPositionMemory; j++) { ref Vector3 reference4 = ref previousHipPositions[j]; reference4 = Vector3.zero; } } public static float SignedAngle(Vector3 from, Vector3 to, Vector3 axis) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Angle(from, to); Vector3 val = Vector3.Cross(from, to); float num2 = ((!(Vector3.Dot(val, axis) >= 0f)) ? (-1f) : 1f); return num * num2; } private void Start() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(1f, 0f, 0f); Vector3 to = default(Vector3); ((Vector3)(ref to))..ctor(0f, 1f, 0f); Vector3 axis = default(Vector3); ((Vector3)(ref axis))..ctor(0f, 0f, 1f); float num = SignedAngle(val, to, axis); Debug.Log((object)("Signed Angle: " + num)); if ((Object)(object)OtherFootIK != (Object)null) { otherFootIK = OtherFootIK.GetComponent(); } } private void LateUpdate() { UpdateHipPositionMemory(); ResolveIK(); } private void UpdateHipPositionMemory() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Hip == (Object)null)) { Vector3 positionRootSpace = GetPositionRootSpace(Hip); for (int num = HipPositionMemory - 1; num > 0; num--) { ref Vector3 reference = ref previousHipPositions[num]; reference = previousHipPositions[num - 1]; } previousHipPositions[0] = positionRootSpace; } } private Vector3 GetPredictedHipPosition() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Hip == (Object)null || HipPositionMemory < 2) { return (!((Object)(object)Hip != (Object)null)) ? Vector3.zero : GetPositionRootSpace(Hip); } Vector3 val = previousHipPositions[0]; Vector3 val2 = previousHipPositions[1]; Vector3 val3 = (val - val2) / Time.deltaTime; Vector3 val4 = val + val3 * PredictionStrength; float maxPredictionDistance = MaxPredictionDistance; Vector3 val5 = val4 - val; if (((Vector3)(ref val5)).magnitude > maxPredictionDistance) { Vector3 val6 = val4 - val; val4 = val + ((Vector3)(ref val6)).normalized * maxPredictionDistance; } return val4; } private Vector3 GetPredictedTargetPosition(Vector3 originalTargetPos) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Hip == (Object)null || !UseHipPrediction) { return originalTargetPos; } Vector3 predictedHipPosition = GetPredictedHipPosition(); Vector3 val = previousHipPositions[0]; Vector3 val2 = predictedHipPosition - val; Vector3 val3 = originalTargetPos + val2 * HipInfluenceFactor; if (UseFootInertia) { if (previousTargetPosition != Vector3.zero) { Vector3 val4 = (val3 - previousTargetPosition) / Time.deltaTime; val3 += val4 * FootInertiaFactor * Time.deltaTime; } previousTargetPosition = val3; } return val3; } private Vector3 PreventLegCrossing(Vector3 targetPos, Vector3 footPosition, Vector3 otherFootPosition, Vector3 hipPosition) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)otherFootIK == (Object)null || !PreventCrossing) { return targetPos; } Vector3 val = otherFootPosition - footPosition; Vector3 hipForwardDirection = GetHipForwardDirection(); Vector3 val2 = footPosition - hipPosition; Vector3 val3 = otherFootPosition - hipPosition; float num = Vector3.Dot(val2, hipForwardDirection); float num2 = Vector3.Dot(val3, hipForwardDirection); bool flag = false; if ((FootSide != FootSide.Left) ? (num < 0f && num2 > 0f) : (num > 0f && num2 < 0f)) { float num3 = Vector3.Dot(targetPos - hipPosition, hipForwardDirection); float minSideDistance = MinSideDistance; if (FootSide == FootSide.Left) { if (num3 > 0f - minSideDistance) { Vector3 val4 = hipForwardDirection * (0f - minSideDistance - num3); targetPos += val4; } } else if (num3 < minSideDistance) { Vector3 val5 = hipForwardDirection * (minSideDistance - num3); targetPos += val5; } } Vector3 val6 = targetPos - otherFootPosition; float magnitude = ((Vector3)(ref val6)).magnitude; if (magnitude < MinFootDistance) { Vector3 val7 = targetPos - otherFootPosition; Vector3 normalized = ((Vector3)(ref val7)).normalized; targetPos = otherFootPosition + normalized * MinFootDistance; } return targetPos; } private Vector3 GetHipForwardDirection() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Hip != (Object)null) { Vector3 right = Hip.right; Vector3 up = Vector3.up; Vector3 val = Vector3.Cross(up, right); return ((Vector3)(ref val)).normalized; } return Vector3.forward; } private void ResolveIK() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_0666: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_068d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Target == (Object)null) { return; } if (BonesLength.Length != ChainLength) { Init(); } for (int i = 0; i < Bones.Length; i++) { ref Vector3 reference = ref Positions[i]; reference = GetPositionRootSpace(Bones[i]); } Vector3 positionRootSpace = GetPositionRootSpace(Target); positionRootSpace = GetPredictedTargetPosition(positionRootSpace); if ((Object)(object)otherFootIK != (Object)null && PreventCrossing) { Vector3 positionRootSpace2 = GetPositionRootSpace(otherFootIK.Target); Vector3 hipPosition = ((!((Object)(object)Hip != (Object)null)) ? Positions[0] : GetPositionRootSpace(Hip)); positionRootSpace = PreventLegCrossing(positionRootSpace, Positions[Positions.Length - 1], positionRootSpace2, hipPosition); } Quaternion rotationRootSpace = GetRotationRootSpace(Target); Vector3 val = positionRootSpace - GetPositionRootSpace(Bones[0]); if (((Vector3)(ref val)).sqrMagnitude >= CompleteLength * CompleteLength) { Vector3 val2 = positionRootSpace - Positions[0]; Vector3 normalized = ((Vector3)(ref val2)).normalized; for (int j = 1; j < Positions.Length; j++) { ref Vector3 reference2 = ref Positions[j]; reference2 = Positions[j - 1] + normalized * BonesLength[j - 1]; } } else { for (int k = 0; k < Positions.Length - 1; k++) { ref Vector3 reference3 = ref Positions[k + 1]; reference3 = Vector3.Lerp(Positions[k + 1], Positions[k] + StartDirectionSucc[k], SnapBackStrength); } for (int l = 0; l < Iterations; l++) { for (int num = Positions.Length - 1; num > 0; num--) { if (num == Positions.Length - 1) { Positions[num] = positionRootSpace; } else { ref Vector3 reference4 = ref Positions[num]; Vector3 val3 = Positions[num + 1]; Vector3 val4 = Positions[num] - Positions[num + 1]; reference4 = val3 + ((Vector3)(ref val4)).normalized * BonesLength[num]; } } for (int m = 1; m < Positions.Length; m++) { ref Vector3 reference5 = ref Positions[m]; Vector3 val5 = Positions[m - 1]; Vector3 val6 = Positions[m] - Positions[m - 1]; reference5 = val5 + ((Vector3)(ref val6)).normalized * BonesLength[m - 1]; } Vector3 val7 = Positions[Positions.Length - 1] - positionRootSpace; if (((Vector3)(ref val7)).sqrMagnitude < Delta * Delta) { break; } } } if ((Object)(object)Pole != (Object)null) { Vector3 positionRootSpace3 = GetPositionRootSpace(Pole); Plane val8 = default(Plane); Vector3 val9 = default(Vector3); Vector3 val10 = default(Vector3); for (int n = 1; n < Positions.Length - 1; n++) { ((Plane)(ref val8))..ctor(Positions[n + 1] - Positions[n - 1], Positions[n - 1]); float distanceToPoint = ((Plane)(ref val8)).GetDistanceToPoint(positionRootSpace3); ((Vector3)(ref val9))..ctor(positionRootSpace3.x, positionRootSpace3.y - distanceToPoint, positionRootSpace3.z); float distanceToPoint2 = ((Plane)(ref val8)).GetDistanceToPoint(Positions[n]); ((Vector3)(ref val10))..ctor(Positions[n].x, Positions[n].y - distanceToPoint2, Positions[n].z); float num2 = SignedAngle(val10 - Positions[n - 1], val9 - Positions[n - 1], ((Plane)(ref val8)).normal); ref Vector3 reference6 = ref Positions[n]; reference6 = Quaternion.AngleAxis(num2, ((Plane)(ref val8)).normal) * (Positions[n] - Positions[n - 1]) + Positions[n - 1]; } } for (int num3 = 0; num3 < Positions.Length; num3++) { if (num3 == Positions.Length - 1) { SetRotationRootSpace(Bones[num3], Quaternion.Inverse(rotationRootSpace) * StartRotationTarget * Quaternion.Inverse(StartRotationBone[num3])); } else { SetRotationRootSpace(Bones[num3], Quaternion.FromToRotation(StartDirectionSucc[num3], Positions[num3 + 1] - Positions[num3]) * Quaternion.Inverse(StartRotationBone[num3])); } SetPositionRootSpace(Bones[num3], Positions[num3]); } } private Vector3 GetPositionRootSpace(Transform current) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Root == (Object)null) { return current.position; } return Quaternion.Inverse(Root.rotation) * (current.position - Root.position); } private void SetPositionRootSpace(Transform current, Vector3 position) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Root == (Object)null) { current.position = position; } else { current.position = Root.rotation * position + Root.position; } } private Quaternion GetRotationRootSpace(Transform current) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Root == (Object)null) { return current.rotation; } return Quaternion.Inverse(current.rotation) * Root.rotation; } private void SetRotationRootSpace(Transform current, Quaternion rotation) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Root == (Object)null) { current.rotation = rotation; } else { current.rotation = Root.rotation * rotation; } } } public enum FootSide { Left, Right } public class LegsLimits : MonoBehaviour { public Ragdoll ragdoll; private bool ragdolled; private ConfigurableJoint joint; private ConfigurableJointMotion xMotion; private ConfigurableJointMotion yMotion; private ConfigurableJointMotion zMotion; private void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) joint = ((Component)this).GetComponent(); xMotion = joint.angularXMotion; yMotion = joint.angularYMotion; zMotion = joint.angularZMotion; setLimits(); } private void Update() { if (ragdolled != ragdoll.ragdolled) { setLimits(); } ragdolled = ragdoll.ragdolled; } private void setLimits() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (ragdoll.ragdolled) { joint.angularXMotion = xMotion; joint.angularYMotion = yMotion; joint.angularZMotion = zMotion; } else { joint.angularXMotion = (ConfigurableJointMotion)2; joint.angularYMotion = (ConfigurableJointMotion)2; joint.angularZMotion = (ConfigurableJointMotion)2; } } } public class Ragdoll : MonoBehaviour { public ActiveRagdoll walkScript; public InverseKinematics leftIk; public InverseKinematics rightIk; public Rigidbody hipsRb; public int fallAngle = 55; public bool isLowHealth = false; [Header("Ragdoll Recovery")] public float recoveryDelay = 2f; public float stabilizeTime = 1f; [HideInInspector] public bool ragdolled = false; public bool conscious = true; public bool dead = false; private float ragdollStartTime = 0f; private Vector3 ragdollStartPos; private bool isStabilizing = false; private Quaternion originalRotation; private void Update() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) if (!ragdolled && conscious && !dead) { float num = Vector3.Angle(((Component)hipsRb).transform.up, Vector3.up); if (num > (float)fallAngle) { RagdollTransition(); } else if ((Object)(object)walkScript != (Object)null && walkScript.falling) { RagdollTransition(); } } else { if (!ragdolled || !conscious || dead || isStabilizing) { return; } Vector3 velocity = hipsRb.velocity; if (((Vector3)(ref velocity)).magnitude < 0.5f) { Vector3 angularVelocity = hipsRb.angularVelocity; if (((Vector3)(ref angularVelocity)).magnitude < 0.5f && Time.time - ragdollStartTime > recoveryDelay) { ((MonoBehaviour)this).StartCoroutine(GetUp()); } } } } public void RagdollTransition() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) if (!ragdolled) { ragdollStartTime = Time.time; ragdollStartPos = ((Component)this).transform.position; originalRotation = ((Component)hipsRb).transform.rotation; if ((Object)(object)walkScript != (Object)null && (Object)(object)walkScript.joint != (Object)null) { Object.Destroy((Object)(object)walkScript.joint); } if ((Object)(object)hipsRb != (Object)null) { hipsRb.useGravity = true; hipsRb.velocity = Vector3.ClampMagnitude(hipsRb.velocity, 3f); hipsRb.angularVelocity = Vector3.ClampMagnitude(hipsRb.angularVelocity, 2f); } if ((Object)(object)walkScript != (Object)null) { ((Behaviour)walkScript).enabled = false; } if ((Object)(object)leftIk != (Object)null) { ((Behaviour)leftIk).enabled = false; } if ((Object)(object)rightIk != (Object)null) { ((Behaviour)rightIk).enabled = false; } ragdolled = true; ((MonoBehaviour)this).StartCoroutine(SetConscious(recoveryDelay)); } } private IEnumerator GetUp() { isStabilizing = true; float stabilizeStart = Time.time; while (Time.time - stabilizeStart < stabilizeTime) { ((Component)hipsRb).transform.rotation = Quaternion.Slerp(((Component)hipsRb).transform.rotation, Quaternion.identity, Time.deltaTime * 3f); yield return null; } if ((Object)(object)walkScript != (Object)null) { ((Behaviour)walkScript).enabled = true; if ((Object)(object)leftIk != (Object)null) { ((Behaviour)leftIk).enabled = true; } if ((Object)(object)rightIk != (Object)null) { ((Behaviour)rightIk).enabled = true; } walkScript.setupJoint(); } if ((Object)(object)hipsRb != (Object)null) { hipsRb.useGravity = false; hipsRb.velocity = Vector3.zero; hipsRb.angularVelocity = Vector3.zero; } ragdolled = false; isStabilizing = false; ((MonoBehaviour)this).StartCoroutine(SetConscious(0.5f)); } public IEnumerator SetConscious(float time) { conscious = false; yield return (object)new WaitForSeconds(time); conscious = true; } } public class Walk : MonoBehaviour { public GameObject com; public Transform cam; public Rigidbody hips; public float speed = 7f; private void Start() { } private void FixedUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)com)) { com = GameObject.Find("person/joint"); } if (Input.GetKey((KeyCode)119)) { com.transform.rotation = Quaternion.LookRotation(-cam.forward); } if (Input.GetKey((KeyCode)97)) { com.transform.rotation = Quaternion.LookRotation(cam.right); } if (Input.GetKey((KeyCode)115)) { com.transform.rotation = Quaternion.LookRotation(cam.forward); } if (Input.GetKey((KeyCode)100)) { com.transform.rotation = Quaternion.LookRotation(-cam.right); } com.transform.eulerAngles = new Vector3(0f, com.transform.eulerAngles.y, 0f); if (Input.GetKey((KeyCode)119) || Input.GetKey((KeyCode)97) || Input.GetKey((KeyCode)115) || Input.GetKey((KeyCode)100)) { hips.AddForce(com.transform.forward * speed, (ForceMode)5); } } } public class aiRagdoll : MonoBehaviour { public Transform com; public NavMeshAgent navigator; public Rigidbody hips; public Transform target; public float dist; private void Start() { } private void Update() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)com)) { com = GameObject.Find("AI/joint").transform; } navigator.SetDestination(target.position); ((Component)navigator).transform.position = ((Component)hips).transform.position; com.rotation = ((Component)navigator).transform.rotation; if (Vector3.Distance(((Component)hips).transform.position, target.position) > dist) { hips.AddForce(((Component)com).transform.forward * 4f, (ForceMode)5); } } } public class npcBasic : MonoBehaviour { [HideInInspector] public Transform com; public ActiveRagdoll activeRagdoll; private Rigidbody rootBone; [Tooltip("The position that the ragdoll will walk toward")] public Transform target; [Tooltip("The speed it will walk")] public float speed = 2f; [Tooltip("Maximum speed limit")] public float maxSpeed = 3f; [Tooltip("The torque force for turning")] public float turnTorque = 5f; [Tooltip("How far away it should be from the target before it stops walking")] public float standDist = 2f; [Header("Balance Settings")] public float stabilityForce = 20f; public float antiTiltForce = 15f; public float maxTiltAngle = 25f; public float groundStickForce = 30f; private Vector3 currentVelocity = Vector3.zero; private bool isMoving = false; private bool isGrounded = true; private float groundCheckDistance = 0.3f; private Quaternion targetRotation; private bool hasTargetRotation = false; private float idleRotationTimer = 0f; private Quaternion initialIdleRotation; private bool initialRotationSet = false; public GameObject tarl; public GameObject tarR; public GameObject skel; public GameObject dir; public NavMeshAgent agent; private float lastStabilityCorrection = 0f; private float stabilityCorrectionInterval = 0.1f; [Header("Slope Settings")] public bool syncHeightWithNavMesh = true; public float navMeshSampleRadius = 0.5f; public NavMeshAgent cachedAgent; private float lastSampledHeight = 0f; private NPCCoordinator coordinator; private void Start() { if ((Object)(object)agent != (Object)null) { ((Component)agent).gameObject.transform.SetParent((Transform)null); ((Behaviour)agent).enabled = false; } if ((Object)(object)tarl != (Object)null) { tarl.gameObject.transform.SetParent((Transform)null); } if ((Object)(object)tarR != (Object)null) { tarR.gameObject.transform.SetParent((Transform)null); } if ((Object)(object)skel != (Object)null) { skel.gameObject.transform.SetParent((Transform)null); } if ((Object)(object)dir != (Object)null) { dir.gameObject.transform.SetParent((Transform)null); } ((MonoBehaviour)this).StartCoroutine(InitializePhysics()); cachedAgent = ((Component)this).GetComponent(); if ((Object)(object)cachedAgent == (Object)null && (Object)(object)agent != (Object)null) { cachedAgent = agent; } coordinator = ((Component)this).GetComponent(); } private IEnumerator InitializePhysics() { yield return (object)new WaitForSeconds(0.1f); if ((Object)(object)activeRagdoll != (Object)null && (Object)(object)activeRagdoll.rootBone != (Object)null) { rootBone = ((Component)activeRagdoll.rootBone).GetComponent(); if ((Object)(object)rootBone != (Object)null) { rootBone.mass = 75f; rootBone.drag = 1.5f; rootBone.angularDrag = 2f; rootBone.maxAngularVelocity = 3f; rootBone.maxDepenetrationVelocity = 2f; rootBone.interpolation = (RigidbodyInterpolation)1; rootBone.collisionDetectionMode = (CollisionDetectionMode)2; } } } private void FixedUpdate() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)coordinator != (Object)null && coordinator.enableSlopeAdaptation) { if ((Object)(object)rootBone != (Object)null) { Vector3 velocity = rootBone.velocity; if (((Vector3)(ref velocity)).magnitude > maxSpeed) { Rigidbody obj = rootBone; Vector3 velocity2 = rootBone.velocity; obj.velocity = ((Vector3)(ref velocity2)).normalized * maxSpeed; } } return; } if (!Object.op_Implicit((Object)(object)com) && (Object)(object)activeRagdoll != (Object)null && (Object)(object)activeRagdoll.connectedBody != (Object)null) { com = ((Component)activeRagdoll.connectedBody).transform; } if ((Object)(object)rootBone == (Object)null && (Object)(object)activeRagdoll != (Object)null && (Object)(object)activeRagdoll.rootBone != (Object)null) { rootBone = ((Component)activeRagdoll.rootBone).GetComponent(); if ((Object)(object)rootBone == (Object)null) { return; } } if ((Object)(object)rootBone == (Object)null) { return; } LimitVelocity(); Vector3 angularVelocity = rootBone.angularVelocity; if (((Vector3)(ref angularVelocity)).magnitude > 1f) { Rigidbody obj2 = rootBone; obj2.angularVelocity *= 0.96f; } CheckGroundAndStabilize(); if ((Object)(object)target != (Object)null) { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(target.position.x, com.position.y, target.position.z); Vector3 directionToTarget = val - com.position; float magnitude = ((Vector3)(ref directionToTarget)).magnitude; isMoving = magnitude > standDist && speed > 0.1f; if (isMoving) { MoveTowardsTarget(directionToTarget); idleRotationTimer = 0f; } else { PreventIdleRotation(); } } else { PreventIdleRotation(); } MaintainStability(); if (syncHeightWithNavMesh && (Object)(object)cachedAgent != (Object)null && cachedAgent.isOnNavMesh) { UpdateNavMeshHeight(); } } private void UpdateNavMeshHeight() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(position, ref val, navMeshSampleRadius, cachedAgent.areaMask)) { float y = ((NavMeshHit)(ref val)).position.y; float y2 = ((Component)this).transform.position.y; if (Mathf.Abs(y - y2) > 0.05f) { Vector3 position2 = ((Component)this).transform.position; position2.y = Mathf.Lerp(y2, y, Time.deltaTime * 8f); ((Component)this).transform.position = position2; lastSampledHeight = y; } } } public float GetCurrentSlopeAngle() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cachedAgent == (Object)null || !cachedAgent.isOnNavMesh) { return 0f; } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)this).transform.position, ref val, 0.5f, cachedAgent.areaMask)) { return Vector3.Angle(((NavMeshHit)(ref val)).normal, Vector3.up); } return 0f; } private void LimitVelocity() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)rootBone == (Object)null)) { Vector3 velocity = rootBone.velocity; if (((Vector3)(ref velocity)).magnitude > maxSpeed) { Rigidbody obj = rootBone; Vector3 velocity2 = rootBone.velocity; obj.velocity = ((Vector3)(ref velocity2)).normalized * maxSpeed; } Vector3 angularVelocity = rootBone.angularVelocity; if (((Vector3)(ref angularVelocity)).magnitude > 2f) { Rigidbody obj2 = rootBone; Vector3 angularVelocity2 = rootBone.angularVelocity; obj2.angularVelocity = ((Vector3)(ref angularVelocity2)).normalized * 2f; } } } private void CheckGroundAndStabilize() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rootBone == (Object)null) { return; } RaycastHit val = default(RaycastHit); if (Physics.Raycast(rootBone.position + Vector3.up * 0.2f, Vector3.down, ref val, groundCheckDistance + 0.8f)) { isGrounded = true; float num = ((RaycastHit)(ref val)).distance - 0.5f; if (num > 0.15f) { Vector3 val2 = Vector3.down * groundStickForce * Mathf.Min(num, 0.2f); rootBone.AddForce(val2, (ForceMode)5); } } else { isGrounded = false; } } private void MoveTowardsTarget(Vector3 directionToTarget) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rootBone == (Object)null) { return; } Vector3 normalized = ((Vector3)(ref directionToTarget)).normalized; Quaternion val = Quaternion.LookRotation(normalized); float num = Quaternion.Angle(((Component)rootBone).transform.rotation, val); if (num > 5f) { float num2 = Mathf.Min(num * 0.1f, turnTorque * 0.7f); Vector3 val2 = Vector3.Cross(((Component)rootBone).transform.forward, normalized); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; if (!float.IsNaN(normalized2.x) && !float.IsNaN(normalized2.y) && !float.IsNaN(normalized2.z)) { rootBone.AddTorque(normalized2 * num2); } } float num3 = Mathf.Clamp01(1f - num / 90f); Vector3 val3 = ((Component)rootBone).transform.forward * speed * num3; float num4 = Vector3.Angle(((Component)rootBone).transform.up, Vector3.up); if (num4 > 10f) { val3 *= Mathf.Max(0f, 1f - (num4 - 10f) / 30f); } rootBone.AddForce(val3, (ForceMode)0); Vector3 velocity = rootBone.velocity; if (((Vector3)(ref velocity)).magnitude > maxSpeed * 0.8f) { Vector3 val4 = -rootBone.velocity * rootBone.drag * 0.3f; rootBone.AddForce(val4, (ForceMode)5); } } private void MaintainStability() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)rootBone == (Object)null) && !(Time.time - lastStabilityCorrection < stabilityCorrectionInterval)) { float num = Vector3.Angle(((Component)rootBone).transform.up, Vector3.up); if (!(num < 12f) && num > maxTiltAngle) { Vector3 val = Vector3.Cross(((Component)rootBone).transform.up, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; float num2 = antiTiltForce * 0.6f * Mathf.Clamp01((num - maxTiltAngle) / 30f); rootBone.AddTorque(normalized * num2); lastStabilityCorrection = Time.time; } } } private void PreventIdleRotation() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)rootBone == (Object)null)) { if (!initialRotationSet) { initialIdleRotation = ((Component)rootBone).transform.rotation; initialRotationSet = true; targetRotation = initialIdleRotation; hasTargetRotation = true; } Vector3 angularVelocity = rootBone.angularVelocity; if (((Vector3)(ref angularVelocity)).magnitude > 0.5f) { Vector3 val = -rootBone.angularVelocity * 6f; rootBone.AddTorque(val); } float num = Quaternion.Angle(((Component)rootBone).transform.rotation, initialIdleRotation); if (num > 25f) { Vector3 up = Vector3.up; float num2 = Mathf.Min(num * 0.3f, 2f); rootBone.AddTorque(up * num2); } } } public void SetTarget(Transform newTarget) { target = newTarget; if ((Object)(object)newTarget != (Object)null) { initialRotationSet = false; } } public void SetSpeed(float newSpeed) { speed = Mathf.Clamp(newSpeed, 0f, maxSpeed); } public void StopMoving() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) speed = 0f; if ((Object)(object)rootBone != (Object)null) { rootBone.velocity = Vector3.zero; rootBone.angularVelocity = Vector3.zero; } } public void ResetStance() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rootBone != (Object)null) { rootBone.velocity = Vector3.zero; rootBone.angularVelocity = Vector3.zero; ((Component)rootBone).transform.rotation = Quaternion.identity; initialRotationSet = false; } } private void OnDestroy() { if ((Object)(object)agent != (Object)null) { Object.Destroy((Object)(object)((Component)agent).gameObject); } if ((Object)(object)tarl != (Object)null) { Object.Destroy((Object)(object)tarl); } if ((Object)(object)tarR != (Object)null) { Object.Destroy((Object)(object)tarR); } if ((Object)(object)skel != (Object)null) { Object.Destroy((Object)(object)skel); } if ((Object)(object)dir != (Object)null) { Object.Destroy((Object)(object)dir); } } } public class tpsCamera : MonoBehaviour { public Transform targetTransform; public Camera Cam; public Vector3 CamOffset = Vector3.zero; public Vector3 ZoomOffset = Vector3.zero; public float senstivity = 50f; public float minY = 30f; public float maxY = 50f; public bool isZooming; private float currentX = 0f; private float currentY = 1f; public LayerMask wallLayer; private void Start() { Cursor.lockState = (CursorLockMode)1; } private void Update() { currentX += Input.GetAxis("Mouse X") * senstivity; currentY += Input.GetAxis("Mouse Y") * senstivity; currentX = Mathf.Repeat(currentX, 360f); currentY = Mathf.Clamp(currentY, minY, maxY); } private void LateUpdate() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((!isZooming) ? CamOffset : ZoomOffset); Quaternion val2 = Quaternion.Euler(currentY, currentX, 0f); ((Component)this).transform.position = targetTransform.position + val2 * val; ((Component)this).transform.LookAt(targetTransform.position); CheckWall(); } private void CheckWall() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) Vector3 position = targetTransform.position; Vector3 val = ((Component)this).transform.position - targetTransform.position; float num = CamOffset.z * -1f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(targetTransform.position, val, ref val2, num, LayerMask.op_Implicit(wallLayer))) { float distance = ((RaycastHit)(ref val2)).distance; Vector3 position2 = targetTransform.position + ((Vector3)(ref val)).normalized * distance; ((Component)this).transform.position = position2; } } }