1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 01:06:02 +08:00
dotween-upm-fork/UnityTests.Unity5/Assets/_Tests/PureQuaternionPluginTests.cs
2015-10-29 12:28:01 +01:00

21 lines
717 B
C#

using UnityEngine;
using System.Collections;
using DG.Tweening;
using DG.Tweening.CustomPlugins;
public class PureQuaternionPluginTests : BrainBase
{
public Transform target;
public Transform toTarget;
public Vector3 to;
public bool isRelative;
public bool useShortcut = true;
public bool useToTarget;
IEnumerator Start()
{
yield return new WaitForSeconds(0.5f);
if (useShortcut) target.DORotateQuaternion(useToTarget ? toTarget.rotation : Quaternion.Euler(to), 3).SetLoops(-1, LoopType.Yoyo).SetRelative(isRelative);
else DOTween.To(PureQuaternionPlugin.Plug(), ()=> target.rotation, x=> target.rotation = x, useToTarget ? toTarget.rotation : Quaternion.Euler(to), 3).SetRelative(isRelative);
}
}