private void OnCollisionEnter(Collision collision) { GameObject gameObject = collision.gameObject; if (PhysicsSfx.IsSlideObject(gameObject)) { this.slideObjects.Add(gameObject); } if (this.waitingForSpawnTimeout) { return; } if (collision.contacts.Length < 1) { return; } if (gameObject.CompareTag("Player")) { return; } if (this.impactEnabled && collision.relativeVelocity.sqrMagnitude > this.sqrImpactSpeedThreshold) { FMODCommon.PlayOneshot(this.impactEvent, collision.contacts[0].point, new object[] { "speed", collision.relativeVelocity.magnitude }); this.impactEnabled = false; base.Invoke("EnableImpact", this.impactRetriggerTimeout); } }
private void OnCollisionExit(Collision collision) { GameObject gameObject = collision.gameObject; if (PhysicsSfx.IsSlideObject(gameObject)) { this.slideObjects.Remove(gameObject); } }