Custom Animation Curve 사용법
DOTween에서 제공하는 기본 easing 옵션 대신, **AnimationCurve**를 사용하여 직접 커브를 정의할 수 있다.
이를 통해 특정 시점에서 느려지는 정도를 조절할 수 있다!

// AnimationCurve를 정의
AnimationCurve customCurve = new AnimationCurve(
new Keyframe(0, 0), // 시작점
new Keyframe(0.5f, 0.8f), // 중간점
new Keyframe(1, 1) // 끝점
);
// DOTween에서 커브를 적용
subPos.DOAnchorPosX(subPos.anchoredPosition.x - 1500, 0.25f)
.SetEase(customCurve);
키프레임을 추가하여 특정 시점에서의 속도 변화를 세밀하게 제어할 수 있다

반응형
'유니티 C# 함수 사용 정리' 카테고리의 다른 글
[SetUpdate] DOTween 애니메이션이 스마트폰에서 끊기는 듯한 현상이 보인다면? (0) | 2024.12.18 |
---|---|
Try-catch (+finally) 알아보기 (0) | 2024.06.09 |
리스트 -> 딕셔너리, 숫자 카운트 및 지정 횟수 미만인 숫자를 리스트로 반환하는 메서드 (0) | 2024.05.12 |
[LINQ] 확장 메서드 (0) | 2024.05.09 |
Resources 폴더에서 Atlas를 찾아 image 반환하기 (0) | 2024.03.25 |