Struct HitFractionComparer
Comparer for sorting collider cast hits by hit fraction (distance)
Inherited Members
Namespace: Unity.CharacterController
Syntax
public struct HitFractionComparer : IComparer<ColliderCastHit>
Methods
Compare(ColliderCastHit, ColliderCastHit)
Compares two hits for sorting them by distance
Declaration
public int Compare(ColliderCastHit x, ColliderCastHit y)
Parameters
Type | Name | Description |
---|---|---|
ColliderCastHit | x | First hit |
ColliderCastHit | y | Second hit |
Returns
Type | Description |
---|---|
Int32 | Positive integer if the first hit has a greater distance; negative integer otherwise |