当前位置: 首页>>代码示例>>C#>>正文


C# MazeDirection.ToRotation方法代码示例

本文整理汇总了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();
	}
开发者ID:papakaliati,项目名称:simplePrototypeOfPrototype,代码行数:7,代码来源:MazeObject.cs

示例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();
	}
开发者ID:Zoltaris,项目名称:MinotaurMaze,代码行数:9,代码来源:MazeCellEdge.cs

示例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();
    }
开发者ID:iangonzalez,项目名称:mouse-in-a-maze-game,代码行数:21,代码来源:MazeCell.cs

示例4: Look

 private void Look(MazeDirection direction)
 {
     transform.localRotation = direction.ToRotation();
     currentDirection = direction;
 }
开发者ID:futamiyuuki,项目名称:Unity-Chan,代码行数:5,代码来源:Player.cs


注:本文中的MazeDirection.ToRotation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。