1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 09:16:02 +08:00
2020-01-17 00:11:15 +09:00

25 lines
577 B
C#

using UnityEngine;
using System.Collections;
using DG.Tweening;
public class SafeMode : BrainBase
{
public Transform target0, target1;
public GameObject nullGO;
IEnumerator Start()
{
DOTween.Init();
DOTween.useSafeMode = true;
yield return new WaitForSeconds(0.7f);
// Tween that will fail on callback
target0.DOMoveX(4, 1).SetRelative().OnComplete(()=> Debug.Log(nullGO.transform));
// Tween whose target will be destroyed at half tween
target1.DOMoveX(4, 1).SetRelative();
yield return new WaitForSeconds(0.5f);
Destroy(target1.gameObject);
}
}