本文整理汇总了C#中MazeDirection.ToRotation方法的典型用法代码示例。如果您正苦于以下问题:C# MazeDirection.ToRotation方法的具体用法?C# MazeDirection.ToRotation怎么用?C# MazeDirection.ToRotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MazeDirection
的用法示例。
在下文中一共展示了MazeDirection.ToRotation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public virtual void Initialize (MazeCell cell, MazeDirection direction = MazeDirection.North) {
this.cell = cell;
this.direction = direction;
transform.parent = cell.transform;
transform.localPosition = Vector3.zero;
transform.localRotation = direction.ToRotation();
}
示例2: Initialize
public void Initialize (MazeCell cell, MazeCell otherCell, MazeDirection direction) {
this.cell = cell;
this.otherCell = otherCell;
this.direction = direction;
cell.SetEdge(direction, this);
transform.parent = cell.transform;
transform.localPosition = Vector3.zero;
transform.localRotation = direction.ToRotation();
}
示例3: AddSignPost
//initialize a directional signpost pointing in direction dir and in a quadrant of the cell not
//containing the player located at playerPosition.
public void AddSignPost(MazeDirection dir, Vector3 playerPosition) {
if (signpostInstance != null) {
return;
}
signpostInstance = Instantiate(signpostPrefab) as DirectionalSignPost;
signpostInstance.transform.parent = transform;
Vector3 relativePos = playerPosition - transform.localPosition;
signpostInstance.transform.localPosition = new Vector3(
(relativePos.x <= 0 ? 0.25f : -0.25f),
-1.5f,
(relativePos.z <= 0 ? 0.25f : -0.25f)
);
signpostInstance.transform.localRotation *= dir.ToRotation();
}
示例4: Look
private void Look(MazeDirection direction)
{
transform.localRotation = direction.ToRotation();
currentDirection = direction;
}