SharpNav.TiledNavMesh.IsValidPolyRef C# (CSharp) Method

IsValidPolyRef() public method

Check if polygon reference is valid.
public IsValidPolyRef ( NavPolyId reference ) : bool
reference NavPolyId Polygon reference
return bool
        public bool IsValidPolyRef(NavPolyId reference)
        {
            if (reference == NavPolyId.Null)
                return false;

            int salt, polyIndex, tileIndex;
            idManager.Decode(ref reference, out polyIndex, out tileIndex, out salt);

            if (tileIndex >= maxTiles)
                return false;

            if (tileList[tileIndex].Salt != salt)
                return false;

            if (polyIndex >= tileList[tileIndex].PolyCount)
                return false;

            return true;
        }