How to create UI animation with code in Unity | UI Tweening

Опубликовано: 17 Июнь 2024
на канале: Christina Creates Games
3,165
154

Animate your UI elements in Unity by code! We'll use tweening for this, but won't use any outside asset and instead write our own. We write a script that handles the animation of an element's position and alpha and go a step further by visualizing the locations it will end up in with Gizmos. That takes a lot off guesswork out of finding the correct distances and placements when creating your UI.

You will learn:
How to move a UI element by code (tweening)
How to animate position and alpha by code
How to work with Gizmos (Visualisation Helpers)
How to use the [Button] and [ShowIf] attribute of Odin Inspector in case you have the asset (it is not needed for this tutorial, but I enjoy working with it and maybe you do, too)
How to use [ContextMenu] to create quick access to methods in the inspector for testing

Get Odin Inspector here:
https://assetstore.unity.com/packages... [affiliate]

✍️ Github
https://github.com/Maraakis/Christina...

💬 Discord 💛
You are very welcome to join!   / discord  

🛍️ Affiliate links 🛍️
If you'd like to support my channel, please use my affiliate links when buying cool stuff:
My favourite assets I install by default into every project: https://assetstore.unity.com/lists/hi... [affiliate]
Humblebundle: https://www.humblebundle.com/?partner... [Affiliate link]
Synty Store: https://syntystore.com/98327 [affiliate]

🎮 Play my games on Itch.io 🎮
https://christinacreatesgames.itch.io

🔖 Chapters ℹ️
00:00 The results of this tutorial
00:53 Core setup
01:21 Creating the animation script
08:27 Testing the ui animation results
09:06 Preview of the visualizations
09:33 Creating the visualizations with OnDrawGizmo
14:31 Conclusions



#unitytutorial


Смотрите видео How to create UI animation with code in Unity | UI Tweening онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Christina Creates Games 17 Июнь 2024. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 3,165 раз и оно понравилось 154 посетителям.