You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scripts that modify GameObjects and Components at Prefab/Scene import time, based on build configurations.
All processing is done in the editor at import/build time, so there's no runtime penalty in built players.
Features
Supported conditions:
Editor vs Built player
Development vs Release build settings
Scripting define symbols
Active build platform
Conditionally modify GameObject or Component properties with the PropertyModifier script (e.g.: setting different controller sprites between PlayStation and Xbox platforms)
Conditionally keep GameObjects or Components with the KeepObjectsModifier script (e.g.: keep a "Login with Google Play Games" button in Android only)
Conditionally delete GameObjects or Components with the DeleteObjectsModifier script (e.g.: delete a debug button in release builds)
Implement the abstract void Apply(bool filtersMatch) method inside a #if UNITY_EDITOR block.
Check out the DeleteObjectsModifier script for an example.
Add the script to your game objects in Prefabs/Scenes
Whenever a prefab with your script is reimported or a scene is processed (either played in editor or built), the modifier will be applied and immediately destroyed.
Known issues
UNITY_EDITOR and DEVELOPMENT_BUILD scripting define symbols are not detected correctly during builds, use the dedicated Editor and Development filters instead
Extra scripting define symbols passed to BuildPipeline.BuildPlayer are not detected correctly during builds
About
Unity scripts that modify GameObjects and Components at Prefab/Scene import time based on build configurations