io.extendreality.zinnia.unity
Advanced tools
Changelog
1.34.0 (2021-04-03)
Many of the data types now have a
ToString
override to write out the data in a clear format from data types. This makes it easier to debug what is going in with the data by being able to callToString
on these custom types.
The abstract BasePrefabCreator forms a basis to allow prefabs to be easily added to the scene via a Unity window menu option.
The SingleEventProxyEmitter should not be using UnityEditor as it doesn't need it and it can cause issues including namespaces from the editor classes in build required classes.
Changelog
1.33.0 (2021-03-29)
The DirectionModifier component has been improved so the rotation of the Target now works if the Pivot is in front of the LookAt GameObject and it is also possible to specify a TargetOffset for handling non LookAt snapping rotations. It is also now possible to determine which object to use for the world up in the LookRotation process.
The
PreventLookAtZRotation
logic has been removed as it no longer seems to be required after this new functionality has been added.
The PinchScaler now has the option to calculate the scale distance using
Mathf.Power
on the delta and the multiplier as this gives a more accurate representation of the scale factor.
The new MeshStateModifier component makes it easy to toggle the enabled state of a (Skinned)MeshRenderer associated with a given GameObject.
The MeshStateModifier can toggle the state of a mesh that is on the same GameObject as the given container, or a mesh on any of the children of the given container.
It also utilizes a new GameObjectMultiRelationsObservableList component which allows a single key container to be used to reference multiple child objects. So if the key is found then you get the values back to utilize. This is used to allow custom child meshes to be specified for a given parent container, so when the Show/Hide mesh methods are called then it will only toggle the specified child meshes.
Changelog
1.32.0 (2021-03-27)
When using an angular transform drive as a handleless door knob, this class is used to track the interactor's "wrist" rotation, but as it is now the this only works when drive/interactor are aligned with world space. By using this new option, the angular velocity will be transformed to the target's space, and thus applied properly.
Changelog
1.31.1 (2021-03-03)
It would seem that a version of Unity has stopped calling Unity lifecycle events such as Start in playmode tests under the normal
[Test]
structure and now they require to be run as[UnityTest]
instead. It is not clear from the Unity changelogs when this change was introduced, but it is definitely needed for Unity 2019.4.
Unity 2019.3 introduced an undocumented change brought about by PhysX 4.11 where when a rigidbody kinematic state is changed then Unity will re-fire the OnTriggerExit and OnTriggerEnter events even though the collision between colliders did not end. This causes issues as extra events are raised that do not reflect what is actually happening in the scene.
The fix involves being able to mark a rigidbody attached to a collider as about to have its kinematic state changed, this is then stored and upon the OnTriggerExit being called (in the same frame) it will ignore the internal logic and then ignore the subsequent OnTriggerEnter logic (which is also done in the same frame) and then cleans up the rigidbody cached state so it knows that additional exits are valid.
This is only applied in Unity 2019.3 and above and can be disabled at runtime if the mechanism of how Unity 2019.3 works is required.
Changelog
1.31.0 (2021-02-27)
The IntRange component is similar to the FloatRange component but it takes an integer rather than a float for when absolute numbers are to be enforced.
It is also possible to make a FloatRange from an IntRange and vice versa.
A collection of new data converters have been added to convert:
- float to string * string to float * int to float * float to int * float to TimeSpan * TimeSpan to float * string to TimeSpan * TimeSpan to string
The ObservableList components now have a
Get(index)
method that retrieves an element from the collection List and uses index clamping so an invalid index will not throw an error, instead an index too high will return the last element in the List and a negative index will walk the list in reverse (e.g. -2 gets the second from last element from the list).There is also an accompanying
Obtained
event that emits the element that was retrieved in theGet
call. IfGet
is attempted on an empty collection then it will result in an exception being thrown.
Nearly all of the proxy emitters can now be restricted by a rule and some new proxy emitters have been added for missing event types.
A collection of new rule types have been added that deal with primitive object types such as floats, ints, strings and vectors.
These provide the basis for applying rules against primitive types such as determining if a number is in a range, or whether a type is equal to another type (within a given tolerance).
A new option to the CollisionNotifier has been added that will prevent collision tracking to occur if the component is disabled. Previously, all collisions would continue to process even if the component was disabled because the Unity OnCollision/Trigger[XXX] methods always run even on a disabled component.
There are times where you may not want this to be the case so a new property has been added that will prevent collision processing when the component is disabled. It is still possible to have the component disabled and collisions processed if this new property is set to true (which is is by default so no noticable changes will occur).
There is an edge case where the CollisionNotifier will still attempt to get a list of Notifiers when the object has been destroyed causing a Null Exception error. This fix simply checks the state of the objects before attempting to return the notifier list.
Changelog
1.30.0 (2021-02-04)
The base data types have had their Equals method overridden so they perform a logical based equality check on the contents of the object when the properties are the same. This allows these data types to be logically compared such as in the use of Lists in where a TransformData object with the same properties should be considered the same object.
The tests have been updated to test the equality of objects.
The CollisionTrackerDisabledObserver component could be added to a component twice and track the same source and target which made no sense as the same functionality was being duplicated.
This fix adds a check to ensure the component doesn't already exist on the GameObject before adding it again.
Changelog
1.29.0 (2021-01-07)
The ObservableList now has an IndexOf method to receive the list index of a given element. This is included because the IndexOf method cannot be called on the public HeapAllocationFreeReadOnlyList.
The ObservableListComponentGenerator now has missing options added to create even more components that rely on a single list.
There was an issue where if the ObservableList was added to in the OnEnable of another script then the Added event be raised as the ObservableList was enabled, but Start is called after OnEnable so when the Start method was called it would then loop through the list and raise the events for everything that existing in the list the first time it was loaded.
This fix just stops the normal Add method from raising events if Start hasn't been called.
Changelog
1.28.1 (2020-12-21)
The GameObjectsAssociationActivator could occasionally throw an error if the associated object within the loop was null. This adds a guard to check the variable is not null before processing it.
Unity 2020.2 has removed the XRDevice.model property and in place it attempts to use InputDevice.name. This fix attempts to get the InputDevice for the XRNode.Head and uses the InputDevice.name for the retrieved device.
These names returns are piped via the XR Management System and are sometimes nonsensical values due to the vendors not providing correct string names in their XR Plugin.
Unity 2020.2 has removed the UnityEngine.Experimental.XR.Boundary class so it is no longer possible to get the boundary data directly from unity. There does not seem to be an alternative provided in Unity so the method just returns null along with a warning.
Changelog
1.28.0 (2020-12-17)
A new static method has been added to the EditorHelper to draw a horizontal line in any custom inspector window. This is useful for custom inspectors that require divider lines.
The ObservableListComponentGeneratorEditorWindow provides an easy way of creating components that contain nested Observable Lists by using a simple inspector window that provides a drop down list of available components to create. Selecting the component and clicking the button will add a GameObject to the scene with the desired component and then it adds a nested GameObject that contains the relevant Observable list.
This makes adding components that rely on observable lists easier to understand and quicker to achieve.
Changelog
1.27.0 (2020-12-12)
The modifiers of a transform can now be restricted on a per axis basis to allow finer control over the modification.
The new ObjectReference type and custom drawer allow a Object to be specified as a property which can then be shown as a simple button in the inspector to highlight the referenced Object within the Unity Hierarchy.
The RigidbodyAngularVelocity component was updated to calculate in radians only. Whilst, this makes sense for the most part, it does not create a good outcome in all situations. The component has been updated so it can optionally use radians or degrees and it can also take in to consideration the offset to determine the new centre of mass to calculate around.
The divergence checking code was also faulty, so this has been fixed as part of this commit.