How to create a list in Unity3d 5 new gui system? Reason that Unity didn’t provide common list controls is that there are numerous ways these could be setup. They all depend on how you want your game to work. I’ll repeat Unity live training method here in written form. Original is here.
First create your base user interface, add ”Panel” from GameObject menu to hierarchy. This will be our container for list control, name it to ”Container”. Then we will add an empty GameObject to our ”Container”, name it to ”List Scroll”. This is where the actual list is going to be.
Next we need to add couple of components to ”List Scroll” gameobject. Lets add ”ScrollRect”, ”Image” and ”Mask” components.
ScrollRest is responsible of allowing content to be scrolled horizontally and/or vertically.
Image is a sprite that Mask component uses for masking.
Now we add a new ”Panel” to ”List Scroll” and name it ”List Content”. This will contain our list items.
”List Content” needs also couple of components: ”Vertical Layout Group” and ”Content Size Filter”.
Only thing that is left is the list item prefab. This is where solution depends on your needs. Basically you add a ”Button” to ”List Content” and then you customize it to your liking.
Add ”Layout Element” component to your button.
Next we need some scripting for populating the list and item functionality.
I’ve started as a project manager at work for our local game lab, Pelipaja.
Pelipaja game lab is about game development education and coaching for participating teams and it will start this fall in Ylivieska campus of Centria UAS. This is the first time for my hometown to have this kind of opportunity available. Of course I have been running same kinds of projects before but now I, Centria and Oamk have funding for this. With funding from ELY-keskus and ESR we can offer this education for free to applicants. Pelipaja will offer education in total of 60 ECTS and last for a whole year. Topics include team work, game design, graphics, business and marketing.
Read more details from Pelipaja’s own website.
By the way, application period is open now.
Do’s and dont’s for mobile games
Make a 2d fighting game with Unity 5
Components for gameobjects
- for mechanics: movement, damage, attacking
- single responsibility
- can [RequireComponent(”Type”)]
- public functions/methods
- public variables
- can create editor extensions to help with workflow
State machines for ai objects
- from_state, enter_state, update_state, exit_state, to_state
- triggers for state change, user, environment
- example state machines available from internet, asset store (ie. Playmaker)
System logic with managers
- for levels
- for player characters
- for ai characters, enemies, world objects, vehicles, …
- for sounds
- for ui
- for game screens, ie. options, difficulty
- pooling gameobjects
Managers are used for sending messages to gameobjects, state machnices, maintain states, fire events/messages, pool resources…
What do you think?
Pelipaja kurssi etenee hyvällä sykkeellä ja ryhmät ovat jo esitelleet julkisestikin omia aikaansaannoksiaan.
Tässä linkit tiimien devblogeihin: