Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/track/conditional-objects.git README
Conditional Objects
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
GameObjectorComponentproperties with the PropertyModifier script (e.g.: setting different controller sprites between PlayStation and Xbox platforms) - Conditionally keep
GameObjects orComponents with the KeepObjectsModifier script (e.g.: keep a "Login with Google Play Games" button in Android only) - Conditionally delete
GameObjects orComponents with the DeleteObjectsModifier script (e.g.: delete a debug button in release builds)
How to install
Install via Unity Package Manager using the following URL:
https://github.com/gilzoide/unity-conditional-objects.git#1.0.0-preview2
Unity support
AImportTimeObjectModifier in Scenes are supported in all Unity versions.
Before Unity 2020.2, prefabs are only supported when directly instanced in scenes.
Creating your own modifier
- Create a script that inherits from AImportTimeObjectModifier
- Implement the abstract
void Apply(bool filtersMatch)method inside a#if UNITY_EDITORblock. 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_EDITORandDEVELOPMENT_BUILDscripting define symbols are not detected correctly during builds, use the dedicated Editor and Development filters instead- Extra scripting define symbols passed to
BuildPipeline.BuildPlayerare not detected correctly during builds
Total Installs
0
Last 30 daysUnique IPs
0
Approximate usersInstalls Over Time
Operating Systems
No data yet
Top Countries
No data yet
Git Versions
No data yet
Embed Install Badge
Add an install count badge to your README
Markdown
[](https://www.pkglnk.dev/pkg/conditional-objects)HTML
<a href="https://www.pkglnk.dev/pkg/conditional-objects"><img src="https://www.pkglnk.dev/badge/conditional-objects.svg?style=pkglnk" alt="pkglnk installs"></a>
No comments yet. Be the first!