本文整理汇总了C#中GameObject.Rotate方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.Rotate方法的具体用法?C# GameObject.Rotate怎么用?C# GameObject.Rotate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObject
的用法示例。
在下文中一共展示了GameObject.Rotate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: autoHover
private void autoHover()
{
{
Vector3 heading = (Vector3d)this.vessel.transform.up;
Vector3d up = (this.vessel.rigidbody.position - this.vessel.mainBody.position).normalized;
Transform partTransform = part.FindModelTransform(targetPartObject);
Transform modifiedUp = new GameObject().transform;
modifiedUp.rotation = Quaternion.LookRotation(up, heading);
modifiedUp.Rotate(new Vector3(-90,0,180));
partTransform.localRotation = Quaternion.Euler(currentRotation + new Vector3(defaultRotationX, defaultRotationY, defaultRotationZ));
partTransform.rotation = Quaternion.RotateTowards(partTransform.rotation, modifiedUp.rotation, steerAmount*4);
}
}
示例2: DeleteVisualObstacles
private void DeleteVisualObstacles()
{
Transform visualObstacle;
for (int i = 0; i < visualObstacles.Count; i++)
{
visualObstacle = visualObstacles[i].transform;
if (visualObstacle.position.z + 150.0f < playerZPosition)
{
visualObstacle.Rotate (Vector3.zero);
visualObstacle.gameObject.SetActive(false);
visualObstacles.Remove(visualObstacle.gameObject);
loadedVisualObstacles.Add(visualObstacle.gameObject);
}
}
}
示例3: DeleteVisualObstacles
private void DeleteVisualObstacles()
{
Transform visualObstacle;
for (int i = 0; i < visualObstacles.Count; i++)
{
visualObstacle = visualObstacles[i].transform;
if (visualObstacle.position.z + 150.0f < playerZPosition)
{
if (visualObstacle.gameObject.layer == 10)
{
loadedVisualObstacles.Insert(0, visualObstacle.gameObject);
}
else if (visualObstacle.gameObject.layer == 11)
{
loadedVisualObstacles.Insert(numberOfCopiesOfEachObstacle * numberOfObstaclesInEachDifficultyLevel, visualObstacle.gameObject);
}
else if (visualObstacle.gameObject.layer == 12)
{
loadedVisualObstacles.Add(visualObstacle.gameObject);
}
visualObstacle.Rotate(Vector3.zero);
visualObstacle.gameObject.SetActive(false);
visualObstacles.Remove(visualObstacle.gameObject);
limit++;
}
}
}