Join Jesse Freeman for an in-depth discussion in this video Add custom classes, part of Building Custom Tools to Extend the Unity IDE.
- [Voiceover] Now that we've showed off some of the…default types that work in the inspector,…let's talk a little bit about custom classes.…We'll open up our HelloWorld and create…a public class right above HelloWorld.…Let's call this class CustomDataStructure.…Inside of this class, we're gonna add two public fields.…The first is gonna be typed to a GameObject called target,…and the second will be a Vector3 called position.…
Now let's go ahead and add a field…for our custom data structure to HelloWorld.…Below where we set our game objects,…let's create a public CustomDataStructure customTarget.…Let's save our code, and go back into Unity.…By default, this custom class isn't…going to be exposed to the inspector.…There's a simple way to fix this.…Right now, our inspector doesn't know…how to serialize the field.…Let's go back in and add an attribute…to our CustomDataStructure class.…
Here, we're gonna use System.Serializable.…We'll save this, and go back into Unity.…Now you'll see that our custom target will appear.…
- 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
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?
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.