mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 01:06:02 +08:00
21 lines
717 B
C#
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);
|
|
}
|
|
} |