コード例 #1
0
ファイル: TiledNavMesh.cs プロジェクト: dol-leodagan/SharpNav
        /// <summary>
        /// Get the base reference for the polygons in a tile.
        /// </summary>
        /// <param name="tile">Current Tile</param>
        /// <returns>Base poly reference</returns>
        public PolyId GetPolyRefBase(MeshTile tile)
        {
            if (tile == null)
            {
                return(PolyId.Null);
            }

            int it = 0;

            for (int i = 0; i < tiles.Length; i++)
            {
                if (tiles[i] == tile)
                {
                    it = i;
                    break;
                }
            }

            return(PolyId.Encode(polyBits, tileBits, tile.Salt, it, 0));
        }