// Token: 0x06000245 RID: 581 RVA: 0x000110F0 File Offset: 0x0000F2F0 private void AddForces() { this.colliders = Physics.OverlapSphere(base.transform.position, this.explosionRadius); for (int i = 0; i < this.colliders.Length; i++) { AntiTouchSystem.KillPlayer(this.colliders[i].transform.root.GetComponent <PlayerSettings>()); AntiTouchSystem.KillSmartRagdoll(this.colliders[i].transform); this.FractureObjects(this.colliders[i].transform); Rigidbody component = this.colliders[i].GetComponent <Rigidbody>(); if (component != null) { if (this.dismemberRagdolls && UnityEngine.Random.Range(0, 4) == 0) { RagdollSettings.DismemberJoint(component.transform); } component.AddExplosionForce(this.explosionPower, base.transform.position, this.explosionRadius, 0f, ForceMode.Impulse); component.AddTorque(Vector3.Normalize(base.transform.position - component.position)); } this.anotherMine = this.colliders[i].transform.GetComponentInParent <Mine>(); if (this.anotherMine != null) { this.anotherMine.remoteDetonate = true; } } }
protected override void GatherDependenciesIfNecessary(Animator animator) { if (!settings) { settings = animator.GetComponent <RagdollAnimator>().RagdollSettings; } }
// Token: 0x06000223 RID: 547 RVA: 0x00010884 File Offset: 0x0000EA84 private void FixedUpdate() { if (Physics.Raycast(base.transform.position, base.transform.forward, out this.hit, float.PositiveInfinity, this.laserLayerMask) && this.laserOn) { this.laserDistance = this.hit.distance; RagdollSettings.DismemberJoint(this.hit.transform); this.CheckForMine(this.hit.transform); this.audioSourceBeamHit.volume = 1f; this.audioSourceBeamHit.transform.position = this.hit.point; } else { this.audioSourceBeamHit.volume = 0f; this.laserDistance = 2000f; } if (this.laserOn) { this.laserLight.localPosition = new Vector3(0f, 0f, this.laserDistance); this.laserBeam.SetPosition(1, new Vector3(0f, 0f, this.laserDistance)); } this.audioSourceBeamHit.gameObject.SetActive(this.laserOn); this.audioSourceBeam.gameObject.SetActive(this.laserOn); this.laserLight.gameObject.SetActive(this.laserOn); this.laserBeam.gameObject.SetActive(this.laserOn); }
void OnEnable() { settings = GetComponent <RagdollSettings>(); bindings = GetComponent <RagdollDefinitionBindings>(); bindings.UnsubscribeFromOnBonesCreated(GatherColliders); bindings.SubscribeToOnBonesCreated(GatherColliders); EnsureMaterials(); }
// Token: 0x060001D7 RID: 471 RVA: 0x0000F20C File Offset: 0x0000D40C private void ShootPlayer() { RagdollSettings simulatedRagdoll = this.vehicle.playerControlling.simulatedRagdoll; Transform transform = simulatedRagdoll.bodyElements.ragdollJoints[0].transform; PlayerCameraController playerCameraController = this.vehicle.playerControlling.playerCameraController; simulatedRagdoll.RagdollModeEnabled = true; simulatedRagdoll.ResetRagdoll(); transform.eulerAngles = new Vector3(this.canonBarrel.eulerAngles.x + 90f, this.canonBarrel.eulerAngles.y, this.canonBarrel.eulerAngles.z); transform.position = this.BarrelEnd; for (int i = 0; i < simulatedRagdoll.rigidbodyChildren.Length; i++) { simulatedRagdoll.rigidbodyChildren[i].AddForce(this.canonBarrel.forward * this.shootStrength, ForceMode.Impulse); } playerCameraController.ResetLookRotation(new Vector3(0f, transform.eulerAngles.y, 0f)); }
// Token: 0x06000231 RID: 561 RVA: 0x00010BD8 File Offset: 0x0000EDD8 private void Detonate() { if (this.detonated || LevelManager.BuildModeOn) { return; } if (UIVersion.NukeEnabled) { this.colliders = Physics.OverlapSphere(this.mineObject.transform.position, 1000f); } else { this.colliders = Physics.OverlapSphere(this.mineObject.transform.position, this.radius); } for (int i = 0; i < this.colliders.Length; i++) { AntiTouchSystem.KillPlayer(this.colliders[i].transform.root.GetComponent <PlayerSettings>()); AntiTouchSystem.KillSmartRagdoll(this.colliders[i].transform); this.FractureObjects(this.colliders[i].transform); Rigidbody component = this.colliders[i].GetComponent <Rigidbody>(); if (component != null) { if (this.dismemberRagdolls && UnityEngine.Random.Range(0, 4) == 0) { RagdollSettings.DismemberJoint(component.transform); } if (UIVersion.NukeEnabled) { component.AddExplosionForce(5000f * ((component.mass < 10f) ? 1f : (component.mass * 0.1f)), this.mineObject.transform.position, 1000f, 0f, ForceMode.Impulse); } else { component.AddExplosionForce(this.power * ((component.mass < 10f) ? 1f : (component.mass * 0.1f)), this.mineObject.transform.position, this.radius, 0f, ForceMode.Impulse); } component.AddTorque(Vector3.Normalize(base.transform.position - component.position)); } this.anotherMine = this.colliders[i].transform.GetComponentInParent <Mine>(); if (this.anotherMine != null) { this.anotherMine.remoteDetonate = true; } } this.spawnedExplosion.transform.position = this.mineObject.transform.position; this.spawnedExplosion.SetActive(true); this.mineObject.SetActive(false); this.detonated = true; }