1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-21 01:36:05 +08:00
dotween-upm-fork/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.cs

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));
});
}
}