コード例 #1
0
 private unsafe void MarkExploredDirections(ref MyNavmeshComponents.ClosedCellInfo cellInfo)
 {
     foreach (Base6Directions.Direction direction in Base6Directions.EnumDirections)
     {
         Base6Directions.DirectionFlags directionFlag = Base6Directions.GetDirectionFlag(direction);
         if (!cellInfo.ExploredDirections.HasFlag(directionFlag))
         {
             Vector3I    intVector = Base6Directions.GetIntVector(direction);
             MyCellCoord coord     = new MyCellCoord {
                 Lod        = 0,
                 CoordInLod = (Vector3I)(this.m_currentCell + intVector)
             };
             if (((coord.CoordInLod.X != -1) && (coord.CoordInLod.Y != -1)) && (coord.CoordInLod.Z != -1))
             {
                 ulong key = coord.PackId64();
                 if (this.m_triangleLists.ContainsKey(key))
                 {
                     this.m_navmeshComponents.MarkExplored(key, Base6Directions.GetFlippedDirection(direction));
                     Base6Directions.DirectionFlags *flagsPtr1 = (Base6Directions.DirectionFlags *) ref cellInfo.ExploredDirections;
                     *((sbyte *)flagsPtr1) = *(((byte *)flagsPtr1)) | Base6Directions.GetDirectionFlag(direction);
                 }
             }
         }
     }
     this.m_navmeshComponents.SetExplored(this.m_packedCoord, cellInfo.ExploredDirections);
 }
コード例 #2
0
        public unsafe void MarkExplored(ulong otherCell, Base6Directions.Direction direction)
        {
            CellInfo info = new CellInfo();

            if (this.m_cellInfos.TryGetValue(otherCell, out info))
            {
                Base6Directions.DirectionFlags *flagsPtr1 = (Base6Directions.DirectionFlags *) ref info.ExploredDirections;
                *((sbyte *)flagsPtr1)       = *(((byte *)flagsPtr1)) | Base6Directions.GetDirectionFlag(direction);
                this.m_cellInfos[otherCell] = info;
            }
        }