1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 17:26:03 +08:00
2015-03-18 19:30:48 +01:00

30 lines
619 B
C#

using DG.Tweening;
using UnityEngine;
public class TweenDuration : BrainBase
{
public Transform target;
void Start()
{
Tween();
}
void OnGUI()
{
DGUtils.BeginGUI();
if (GUILayout.Button("Tween")) Tween();
DGUtils.EndGUI();
}
void Tween()
{
float startTime = Time.realtimeSinceStartup;
target.DOMove(target.position + new Vector3(1, 2, 1), 1)
.OnStart(()=> Debug.Log("START > " + (Time.realtimeSinceStartup - startTime)))
.OnUpdate(()=> Debug.Log("UPDATE > frameCount: " + Time.frameCount))
.OnComplete(()=> Debug.Log("COMPLETE > " + (Time.realtimeSinceStartup - startTime)));
}
}