Releases: Hertzole/scriptable-values
Releases · Hertzole/scriptable-values
2.1.0
Added
TryGetNewValueandTryGetOldValuemethods forCollectionChangedArgs<KeyValuePair<TKey, TValue>>OnPreStart,OnPreDisabled, andOnDisabledlifetime methods toRuntimeScriptableObjectToNativeArray(Allocator),ToNativeArray(AllocatorHandle), andToNativeList(AllocatorHandle)extension methods to
applicable scriptable lists- (Generator) The ability to set custom callback names for generated methods using the
CallbackNameproperty on the generate attributes
Changed
OnExitPlayModeis now obsolete. UseOnDisabledinstead.- The package no longer requires UI Elements module, but will use it if it's available
- Moved a few common base list methods to base
ScriptableListclass - Moved a few common base dictionary methods to base
ScriptableDictionaryclass
Fixed
- No error is thrown when trying to use a read-only list as a destination list in
ConvertAll,FindAll,GetRange, andSlicemethods - Some properties not being marked as ReadOnly when generating property bags
- Scriptable value drawers not supporting prefab overrides in IMGUI mode
- (Generator) Fields marked with generate attributes and starting with "on" generating duplicate "On" prefix in generated methods
- (Generator) Duplicate subscribed callbacks mask names when inheriting from a base class with generated callbacks
2.0.0
A large house-keeping update that lays a solid foundation if I want to develop this package further!
Added
- Support for Unity.Properties and the new runtime UI binding system. All types now implement
IDataSourceViewHashProviderandINotifyBindablePropertyChanged - Source generator for generating event boilerplate code
- Includes new attributes for marking fields and properties;
[GenerateScriptableCallbacks],[GenerateValueCallback],[GenerateEventCallback],[GeneratePoolCallback], and[GenerateCollectionCallback]
- Includes new attributes for marking fields and properties;
- RuntimeScriptableObject implements
INotifyPropertyChangingandINotifyPropertyChangedinterfaces that can be used to track most property changes, including regular field properties ScriptableValue<T>now hasOnBeforeSetValue(T oldValue, T newValue)andOnAfterSetValue(T oldValue, T newValue)methods that can be overridden to track value changesScriptableEventandScriptableEvent<T>now haveOnBeforeInvokeandOnAfterInvokemethods that can be overridden to track event invocationsICanBeReadOnlyinterface for scriptable objects that can be marked as read-onlyINotifyScriptableCollectionChangedinterface for scriptable collections that can be used to track collection changes- Full parity with
List<T>toScriptableList<T> ScriptableValueListener<T>now hasOnBeforeValueChangingInvoked(T oldValue, T newValue),OnAfterValueChangingInvoked(T oldValue, T newValue),OnBeforeValueChangedInvoked(T oldValue, T newValue), andOnAfterValueChangedInvoked(T oldValue, T newValue)overridable methodsScriptableEventListener<T>now hasOnBeforeEventInvoked(object sender, T args)andOnAfterEventInvoked(object sender, T args)overridable methodsScriptableEventListenernow hasOnBeforeEventInvoked(object sender)andOnAfterEventInvoked(object sender)overridable methods
Changed
- Tooltips are no longer included in builds
- BREAKING: Removed
ScriptableValue<T>.GetValue() - BREAKING: You can no longer override
ScriptableValue<T>.SetValue(T, bool)in derived classes - BREAKING:
ScriptableValue<T>.OldNewValue<T>is now obsolete, useValueEventHandler<T>instead - BREAKING:
ScriptableEvent<T>no longer inherits fromScriptableEventand thus does not share the sameInvokemethods anymore - Global and per-object collect stack traces setting is now saved in a separate user settings file instead of editor prefs and scriptable object file
- BREAKING: Read-only errors are now thrown as exceptions instead of logged using
Debug.LogError - BREAKING:
ScriptableList<T>no longer has individual event callbacks, instead it has a singleOnCollectionChangedeventResverse()andSort()now only triggers a singleReplaceeventTrimExcess()no longer triggers a change event at all- The enum
ListChangeTypeis now marked as obsolete as it's no longer used
ScriptableList<T>.TrimExcess()can now be called even when the object is marked as read-onlyScriptableList<T>now implementsINotifyCollectionChangedandInotifyScriptableCollectionChanged<T>- BREAKING:
ScriptableDictionary<TKey, TValue>no longer has individual event callbacks, instead it has a singleOnCollectionChangedeventTrimExcess()no longer triggers a change event at all- The enum
DictionaryChangeTypeis now marked as obsolete as it's no longer used
ScriptableDictionary<TKey, TValue>.TrimExcess()can now be called even when the object is marked as read-onlyScriptableDictionary<TKey, TValue>now implementsINotifyCollectionChangedandInotifyScriptableCollectionChanged<KeyValurPair<TKey, TValue>>- BREAKING:
ScriptablePool<T>.Return(T item)is now obsolete, useRelease(T item)instead - BREAKING:
ScriptableListenerBase.ToggleListening(bool listen)is now obsolete, useSetListening(bool listen)instead - BREAKING:
ScriptableValueListener<T>OnCurrentValueChanging,OnCurrentValueChanged,SetTargetValue, andSetListeningmethods can no longer be overriden - BREAKING:
ScriptableValueListener<T>SetListeningandSetTargetEventcan no longer be overriden - BREAKING:
ScriptableEventListenerSetListeningandSetTargetEventcan no longer be overriden
Fixed
- NullReferenceException being thrown when exiting play mode when a scriptable object is selected
1.3.1
1.3.0
Added
- Added
SetValueWithoutNotifytoValueReference<T>to allow you to set the value without invoking the change event - Added
EnsureCapacitytoScriptableList<T>
Fixed
- Fixed scriptable value editor breaking if the value is null
- Fixed scriptable value editor having the wrong height in newer Unity versions
- Fixed the package not having an author
- Fixed allocation when using
foreachon scriptable lists and dictionaries
Removed
- Removed obsolete
ResetValuesfromRuntimeScriptableObject
1.2.0
Added
- Added
ValueReference<T>type for allowing you to pick between a constant value, a scriptable value, or a addressable reference to a scriptable value - Added icons for all built-in scriptable values and scriptable events
Changed
- Tweaked scriptable value editor to more prominently show the current value
Fixed
- Fixed scriptable value drawers sometimes not showing the correct display label in 2022.2
- Fixed scriptable value drawers sometimes not showing at all in IMGUI editors
- Fixed scriptable value editors having a scrollbar if addressables is installed
- Fixed event listeners having the same name as the value listeners
- Fixed editor compatibility with Odin inspector
1.1.0
Added
- Added support for disabling stack trace collection, both globally and per object
- Added scriptable pool, along with scriptable game object pool
- Added
Invoke()to ScriptableEvent to easily invoke from Unity events - Added
SetEqualityCheckandClearOnStartproperties to scriptable list - Added custom property drawers in 2022.2+ for scriptable types
- Added
AddRange,Exists,Find,InsertRange, andRemoveRangeto scriptable list - Added general
OnChangeevent to scriptable list and scriptable dictionary - Added scriptable values and events for all common Unity types
- Added asset references for all available types
Changed
- Obsoleted ResetValues, it's now separated into two methods;
OnStartfor when the game starts andClearSubscribersfor clearing event subscribers
Fixed
- Fixed scriptable value listener editors not working as intended
- Fixed several issues with checking previous values
- Fixed values not being removed properly on dictionaries in editors
- Fixed non-serializable types breaking editors
- Fixed warnings on Unity 2022.2