“This is the second day of my participation in the First Challenge 2022, for more details: First Challenge 2022”.
👉 About the author
As we all know, life is a long process of constantly overcoming difficulties and reflecting on progress. In this process, there will be a lot of questions and thoughts about life, so I decided to share my thoughts, experiences and stories to find resonance!!
Focus on Android/Unity and various game development tips, as well as various resource sharing (websites, tools, materials, source code, games, etc.)
Welcome to pay attention to the public account [Mr. Empty name] for more resources and communication!
👉 premise
During this period of time, I learned a Unity framework and prepared to apply it to the actual project, but it was difficult for me to learn because the author could not see the end of the framework and did not have any detailed documents. Fortunately, the author opened all the contents of the framework and recorded the learning process again.
👉 Practice
😜 Framework step 2 -UI
Now that we’ve done the scene in the last section, it’s time to start working on the UI. The UI isn’t all directly displayed in the scene, some of it needs to be loaded dynamically from resources. Let me go straight to the last step, just to visualize it a little bit better.
- The code loads the UI prefab with the UIComponent component, focusing on the second parameter, which groups and hierarchically manages the UI
- Go back to the editor and find the GameFramework-UI object, which has a UI Groups property to set
- The prefab needs to mount scripts, which need to inherit UIFormLogic scripts, which are UI control scripts, in order to be managed by the framework
This set down, it is really as smooth as flowing clouds, more and more convenient. Keep learning to see how many surprises the framework has left.
Smooth fart ah, small empty ran back to update, learn how to discover after UI also can’t come, ah, is to play with you, is not out. I stepped in a hole.
UI, UI, UI, I said UI, I didn’t do Cnavas, confused. Following the steps above, the third prefab is where you lay out the UI controls and then make the Canvas into a prefab. Success looks like this (below) :
Another thing to note is that when you run it, you will find no UI components in the scene. In fact, any UI created by the Framework through UIComponent will run underneath the UI in the Framework. No matter how many scenes you open, the UI is always in the frame’s scene.
As shown in the figure above, all under UI-UI Form Instances
👉 other
📢 author: Kom and Kom in Kom
📢 reprint instructions – be sure to specify the source: Zhim Granular’s personal home page – column – Nuggets (juejin. Cn)
📢 welcome to like 👍 collect 🌟 message 📝