Join Jesse Freeman for an in-depth discussion in this video Serialize data, part of Building Custom Tools to Extend the Unity IDE.
- [Voiceover] Now in order for us to save our items,…we're going to need to convert them…into some type of serialized data.…In this case, we're going to take our SaveItem…and turn it into a string.…Let's go into our project and in the Scripts folder,…open up the SaveTest in MonoDevelop.…Now in our SaveItem, we're going to go ahead…and create a new ToString method that will convert…the properties of our class into a string.…Since ToString already exists on objects,…we're going to need to use the new keyword…in order to create and override that default method.…
Let's start by making this public.…Use the keyword new.…Our return type is going to be a string,…and we'll create the method ToString.…Inside, we're going to return this string that we create.…We'll start by taking the name…and concatenating it with a comma.…We'll then go ahead and take the position X,…concatenate it again with a comma,…and the position Y.…Now we'll have a very basic string…that will represent the name…and the position of the saved item.…
Next, let's go into the SaveTest…
- 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.