Join Jesse Freeman for an in-depth discussion in this video Provide attributes to Inspector fields, part of Building Custom Tools to Extend the Unity IDE.
- [Voiceover] So now that we have a basic understanding…of how public fields are exposed in the Inspector,…let's take a look at some of the simple ways…we can clean up the way the Inspector looks.…Let's go back over to our Hello World script.…We're gonna add some attributes…to some of the fields on our class.…Let's take a look at adding…an attribute above our speed field.…An attribute is usually linked to a type…of custom class that stores additional data…about a field it's associated with.…
In this case, we're gonna create an open…and closed bracket for our attribute.…We're gonna use the RangeAttribute.…Inside of it, we're gonna set the range…that our speed is allowed to be set to.…We'll use 0f as the minimum and 10f…as the maximum.…Let's save our code and go back into Unity.…Once Unity recompiles the code,…you'll see that speed has been changed into a slider.…You can go ahead and drag the slider.…
We'll be limited to the value that…we defined in the attribute.…Let's go ahead and try to add…a larger value to the input field.…
- Exposing variables to the Inspector
- Providing attributes to Inspector fields
- Extending the base editor
- Creating custom UI elements
- Modifying the layout of a custom editor
- Building a custom window
- Saving and loading data
- Creating a reorderable list
- Skinning custom inspectors
- Exporting assets as Unity packages
Skill Level Intermediate
Unity 5: 2D Essential Training (2015)with Jesse Freeman3h 22m Intermediate
Unity 5: 2D Generate Procedural Terrainwith Dan Violet Sagmiller4h 4m Intermediate
Game Design Careers with Brenda Romerowith Brenda Romero54m 41s Beginner
1. Introduction to the Inspector
2. Build Custom Editors in Unity
3. Create Custom UI Elements in Unity
4. Build a Custom Window in Unity
5. Saving and Loading Data in Unity
6. Advanced UI
7. Skinning Custom Inspectors
8. Export Custom Code
Code organization4m 35s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.