A collection of design patterns for solving common problems.
[zin-ee-uh]
Zinnia is a collection of design patterns for the Unity software that can be beneficial in (but not limited to) spatial computing development.
Requires the Unity software version
2018.3.10f1(or above).
- Using the Unity software version
2018.3.10f1(or above), create a new project using the 3D Template or open an existing project. - Ensure the project
Scripting Runtime Versionis set to.NET 4.x Equivalent.- In the Unity software select
Main Menu -> Edit -> Project Settingsto open theProject Settingsinspector. - Select
Playerfrom the left hand menu in theProject Settingswindow. - In the
Playersettings panel expandOther Settings. - Ensure the
Scripting Runtime Versionis set to.NET 4.x Equivalent.
- In the Unity software select
-
Navigate to the
Packagesdirectory of your project. -
Adjust the project manifest file
manifest.jsonin a text editor.- Ensure
https://registry.npmjs.org/is part ofscopedRegistries.- Ensure
io.extendrealityis part ofscopes.
- Ensure
- Add
io.extendreality.zinnia.unitytodependencies, stating the latest version.
A minimal example ends up looking like this. Please note that the version
X.Y.Zstated here is to be replaced with the latest released version which is currently.
{ "scopedRegistries": [ { "name": "npmjs", "url": "https://registry.npmjs.org/", "scopes": [ "io.extendreality" ] } ], "dependencies": { "io.extendreality.zinnia.unity": "X.Y.Z", ... } } - Ensure
-
Switch back to the Unity software and wait for it to finish importing the added package.
If you want to run the tests that come with Zinnia please follow these steps.
Because Zinnia is a package tests have to be explicitly enabled for this package, before the Test Runner can pick them up.
-
Navigate to the
Packagesdirectory of your project. -
Adjust the project manifest file
manifest.jsonin a text editor.- Ensure
io.extendreality.zinnia.unityis part oftestables.
A minimal example ends up looking like this.
{ "scopedRegistries": [ ... ], "testables": [ "io.extendreality.zinnia.unity" ], "dependencies": { ... } } - Ensure
-
As noted in the official Unity documentation:
NOTE: You may need to re-import the package, because the test framework doesn't always immediately pick up changes to the
testablesattribute.- Within the Unity software's
Projectwindow expand thePackagesnode. - Right-click on the
Zinnia.Unitychild node and chooseReimport. - Wait for the Unity software to finish re-importing the package.
- Within the Unity software's
-
In the Unity software select
Main Menu -> Window -> Test Runner. -
Within the Test Runner window click on the
PlayModetab and the clickRun Allbutton. -
If all the tests pass then the installation was successful.
Note: The tests are not compatible with the
Run all in playeroption.
The package will show up in the Unity Package Manager UI once the above steps have been carried out. From then on the package can be updated by selecting the package in the Unity Package Manager and clicking on the Update button or using the version selection UI.
There are a collection of custom script define symbols that are included that can affect functionalities provided within Zinnia:
ZINNIA_IGNORE_CUSTOM_COLLAPSIBLE_DRAWER- Disables the collapsible event drawer functionality in the inspector windows.ZINNIA_IGNORE_CUSTOM_INSPECTOR_EDITOR- Disables the custom zinnia inspector that handles automatically updating property values when changed in the inspector.ZINNIA_IGNORE_CUSTOM_LIST_EDITOR- Disables the custom observable list editor in any version of Unity.ZINNIA_IGNORE_PIPELINE_MATERIALS- Prevents thePipelineMaterialApplierfrom updating materials to match the current render pipeline mode.ZINNIA_USE_CUSTOM_LIST_EDITOR- Force the custom observable list editor in the version of Unity 2020.3 or above.ZINNIA_USE_ISACTIVEANDENABLED- Determines whether to use thebehaviour.isActiveAndEnabledproperty on a behvaiour when calling theCheckIsActiveAndEnabledmethod instead of using the more robustbehaviour.gameObject.activeInHierarchy && behaviour.enabled.
Inspired by the Zinnia genus of plants known for their colorful, long lasting flower heads and their great ease to grow from seeds. This repository, much like the Zinnia flower aims to be easy to use and allow your projects to grow and flourish into long lasting, easy to maintain solutions.
Fun Fact: Zinnias have been grown aboard the International Space Station and have demonstrated the capability to blossom in a weightless environment.
Please refer to the Extend Reality Contributing guidelines and the Unity project coding conventions.
Please refer to the Extend Reality Code of Conduct.
Code released under the MIT License.
These materials are not sponsored by or affiliated with Unity Technologies or its affiliates. "Unity" is a trademark or registered trademark of Unity Technologies or its affiliates in the U.S. and elsewhere.
