EveryDay.DevUp

[Unity] Unity Easing 공식 본문

DotsTween

[Unity] Unity Easing 공식

EveryDay.DevUp 2020. 7. 12. 22:43

Tween은 시간의 흐름에 따라 특정한 값의 변화라고 할 수 있다. 가령 Fade In/Out Tween의 경우 시간의 흐름에 따라 Alpha의 값이 0 -> 1.0f, 1.0f -> 0으로 변화되는 것을 말한다.

시간의 흐름에 따라 변화되는 값이 선형적일 수도 있고, 특정 시간에서는 빠르고, 특정 시간에서는 느리고 하는 형태로 변화될 수도 있다.이런 시간의 따라 변화하는 모양이 어떻게 되는지를 easing 이라고 한다.

Unity에서만, 게임에서만 easing 이 사용되는 것은 아니다. 웹 페이지에서도 easing 이 사용되며, 여러 영상 매체 편집 툴 포토샵 등에서도 easing 이 사용된다. 그렇기 때문에 easing 에는 정형화된 공식이 존재하며 해당 공식에 값을 대입하는 것만으로도 원하는 easing 의 효과를 나타낼 수 있다.

easing 의 공식은 Unity의 Asset Store에서 ITween을 다운로드 받아서, 코드에서 어떻게 사용하고 있는 지를 확인할 수도 있고, 구글에서 easing 공식으로 검색했을 때 나오는 게시물에서도 확인할 수 있다.

easing 공식

https://easings.net/

 

Easing Functions Cheat Sheet

Easing functions specify the speed of animation to make the movement more natural. Real objects don’t just move at a constant speed, and do not start and stop in an instant. This page helps you choose the right easing function.

easings.net

Unity easing 구현

https://gist.github.com/cjddmut/d789b9eb78216998e95c

 

Easing Functions for Unity3D

Easing Functions for Unity3D. GitHub Gist: instantly share code, notes, and snippets.

gist.github.com