io.extendreality.zinnia.unity
Advanced tools
Changelog
2.1.0 (2022-05-09)
The BooleanToFloat component now has the ability to set the false and true float value rather than it just being hard coded to 0f for false and 1f for true.
The FloatToBoolean PositiveBounds property has also been made public as it should be so it can be set via code if required.
The BaseGameObjectSelector component is an empty component that contains the
[SelectionBase]
Unity tag, so when the GameObject that has this component on it is clicked in the Unity scene view then it will select this specific GameObject and not the one that contains the mesh as this is not always the desired result.
The indent on the FloatRangeDrawer was in the wrong place causing incorrect indentation when the property was being used in an already indented collection.
There are a couple of oddities where Unity will thrown an exception using the custom editor if a Horizontal or Vertical group is started and then another Unity inspector element is opened it seems not to close the previous opened group causing a mismatch somewhere.
This isn't technically a fix for the problem but just a way of removing the error for now.
Changelog
2.0.0 (2022-04-28)
The Malimbe custom inspector has been replaced with the new ZinniaInspector which performs pretty much the same task except instead of looking for the MemberChange attributes it now specifically expects OnBefore
and OnAfter
property methods to be explicityly named with the property name followed by the suffix of Change
.
E.g.
protected virtual void OnBeforeMyPropertyChange(); ```
The dependency of Malimbe has also been removed as it is no longer used anywhere now. ([4e38df2](https://github.com/ExtendRealityLtd/Zinnia.Unity/commit/4e38df278f9b4788ca288167008a87f36909487a))
#### Features
* **Extension:** add extension for setting LayerMask ([19694ae](https://github.com/ExtendRealityLtd/Zinnia.Unity/commit/19694aef9b2fed53d453a3915eb572d1f369bd0a))
> The LayerMask has now been extended to have a Set(int) and a Set(name) method that allows the layer mask to be set via the index value or the string literal value of the desired layer.
* **Malimbe:** remove Malimbe custom inspector ([4e38df2](https://github.com/ExtendRealityLtd/Zinnia.Unity/commit/4e38df278f9b4788ca288167008a87f36909487a))
* **Malimbe:** remove MemberChangeMethod attribute dependency ([baef56b](https://github.com/ExtendRealityLtd/Zinnia.Unity/commit/baef56b81da435b97a3bf7db59f03e84bfa9035d))
> The Malimbe MemberChangeMethod attribute has been removed as a dependency and instead every property now manually calls the `OnBefore` before the value is set and the `OnAfter` after the value is set.
>
> These are also wrapped in a check to ensure the application is playing and the component is active and enabled to copy the behaviour of how the Malimbe attribute worked.
* **Malimbe:** remove MemberClearanceMethod attribute dependency ([dbffb25](https://github.com/ExtendRealityLtd/Zinnia.Unity/commit/dbffb250f21205863d3308ba2387ace2ac9d8480))
> The Malimbe MemberClearanceMethod attribute has been removed as a dependency and instead every property that relied on the `[Cleared]` attribute now has a hard coded `Clear<PropertyName>` method that performs the same as the weaved `Cleared` code.
* **Malimbe:** remove property serialization and xml documentation ([80e86bd](https://github.com/ExtendRealityLtd/Zinnia.Unity/commit/80e86bdb0ef1d82281254ad266147b446c4db4fd))
> The Malimbe PropertySerializationAttribute and XMLDocumentation attribute have been removed as a dependency and the property serialization is now done manually by providing a private backing field that is used within the related property in the same naming convention that Malimbe used so all references should be remembered.
>
> XML Documentation is now simply duplicated into the Unity `Toolkit` attribute.
>
> This commit may have some unwanted outcomes as the MemberChange attributes still exist and may not weave correctly with the hard coded property setters.
* **Malimbe:** remove RequiresBehaviourState attribute dependency ([e34b560](https://github.com/ExtendRealityLtd/Zinnia.Unity/commit/e34b56056288267f51c6452e05d364fddb7a4b33))
> The Malimbe RequireBehaviourState attribute has been removed as a dependency and the hard coded check of if the gameobject is active in hierarchy and whether the component is enabled is now used in place in every method that utilized the RequiresBehaviourState attribute.
* **properties:** ensure logic properties are marked as virtual ([9e642fd](https://github.com/ExtendRealityLtd/Zinnia.Unity/commit/9e642fde43bab3368e6583623da9e49d8ce3daba))
> Properties that contain logic have now been marked as virtual so they can be overriden if needed.
#### Bug Fixes
* **Action:** ensure sources field is serialized ([389509f](https://github.com/ExtendRealityLtd/Zinnia.Unity/commit/389509f3b49acf267ec4559b7507606123bf9290))
> The Sources field was not serialized meaning it was not showing up in the Unity inspector.
* **Malimbe:** add UnityFlags attribute back for multi select enums ([b219190](https://github.com/ExtendRealityLtd/Zinnia.Unity/commit/b219190949daefa36c3c5a450691f2176773ff50))
> The UnityFlags attribute had been stripped off the multi select enums during the update process meaning these enum properties could only have a single value selected. Adding the UnityFlags attribute back means that multiple values can again be selected.
>
> Another quick fix in the Rule has been added to that sets a bool value if the rule is destroyed to ensure it cannot be checked when the object has already been destroyed.
* **Malimbe:** remove underscore from backing fields ([c4559b4](https://github.com/ExtendRealityLtd/Zinnia.Unity/commit/c4559b4b8622203286e4c10475fab4c1f4e7e323))
> Malimbe did not create backing fields with an underscore so any existing references would have been lost. All of the fields now are the direct match of the property name just with a lowercase first letter as Malimbe would have created.
Changelog
1.47.1 (2022-03-15)
The Observable List Drawer has an issue in Unity 2021.2 where making changes to a linked list will not save due to the way the serialized object is obtained as new every frame, this means that the object can be out of date and load in the old changes.
This also was a cause of an issue where having the linked list component on the same component as the actual list meant it would not save changes.
The fix is to only get the new version of the serialized list object if any changes have been made and therefore it won't attempt to get it every frame.
Chris hasn't been actively part of the project for a while.
Changelog
1.47.0 (2022-03-15)
The Surface Change Action actually needs to access the offset that the SurfaceLocator has on it, but there is no way of directly getting this so the SurfaceData has now been updated to contain a Positional Offset property that can be set by the Surface Locator and then accessed by the Surface Change Action.
Changelog
1.46.0 (2022-02-14)
The Slicer component now has some additional events that are raised when the Sliced and Remaining lists change or stay unchanged when a slice operation is called.
A number of new data transformations have been added to fill the gaps where they were missing but existed for other similar data types or the data type had a certain transformation operation but was lacking in another (e.g. had an adder but no subtractor).
There was a new Transform object being created every call which could have caused issues with garbage collection. The transform is now just a reused reference which shouldn't need to create a new object every call.
The RigidbodyVelocityTest can occasionally fail in the diverge tests as it's relying on the physics engine to work perfectly under test conditions and it causes the test to hang indefinitely. This has been fixed by simply adding a counter that will cause the while loop to end if the timer exceeds the limit.
Changelog
1.45.0 (2022-02-05)
The BaseDeviceDetailsRecord provides a base record to extend upon that leverages the Unity library XR settings and system info settings to provide base values for any concrete implementation.
There was an issue with the Muted Restricted attribute where on occasions it could change all fields to the muted styles.
The LineCasts could get into a situation where they would not work after the component was disabled. This is due to the RayCast target not being reset to null when the component is disabled.
Also, extra checks to ensure the points arrays are actually set to the correct values are now done to prevent any exceptions that may occur.
Changelog
1.44.0 (2022-01-17)
The DominantControllerRule can be used to determine if the selected controller is the current dominant controller in the first active DominantControllerObserver set.
The DeviceDetailsRecord now has a TrackingBegun event that is raised the first time the device starts tracking upon the component being enabled. There is also a backing property that can be queried.
A DominantControllerObserver can be stored on a LinkedAliasAssociationCollection to make it easier to access the current component that is checking for the dominant controller.
The debug logs have also been removed from the XRDeviceProperties that warned about methods not being available as they could just end up spamming the console and its not completely necessary.
Changelog
1.43.0 (2022-01-13)
The XRDeviceProperties class now returns data for:
- DeviceCount * HasPositionalTracking * HasRotationalTracking * IsValid (but only for 2019.3 and above)
It also has a couple of new methods that are only available in 2019.3 and above:
- DeviceInstance * IsDeviceDefault
The XRDevicePatternMatcher has been updated to match against these new properties and it can also set the XRNode device source now via a method.
Changelog
1.42.0 (2022-01-13)
The XRDevice properties that differ between Unity versions due to elements being made obsolete were originally included directly in the XRDevicePatternMatcher component. But this logic is useful in more places so it has been abstracted out into a Utility class that is static so it can be called from any other component requiring this abstraction.
It also includes the checks for IsTracked, BatteryLevel, Manufacturer (even though they only work on Unity 2019.3 and above).
The XRDevicePatternMatcher can also now specify which device node to look up the details for as on Unity 2019.3 and above the device can be specified in the look up. This does not work on versions prior to Unity 2019.3.
Changelog
1.41.0 (2022-01-12)
The PlatformDeviceAssociation component has been deprecated due to the limited ways it can form a device association via hard coded properties related to the restricted supported types.
The new RuleAssociation component replaces it with a completely generic approach that will determine activation status on the GameObject collection if the given rule passes.
This then works with the new PatternMatcherRule which takes a collection of new PatternMatcher components that will attempt to match a give pattern string against a selected source property from a given Unity namespace that contains useful data.
The existing associations in the PlatformDeviceAssociation exist now as their own PatternMatcher components:
- ApplicationPatternMatcher * XRSettingsPatternMatcher * XRDevicePatternMatcher
These provide the same functionality as before, but also offer additional properties that can be used to match against.
Thes PatternMatcher components can be set up with the PatternMatcherRule and then that rule set up as the Rule in the RuleAssociation to provide the same functionality but with much more flexibility.
A new SystemInfoPatternMatcher is also included that can use many property types from the
UnityEngine.SystemInfo
class.The ObservableListComponentGeneratorEditorWindow has also been updated so it sets the newly created GameObject name based on the component selected rather than just the generic named
ComponentContainer
as this makes it easier to identify newly created components.
The LayersToIgnore and TriggerInteraction properties can now be set via method calls meaning they can be changed via Unity events.
The new abstract DeviceDetailsRecord sets a framework for holding common information about a device such as model, connected status and battery status.
The LinkedAliasAssociationCollection now can hold a DeviceDetailsRecord for the headset, left and right controller. CameraRig packages will provide a concrete implementation of the DeviceDetailsRecord for the headset and controllers of that CameraRig supported SDK and then linked to the CameraRig prefab.
This will mean that the CameraRig prefab will then be able to know about the details of the headset and controllers.
A new DominantControllerObserver component has been added as well that holds a left/right controller DeviceDetailsRecord as the soruce and will be able to determine whether the left or right controller is the current dominant controller. This component is also processable so can be run on a Moment to check periodically if the dominant controller has changed.