Exemplo n.º 1
0
 public override void FixedUpdateVehicle()
 {
     if (m_lapTimer != null && !VerifyOnTrack())
     {
         m_lapTimer.InvalidateLap();
     }
 }
        void OnTriggerEnter(Collider other)
        {
            if (!enabled)
            {
                return;
            }

            Rigidbody otherRigidbody = other.attachedRigidbody;

            if (otherRigidbody != null &&
                (vehicleLayers & (1 << otherRigidbody.gameObject.layer)) != 0 &&
                otherRigidbody.velocity.magnitude > maxAllowedSpeed)
            {
                m_lapTimer.InvalidateLap();

                if (debugInfo)
                {
                    Debug.Log(this.ToString() + ": LAP INVALIDATED!");
                }
            }
        }