Prefab and Object Manager
v4.0
Last updated
v4.0
Last updated
The Prefab And Object Manager is a component you can attach to any object in your scene, which makes it very easy to create groups of Game Objects
and Prefabs
-- individually or mixed together -- which you can turn on in your project with a single line of code.
For static game objects, such as furniture in a room, or props on a table, this script is all you need.
For characters or other objects using the wardrobe and/or blend shapes, you may want to also add the Wardrobe Prefab Manager (required for rigging objects added to the scene), and the Blend Shapes Manager (required for working with mesh morphing).
Are you already using Infinity PBR content prior to this update (~March 2022)? If so, there's a few things to keep in mind when updating.
This script is the new version of PrefabChildManager.cs
, and replaces it. I've renamed it to better identify what it actually does. Any references in your custom code to the old script may need to be updated to the new one.
In the class PrefabGroup
, the field prefabObjects
has been renamed to groupObjects
. If your scripts reference prefabObjects
, errors will be shown in the console. You'll need to update your scripts to update this reference.
Any wardrobe that will be equipped needs to have a EquipmentObject
component on it. This will self populate once you add the component. If your adding this to object that are in a prefab (via the prefab view editor), turn off "Auto Save" -- it looks like there is a bug where the scripts will self-populate, but that data will NOT be saved if Auto Save is turned on.
Select the parent of the object -- often the "place" where objects will be related to, or for wardrobe, the character. In the inspector, click "Add Component", and search for Prefab And Object Manager. Add it!
There are three tabs in the Inspector.
This is where you create and manage your Prefab Groups. Type in the "Type", and the sort order will update. Name the "Group Name" something unique, as this is used with scripting.
At edit time, use the "Activate" and "Deactivate" buttons to see the results.
See full details on the Prefab Groups page.