Пример #1
0
    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);
        }
    }
Пример #2
0
    private void OnCollisionExit(Collision collision)
    {
        GameObject gameObject = collision.gameObject;

        if (PhysicsSfx.IsSlideObject(gameObject))
        {
            this.slideObjects.Remove(gameObject);
        }
    }