1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2026-02-04 22:34:56 +08:00
2020-01-17 00:11:15 +09:00

35 lines
855 B
C#

using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
public class IndexOutOfRangeOnKill02 : MonoBehaviour
{
public Transform target;
public RectTransform targetUI;
void Update()
{
if(Input.GetKeyUp(KeyCode.L)) ReproTweenBug();
}
void ReproTweenBugKiller()
{
target.DOKill(true);
targetUI.DOKill(true);
}
void ReproTweenBug()
{
ReproTweenBugKiller();
var rotation = 2 * 360;
var duration = rotation / 360f;
target.DORotate(new Vector3(0, 0, rotation), duration, RotateMode.FastBeyond360).SetEase(Ease.OutCubic)
.OnComplete(() => {
targetUI.DOAnchorPos(Vector2.zero, 0.4f).SetEase(Ease.InBack)
.OnComplete(() => targetUI.DOKill(true));
});
}
}