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


C# Directions.ToEuler方法代码示例

本文整理汇总了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;
    }
开发者ID:arthurwoo,项目名称:TaticsHero,代码行数:14,代码来源:Movement.cs

示例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;
    }
开发者ID:Policenaut,项目名称:Unity-SRPG,代码行数:16,代码来源:Movement.cs


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