Easily Manage the State of Your UI With This Pattern to Save Yourself Headaches | Unity Tutorial

Поделиться
HTML-код
  • Опубликовано: 8 янв 2025

Комментарии • 45

  • @lolgube
    @lolgube Год назад +22

    It’s recommended that you have multiple canvases with a single UI object rather than having a single canvas with multiple UI as child objects. This is because each time a canvas is active, it is going through every single child object checking to see if it needs to be rendered on screen, if it is active and enabled, etc.

  • @TheGravityChannel
    @TheGravityChannel 3 года назад +13

    Hi, I haven't finished the video yet but I will as I found your way of making the UI interesting from the Intro alone, I just wanted to share a piece of advice, many people for some reason use Awake to grab components but an even better alternative would be to grab them in Editor just to save a bunch of operations during gameplay. Monobehaviour provides a method called Reset() which is called when a component is added or reset. With that you can grab everything you need even before a build.

  • @Ferenc-Racz
    @Ferenc-Racz 9 месяцев назад +1

    I just strugled with the UI in the past few months and finally I figured it on myshelf how it worth to do.. Definetelly the way as you suggest it also. So I dont know how much people undeerstood it (from the like giving peoples) but this video is more important as it seems at the first time. Thank you for it. I will consider your suggestions and improve my game with them.

  • @Teacher_Ali
    @Teacher_Ali 3 года назад +2

    Love your energy and enthusiasm

  • @audemkay
    @audemkay 3 года назад +2

    This is so useful! Thank you!

  • @rodgarcialima
    @rodgarcialima Год назад +4

    Thank you for this video, it is the most informative video about Unity UI so far. I loved the Page concept, it helped me to organize and simplify my project UI. I did some changes, instead of keeping all the secondary pages visible and around the main, I'm keeping them inactive and activating/deactivating on the Enter/Exit events. Another change was moving the audio source out from the pages. Again, thank you for this video.

    • @LlamAcademy
      @LlamAcademy  Год назад +2

      Great additions! Glad this could help simplify your UI

  • @dopplegangerdavid
    @dopplegangerdavid 2 года назад +1

    This is essentially just the state pattern being used for menus. I often do the same thing myself.

    • @LlamAcademy
      @LlamAcademy  2 года назад

      Yes! Similar to a state machine!

  • @cyco3oy
    @cyco3oy 3 года назад +2

    awesome video thumb

  • @maximdaigle
    @maximdaigle Год назад +1

    I have a feeling this doesn't support controllers properly as the input focus isn't passed from active panel. So input made in one panel will also be caught in another panel. Am I right?

    • @LlamAcademy
      @LlamAcademy  Год назад +3

      You know what I haven't really worked too much with controllers, but I imagine you can set the Page GameObject to active as a PostPopAction and enable it as a PrePopAction and that should update the focus to the newly activated page

    • @maximdaigle
      @maximdaigle Год назад

      @@LlamAcademy Thank you for replying! The framework is great and the tutorial is great by the way! It was a great help.

  • @hassanshah2129
    @hassanshah2129 Год назад

    I used another script at my last page start button to load another scene and when i load back the menu scene again its gone

  • @sumnererhard8865
    @sumnererhard8865 2 года назад +1

    Great video as always! This seems to be the same system you have in Llama Survival and I'm curious about what happens after you press play? Are you loading a new scene when that happens or is all of this under one scene and you are just hiding the menu after the game is ready to start playing?

    • @LlamAcademy
      @LlamAcademy  2 года назад +2

      Hi! You are correct, it is the exact same system. When you click Play and it takes you to the level selection, that's just another Page on the same Canvas. Once you select the powerups and click ready, that's when a new scene is loaded. In the "Play" flow there are 3 pages - the main menu page where you have the Play button, tapping that gives you the level selection page, selecting a level is just some element on that page, difficulty will then open the Powerup selection page & trigger loading the scene in the background.
      That's actually why you can go back from the powerup selection screen. As far as I know there's no way to unload a scene loaded in the background. Once you select the powerup (or not) and click "ready" it just sets that background loaded scene to active and unloads the Main Menu scene.

  • @simonyeung198
    @simonyeung198 Год назад

    hi , i would like to know where can i download or get the player input , I was stuck in that part . thanks!

    • @LlamAcademy
      @LlamAcademy  Год назад

      This full project is on GitHub if you want to check it out. The link is up in the description

    • @simonyeung198
      @simonyeung198 Год назад

      got it , thanks!@@LlamAcademy

  • @alfonzo6320
    @alfonzo6320 Год назад +1

    9:06 DRY.

  • @poobagification
    @poobagification 3 года назад +1

    Your background is different. Are you traveling for the holidays?

  • @AlexGamingStudios
    @AlexGamingStudios 2 года назад +1

    Rezo?

  • @M451D4T
    @M451D4T 3 года назад

    could you make a c ++ basics tutorial that explains what different things are

    • @LlamAcademy
      @LlamAcademy  3 года назад

      I could do that for C#, but I haven't done C++ in over 10 years.
      Code Monkey has a pretty good introductory series on C#: ruclips.net/video/IFayQioG71A/видео.html

    • @M451D4T
      @M451D4T 3 года назад

      @@LlamAcademy my brai. Always just been u it’s is a c language nave which it is XD thanks

  • @mohamedmusthafa1057
    @mohamedmusthafa1057 Год назад

    I think here Dotween gug combination😊

  • @Raccoon0710
    @Raccoon0710 3 года назад +1

    Great video 😎👍 where do you find motivation to do videos? 🙂 I cant start my own series on RUclips already 2 years. Probably I am not afraid, but every time I find some excuses and other tasks to do.. 😔🤷🏻‍♂️

    • @LlamAcademy
      @LlamAcademy  3 года назад +4

      For me I've always wanted to do some kind of teaching and this was a way I could achieve that. The hard part wasn't to get started, but to make sure every week there's new content for you all. You have to make up in your mind that you are willing to, and want to put in that much effort into something. I want to help others make their game dev dream become a reality and continue my game development full time. I believe the way to do that is to consistently put out the best content I can every week, and that will help people. My dream and my passion are what motivate me

    • @Raccoon0710
      @Raccoon0710 3 года назад +1

      @@LlamAcademy I thought you are already working in game dev 🙂you have good knowledge. It’s already enough

    • @LlamAcademy
      @LlamAcademy  3 года назад +4

      I do work in game development, just not full time. I have another job that pays most of the bills. I've been doing game development before/after my other job since 2015

  • @dustypants9326
    @dustypants9326 3 года назад +1

    ice nine kills :D

  • @Vyrulian
    @Vyrulian 11 месяцев назад +1

    You made a 22 minute video about stuff I do not care about. I thought this was about managing the state of the UI. If I wanted to watch a video about fading in, fading out, sliding in, sliding out, audio this, audio that, i would have searched for a video about that. I thought this was about managing the state of the UI. This could have been a five minute video.

  • @pulpxi
    @pulpxi 2 года назад

    Rezo clone

    • @LlamAcademy
      @LlamAcademy  2 года назад

      Sorry I don’t understand what you mean.

    • @sadbuttrue666
      @sadbuttrue666 2 года назад

      @@LlamAcademy Rezo is an large german guy from youtube with colored hair. Not very deep into coding and not into Unity. The commentor tries to be funny I guess.