From the course: Unity: AR Visualization 02 Basic Interactivity

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Making the Part static data structure

Making the Part static data structure - Unity Tutorial

From the course: Unity: AR Visualization 02 Basic Interactivity

Start my 1-month free trial

Making the Part static data structure

- [Instructor] All right, we've got a part manager and a part monobehaviour that we're going to put on our game objects within the jet engine, but now, we need a container for the data. This is going to contain things like title and description. So easy way to do this, I'm going to grab my ARPart script, I'm going to duplicate that, and I'm going to call this ARPartDefinition. Going to open this up in my code editor. First thing I'm going to change is I'm going to get rid of this Monobehaviour because it's not actually inheriting from Monobehaviour. I'm going to call it ARPartDefinition. I'm going to go up here and I'm going to replace this UnityEngine using with System. This is going to give me my attribute that I need. And here, I'm going to the square brackets to add the serializable attribute. This will allow this class and its variables to be exposed in the editor, as well as be serialized by the Unity JSON system.…

Contents