How to: Dynamic Scroll View in Unity

Описание к видео How to: Dynamic Scroll View in Unity

Learn how to make a dynamically sized scroll view UI in Unity Canvas easily.

ᐅGet the full Source Code Bundle to my Unity Tutorials 🤓
https://sam-yam.itch.io/samyam-full-s...

📥 Get the FULL Source Code 📥
  / 69275327  

Wishlist my new game BUMBI on Steam!
https://store.steampowered.com/app/28...

🤝 Support Me 🤝
Patreon:   / samyg  
Donate: https://ko-fi.com/samyam

First we need to add a scroll view to our scene, then under the Content gameobject you can add your item prefabs that will be in your scrollview. To make it dynamically resize the content of the Rect Transform based on the number of items, you either add a Horizontal Layout Group or a Vertical Layout Group to the Content Gameobject along with a Content Fitter component set to Preferred setting. Then to dynamically load objects in through code you can get a reference to your prefab, the list of items or images you want to spawn, loop over them and spawn them under the Content transform, and do other processing.

►🔗 Relevant Video Links 🔗
►Kenney UI Pack: Space Expansion
https://www.kenney.nl/assets/ui-pack-...
►Kenney Pixel Shmup
https://www.kenney.nl/assets/pixel-shmup

►⏱️ Timestamps ⏱️
0:00 Intro
0:05 Set up ScrollView
1:42 Horizontal Layout Group
3:53 Content Fitter
5:48 Dynamically Add Items Through Code
10:31 IPointerClickHandler
11:19 Outro

💖💖THANK YOU TO ALL MY PATRONS 💖💖

❯❯❯ My Links ❮❮❮
💗 Patreon 💗
  / samyg  
💬 Discord Server 💬
  / discord  
🐦 Twitter 🐦
  / samyam_utube  
📚 Facebook 📚
  / samyam.youtube  

👍 Like and Subscribe! 👍

🖥️ Computer Setup 🖥️
*As an Amazon Associate I earn from qualifying purchases.
https://www.amazon.com/shop/samyam

#unity3d #unitytutorial #gamedevelopment

Комментарии

Информация по комментариям в разработке