Material groups are contained in a Material System object. First, generate a new material system using the menu bar or right-click “Create” menu:
Assets > Create > Studio Bright > Material Group > Material System
Material Systems can be of two types, “Material,” or “Terrain:”
- “Material” Systems: Modify a mesh material when groups are changed.
- “Terrain” Systems: Modify a terrain layer when groups are changed.
Each system has one list of “Slots.” Each slot represents a group of items that will be modified together.
- Click the [+ Add Slot] button to add new slots:
- Give each slot a descriptive name.
- Click [+ New Group] to create a new material group:
- Give each group a descriptive name.
- Assign a material or terrain layer to each slot.
Mesh materials are associated with Material Group system slots using “Material Tag” components.
- Select a game object that has a mesh or skinned mesh renderer.
- Click the [Add Component] button, and search for “material tag:”
- Drag/drop an existing system asset into the Material Group System slot, or use the [New System] button to create a new system:
- Each material on the renderer will show in a list under “Material Assignment.”
Choose a slot for each material you wish to associate:
- Optional: Select a default group and an event specifier to apply a specific group to this object automatically.
- Material Systems with “Terrain” type are configured in the same way, but associate terrain layers with slots instead of materials.
- Create terrain layers by adding them to a Terrain asset inspector:
- Terrain > Click the Paintbrush > Choose “Paint Texture”
- Terrain Layers > Create Layer
- Create terrain layers by adding them to a Terrain asset inspector:
- New terrain layer asset will be created in the project hierarchy.
(Terrain Layer assets can also be created from the right-click Create menu.)
Material or Terrain Tags have a method in the component called ApplyGroup, which modifies the current group at run time. A group can be changed by using any of the following:
- Group Name (string)
- Group Index (number)
- Group reference (MaterialGroup object)
Material System assets have a list of all MaterialGroup objects (variable name: groups). This list can be parsed by your scripts to manage and change groups as needed.
The sample scenes have examples of scripts that modify material and terrain groups by holding a reference to the Material System asset:
We would love to hear from you how this tool helps you achieve goals in your projects!
Please consider reviewing this asset, and reach out to our team with feedback and suggestions: