using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Logging;
using DestinyScript;
using FistVR;
using H3MP;
using H3MP.Scripts;
using OtherLoader;
using RootMotion;
using RootMotion.FinalIK;
using RootMotion1.FinalIK;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
using UnityEngine.Serialization;
using UnityEngine.UI;
[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
{
internal class AircraftSeat : FVRInteractiveObject
{
public static Dictionary<FVRViveHand, AircraftSeat> currentSeat = new Dictionary<FVRViveHand, AircraftSeat>();
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<FVRMovementManager>();
}
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);
}
}
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 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_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_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_00a6: Unknown result type (might be due to invalid IL or missing references)
if (isdead)
{
cam.SetActive(true);
((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);
}
}
}
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<Animator>();
}
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);
}
}
}
}
}
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;
[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;
private void Awake()
{
_player = ((Component)Object.FindObjectOfType<FVRPlayerBody>()).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<FVRViveHand>();
rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent<FVRViveHand>();
}
else if ((Object)(object)GameManager.currentPlayerBody == (Object)(object)_h3mpbody)
{
leftHand = ((Component)_player.transform.Find("Controller (left)")).GetComponent<FVRViveHand>();
rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent<FVRViveHand>();
}
else
{
Object.Destroy((Object)(object)this);
}
}
public void OnPlayerBodyInit(FVRPlayerBody playerBody)
{
leftHand = ((Component)playerBody.LeftHand).GetComponent<FVRViveHand>();
rightHand = ((Component)playerBody.RightHand).GetComponent<FVRViveHand>();
}
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_02fd: 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_00a8: 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_0146: 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_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_0185: 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)
if ((Object)(object)_hands.CurrentInteractable != (Object)null)
{
_gameObejctOnHands = ((Component)_hands.CurrentInteractable).GetComponent<FVRInteractiveObject>();
_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)_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;
}
_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);
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);
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);
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);
_handAnimator.SetBool(_gun, true);
_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);
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 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);
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, false);
_handAnimator.SetBool(_mag, true);
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);
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);
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);
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;
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);
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()))
{
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);
}
}
}
namespace JerryComponent
{
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<Animator>();
}
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 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 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 PassOut : MonoBehaviour
{
private GM gm;
public SkinnedMeshRenderer skin;
public int mouth2;
public int eye3;
public int eye2;
private void Start()
{
gm = GameObject.Find("_GameManager(Clone)").GetComponent<GM>();
}
private void Update()
{
if (Time.frameCount % 30 == 0)
{
PassedOut();
Wake();
}
}
public void PassedOut()
{
float blendShapeWeight = skin.GetBlendShapeWeight(eye3);
if (gm.m_isDead && blendShapeWeight == 0f)
{
skin.SetBlendShapeWeight(eye2, 100f);
skin.SetBlendShapeWeight(mouth2, 50f);
}
}
public void Wake()
{
if (!gm.m_isDead)
{
skin.SetBlendShapeWeight(eye2, 0f);
skin.SetBlendShapeWeight(mouth2, 0f);
}
}
}
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 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 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;
}
}
}
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<Rigidbody>();
}
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 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<ParticleSystem>();
pbh = GameObject.Find("[CameraRig]Fixed").GetComponent<FVRPlayerBody>();
}
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);
}
}
}
}
namespace JerryLegsIK
{
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<Animator>();
vrRig = ((Component)this).GetComponent<VRRIG>();
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 @float = animator.GetFloat("D_X");
float float2 = animator.GetFloat("D_Y");
animator.SetBool("IsMoving", ((Vector3)(ref val2)).magnitude > speedTreshold);
animator.SetFloat("D_X", Mathf.Lerp(@float, Mathf.Clamp(val2.x, -99f, 99f), smoothing));
animator.SetFloat("D_Y", Mathf.Lerp(float2, Mathf.Clamp(val2.z, -99f, 99f), smoothing));
}
}
}
namespace JerryComponent
{
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);
}
}
}
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<Camera>()).transform.LookAt(mTarget.transform.position);
((Component)((Component)this).GetComponent<Camera>()).transform.position = ((Component)((Component)this).GetComponent<Camera>()).transform.position + mSpeed * Time.deltaTime * (mTarget.transform.position + mDistance - ((Component)((Component)this).GetComponent<Camera>()).transform.position);
}
}
public class IdleUpdate : StateMachineBehaviour
{
private float mIdleRayCast = 0.5f;
public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
{
((Component)animator).GetComponent<MecFootPlacer>().DisablePlant((AvatarIKGoal)0, 2f);
((Component)animator).GetComponent<MecFootPlacer>().DisablePlant((AvatarIKGoal)1, 2f);
}
public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
FootPlacementData footPlacementData = ((Component)animator).GetComponents<FootPlacementData>()[0];
FootPlacementData footPlacementData2 = ((Component)animator).GetComponents<FootPlacementData>()[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<Animator>();
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 @float = mAnim.GetFloat(mSpeed);
@float -= 1.5f * Time.deltaTime;
if (@float < 0f)
{
@float = 0f;
mAnim.SetBool(mMove, false);
}
mAnim.SetFloat(mSpeed, @float);
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 num = 1f;
float num2 = 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 float2 = mAnim.GetFloat(mSpeed);
if (flag)
{
float2 += Time.deltaTime;
if (float2 > 1f)
{
float2 = 1f;
}
}
else
{
float2 -= 2f * Time.deltaTime;
if (float2 < 0f)
{
float2 = 0f;
}
}
mAnim.SetFloat(mSpeed, float2);
}
else
{
float float3 = mAnim.GetFloat(mSpeed);
float3 -= Time.deltaTime;
if (float3 < 0f)
{
float3 = 0f;
}
mAnim.SetFloat(mSpeed, float3);
}
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<MecFootPlacer>().SetActive((AvatarIKGoal)0, mMecFPActive);
((Component)this).GetComponent<MecFootPlacer>().SetActive((AvatarIKGoal)1, mMecFPActive);
}
if (flag)
{
num = Vector3.Cross(mGOFwdVec, val3).y;
if (num != 0f)
{
num /= Mathf.Abs(num);
}
num2 = Vector3.Angle(mGOFwdVec, val3);
num2 *= TurnSpeed * Time.deltaTime;
((Component)this).gameObject.transform.Rotate(new Vector3(0f, num, 0f), num2, (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<MecFootPlacer>().EnablePlant((AvatarIKGoal)0, 2f);
((Component)animator).GetComponent<MecFootPlacer>().EnablePlant((AvatarIKGoal)1, 2f);
}
public override void OnStateUpdate(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
{
float @float = animator.GetFloat("speed");
float num = ((AnimatorStateInfo)(ref animatorStateInfo)).normalizedTime - Mathf.Floor(((AnimatorStateInfo)(ref animatorStateInfo)).normalizedTime);
float num2 = 0.5f - 0.25f * @float;
FootPlacementData[] components = ((Component)animator).GetComponents<FootPlacementData>();
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)num > 0.5 && num < 0.5f + num2)
{
footPlacementData.mExtraRayDistanceCheck = 0.7f;
}
else
{
footPlacementData.mExtraRayDistanceCheck = -0.2f;
}
break;
case FootPlacementData.LimbID.RIGHT_FOOT:
footPlacementData = components[b];
if (num < num2)
{
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 * @float;
}
}
}
public class PelvisSet : StateMachineBehaviour
{
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
((Component)animator).GetComponent<MecFootPlacer>().mAdjustPelvisVertically = true;
}
}
public class PelvisUnset : StateMachineBehaviour
{
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
((Component)animator).GetComponent<MecFootPlacer>().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<Animator>().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<Animator>();
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<Animator>();
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 footP