本文整理汇总了C#中Directions.ToEuler方法的典型用法代码示例。如果您正苦于以下问题:C# Directions.ToEuler方法的具体用法?C# Directions.ToEuler怎么用?C# Directions.ToEuler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Directions
的用法示例。
在下文中一共展示了Directions.ToEuler方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Turn
protected virtual IEnumerator Turn(Directions dir)
{
TransformLocalEulerTweener t = (TransformLocalEulerTweener)transform.RotateToLocal (dir.ToEuler (), 0.25f, EasingEquations.EaseInOutQuad);
if (Mathf.Approximately (t.startTweenValue.y, 0f) && Mathf.Approximately (t.endTweenValue.y, 270f))
t.startTweenValue = new Vector3 (t.startTweenValue.x, 360f, t.startTweenValue.z);
else if (Mathf.Approximately (t.startTweenValue.y, 270f) && Mathf.Approximately (t.endTweenValue.y, 0f))
t.endTweenValue = new Vector3 (t.startTweenValue.x, 360f, t.startTweenValue.z);
unit.dir = dir;
while (t != null)
yield return null;
}
示例2: Turn
protected virtual IEnumerator Turn(Directions dir)
{
TransformLocalEulerTweener t = (TransformLocalEulerTweener)transform.RotateToLocal(dir.ToEuler(), 0.25f, EasingEquations.EaseInOutQuad);
// When rotating between North and West, we must make an exception so it looks like the unit
// rotates the most efficient way (since 0 and 360 are treated the same)
if (Mathf.Approximately(t.startValue.y, 0f) && Mathf.Approximately(t.endValue.y, 270f))
t.startValue = new Vector3(t.startValue.x, 360f, t.startValue.z);
else if (Mathf.Approximately(t.startValue.y, 270) && Mathf.Approximately(t.endValue.y, 0))
t.endValue = new Vector3(t.startValue.x, 360f, t.startValue.z);
unit.Dir = dir;
while (t != null)
yield return null;
}