本文整理汇总了C#中Point.RelativeOrientationTo方法的典型用法代码示例。如果您正苦于以下问题:C# Point.RelativeOrientationTo方法的具体用法?C# Point.RelativeOrientationTo怎么用?C# Point.RelativeOrientationTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point.RelativeOrientationTo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PutTwoWayChunk
Chunk PutTwoWayChunk(Point currentPoint, Point parentPoint, Point otherPoint, double chamberProbability)
{
Chunk chunk = null;
if ((((int)parentPoint.RelativeOrientationTo(currentPoint) -
(int)otherPoint.RelativeOrientationTo(currentPoint)) % 2) == 0) {
chunk = PutSraightTwoWayChunk(currentPoint, parentPoint, otherPoint, chamberProbability);
} else {
chunk = PutCornerTwoWayChunk(currentPoint, parentPoint, otherPoint, chamberProbability);
}
return chunk;
}
示例2: PutThreeWayChunk
Chunk PutThreeWayChunk(Point currentPoint, Point parentPoint, Point otherPoint1, Point otherPoint2, double chamberProbability)
{
Chunk chunk = InstantiateChunk(threeWayCorridorPrefab, threeWayChamberPrefab, chamberProbability, currentPoint);
var orientationSum = (int)parentPoint.RelativeOrientationTo(currentPoint) +
(int)otherPoint1.RelativeOrientationTo(currentPoint) + (int)otherPoint2.RelativeOrientationTo(currentPoint);
if (orientationSum % 2 == 0) {
if (parentPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH ||
otherPoint1.RelativeOrientationTo(currentPoint) == Orientation.NORTH ||
otherPoint2.RelativeOrientationTo(currentPoint) == Orientation.NORTH) {
chunk.Rotate(Orientation.NORTH);
} else {
chunk.Rotate(Orientation.SOUTH);
}
} else {
if (parentPoint.RelativeOrientationTo(currentPoint) == Orientation.EAST ||
otherPoint1.RelativeOrientationTo(currentPoint) == Orientation.EAST ||
otherPoint2.RelativeOrientationTo(currentPoint) == Orientation.EAST) {
chunk.Rotate(Orientation.EAST);
} else {
chunk.Rotate(Orientation.WEST);
}
}
Debug.Log ("Putting ThreeWayChunk at " + currentPoint + " with orientation towards " + chunk.chunkOrientation);
return chunk;
}
示例3: PutCornerTwoWayChunk
Chunk PutCornerTwoWayChunk(Point currentPoint, Point parentPoint, Point otherPoint, double chamberProbability)
{
Chunk chunk = InstantiateChunk(cornerPrefab, cornerChamberPrefab, chamberProbability, currentPoint);
if ((parentPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH &&
otherPoint.RelativeOrientationTo(currentPoint) == Orientation.EAST) ||
(parentPoint.RelativeOrientationTo(currentPoint) == Orientation.EAST &&
otherPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH)) {
chunk.Rotate(Orientation.NORTH);
} else if ((parentPoint.RelativeOrientationTo(currentPoint) == Orientation.EAST &&
otherPoint.RelativeOrientationTo(currentPoint) == Orientation.SOUTH) ||
(parentPoint.RelativeOrientationTo(currentPoint) == Orientation.SOUTH &&
otherPoint.RelativeOrientationTo(currentPoint) == Orientation.EAST)) {
chunk.Rotate(Orientation.EAST);
} else if ((parentPoint.RelativeOrientationTo(currentPoint) == Orientation.SOUTH &&
otherPoint.RelativeOrientationTo(currentPoint) == Orientation.WEST) ||
(parentPoint.RelativeOrientationTo(currentPoint) == Orientation.WEST &&
otherPoint.RelativeOrientationTo(currentPoint) == Orientation.SOUTH)) {
chunk.Rotate(Orientation.SOUTH);
} else if ((parentPoint.RelativeOrientationTo(currentPoint) == Orientation.WEST &&
otherPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH) ||
(parentPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH &&
otherPoint.RelativeOrientationTo(currentPoint) == Orientation.WEST)) {
chunk.Rotate(Orientation.WEST);
}
Debug.Log ("Putting CornerChunk at " + currentPoint + " with orientation towards " + chunk.chunkOrientation);
return chunk;
}
示例4: PutSraightTwoWayChunk
Chunk PutSraightTwoWayChunk(Point currentPoint, Point parentPoint, Point otherPoint, double chamberProbability)
{
Chunk chunk = InstantiateChunk(twoWayCorridorPrefab, twoWayChamberPrefab, chamberProbability, currentPoint);
if (parentPoint.RelativeOrientationTo(currentPoint) == Orientation.SOUTH ||
parentPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH) {
chunk.Rotate(Orientation.NORTH);
} else {
chunk.Rotate(Orientation.EAST);
}
Debug.Log ("Putting TwoWayChunk at " + currentPoint + " with orientation towards " + chunk.chunkOrientation);
return chunk;
}
示例5: PutChamber
Chunk PutChamber(Point currentPoint, Point parentPoint)
{
var chunk = InstantiateChunk(chamberPrefab, chamberPrefab, chamberProbability, currentPoint);
chunk.Rotate(parentPoint.RelativeOrientationTo(currentPoint));
Debug.Log ("Putting Chamber at " + currentPoint + " with orientation towards " + chunk.chunkOrientation);
return chunk;
}