コード例 #1
0
        private static int DefaultScale(ref GhostConnectionPosition connectionPosition, ref int3 TileSize, ref int3 TileCenter, ref int3 chunkTile, int basePriority)
        {
            var centerTile = ((int3)connectionPosition.Position - TileCenter) / TileSize;
            var delta      = chunkTile - centerTile;
            var distSq     = math.dot(delta, delta);

            basePriority *= 1000;
            // 3 makes sure all adjacent tiles are considered the same as the tile the connection is in - required since it might be close to the edge
            if (distSq > 3)
            {
                basePriority /= distSq;
            }
            return(basePriority);
        }
コード例 #2
0
 private static int NoScale(ref GhostConnectionPosition connectionPosition, ref int3 TileSize, ref int3 TileCenter, ref int3 pos, int basePrio)
 {
     return(basePrio);
 }