From the course: Unity: Revit Reflect Workflow

Unlock the full course today

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

Overriding by metadata

Overriding by metadata

From the course: Unity: Revit Reflect Workflow

Start my 1-month free trial

Overriding by metadata

- [Instructor] We just finished writing utility to filter objects in the scene by category. Now we can use that filter to override the materials and all the objects of that category. Let's make a new script, I'll call it material override, and I'll open that up in Visual Studio. Once again, let's first add our Unity engine.reflect, and then start setting up our variables. We want the user to be able to enter what the category is and what the material is that we want to be able to replace those materials with. So we have a public string called category to paint, oops, and then a public material called new material. Now we're ready to write our method. I'll get rid of update, and we'll make this a public method, so we can access it from the editor, and avoid type, and we'll call this swap material by category. Now rather than passing in the string and the material here, we're going to just pull that from the class itself,…

Contents