-
Notifications
You must be signed in to change notification settings - Fork 3
08. Adding Environments
If you've used the Unity editor before, environments will be the easiest thing to configure. They are literally just a CharacterToggleId with a prefab.
- This is easier to do in a clean scene; go to
Scenes/Sandbox - Drag in an existing environment to use as a base. I chose
Prefabs/CharacterCreatorRooms/Outside
- Right click the prefab in the hierarchy and do
Prefab->Unpack
Now, we can edit this to our hearts content.
I personally added a little skybox thing using a tool called Spacescape
OK, there is actually one weird thing here: the lighting solution is something custom I've added. It bakes vertex lights into the mesh, but you won't see them in the editor by default.
- In the
Hierarchy, find theVertexBakingRoot. Click it
- In the inspector, expand the
Settings
-
Check
Show Even in Editor -
Hit
Bake -
You should now see some shading on the objects in the scene
-
You can adjust the
Sky ColorandShadow Color -
You can also adjust the
Lightobjects and their values.-
Tip: Turn Gizmos on to actually see these in the scene
-
Once we're happy with our scene:
- Select the
VertexColorBakingRoot - Uncheck
Show Even in Editor - Click Clear
- Hit Bake
-
This ensures the meshes actually save properly. These colored meshes are generated, so they can't actually be serialized.
- Drag and drop the root of your environment into your mod folder
-
Go back to the
Scenes/CharacterCreatorscene -
Make a copy of a room toggle into your mod folder. i.e.
ScriptableObjects\CharacterCompositor\CharacterToggleId\zRoom\zRoom-Outdoors
- Give it an appropriate
Display Name - Set the
Order->Indexappropriately - Change the
Room Prefabto the one we just saved
And that's it! We've got a new environment.