ScriptableList Class
Definition
Section titled “Definition”Base class for all ScriptableList<T>.
[HelpURL("https://hertzole.github.io/scriptable-values/types/scriptable-list")]public abstract class ScriptableList : RuntimeScriptableObject, INotifyPropertyChanging, INotifyPropertyChanged, IStackTraceProvider, ICanBeReadOnly, INotifyCollectionChangedInheritance object → UnityEngine.Object → UnityEngine.ScriptableObject → RuntimeScriptableObject
Implements INotifyPropertyChanging, INotifyPropertyChanged, IStackTraceProvider, ICanBeReadOnly, INotifyCollectionChanged
Remarks
Section titled “Remarks”You should probably inherit from ScriptableList<T> instead.
Fields
Section titled “Fields”clearOnStartChangingArgs
Section titled “clearOnStartChangingArgs”public static readonly PropertyChangingEventArgs clearOnStartChangingArgsclearOnStartChangedArgs
Section titled “clearOnStartChangedArgs”public static readonly PropertyChangedEventArgs clearOnStartChangedArgsisReadOnlyChangingArgs
Section titled “isReadOnlyChangingArgs”public static readonly PropertyChangingEventArgs isReadOnlyChangingArgsisReadOnlyChangedArgs
Section titled “isReadOnlyChangedArgs”public static readonly PropertyChangedEventArgs isReadOnlyChangedArgssetEqualityCheckChangingArgs
Section titled “setEqualityCheckChangingArgs”public static readonly PropertyChangingEventArgs setEqualityCheckChangingArgssetEqualityCheckChangedArgs
Section titled “setEqualityCheckChangedArgs”public static readonly PropertyChangedEventArgs setEqualityCheckChangedArgscountChangingArgs
Section titled “countChangingArgs”public static readonly PropertyChangingEventArgs countChangingArgscountChangedArgs
Section titled “countChangedArgs”public static readonly PropertyChangedEventArgs countChangedArgscapacityChangingArgs
Section titled “capacityChangingArgs”public static readonly PropertyChangingEventArgs capacityChangingArgscapacityChangedArgs
Section titled “capacityChangedArgs”public static readonly PropertyChangedEventArgs capacityChangedArgsProperties
Section titled “Properties”SetEqualityCheck
Section titled “SetEqualityCheck”If true, an equality check will be run before setting an item through the indexer to make sure the new object is not the same as the old one.
[CreateProperty]public abstract bool SetEqualityCheck { get; set; }ClearOnStart
Section titled “ClearOnStart”If true, the ScriptableList<T> will be cleared on play mode start/game boot.
[CreateProperty]public abstract bool ClearOnStart { get; set; }Gets the number of elements contained in the ScriptableList<T>.
[CreateProperty]public abstract int Count { get; protected set; }Capacity
Section titled “Capacity”Gets the total number of elements the internal data structure can hold without resizing.
[CreateProperty]public abstract int Capacity { get; set; }IsReadOnly
Section titled “IsReadOnly”If read only, the ScriptableList<T> cannot be changed at runtime and won’t be cleared on start.
[CreateProperty]public abstract bool IsReadOnly { get; set; }Methods
Section titled “Methods”WarnIfLeftOverSubscribers()
Section titled “WarnIfLeftOverSubscribers()”Warns if there are any left-over subscribers to the events.
protected override void WarnIfLeftOverSubscribers()Remarks
Section titled “Remarks”This will only be called in the Unity editor and builds with the DEBUG flag.
Clear()
Section titled “Clear()”Removes all elements from the ScriptableList<T>.
public abstract void Clear()Exceptions
Section titled “Exceptions”ReadOnlyException
If the object is read-only and the application is playing.
EnsureCapacity(int)
Section titled “EnsureCapacity(int)”Ensures that the list has at least the specified capacity.
public abstract void EnsureCapacity(int capacity)Parameters
Section titled “Parameters”capacity int
The minimum capacity to ensure.
Reverse()
Section titled “Reverse()”Reverses the order of the elements in the entire ScriptableList<T>.
public abstract void Reverse()Exceptions
Section titled “Exceptions”ReadOnlyException
If the object is read-only and the application is playing.
Reverse(int, int)
Section titled “Reverse(int, int)”Reverses the order of the elements in the specified range.
public abstract void Reverse(int index, int count)Parameters
Section titled “Parameters”index int
The starting index of the range to reverse.
count int
The number of elements in the range to reverse.
Exceptions
Section titled “Exceptions”ReadOnlyException
If the object is read-only and the application is playing.
TrimExcess()
Section titled “TrimExcess()”Sets the capacity to the actual number of elements in the ScriptableList<T>, if that number is less than a threshold value.
public abstract void TrimExcess()Events
Section titled “Events”OnInternalCollectionChanged
Section titled “OnInternalCollectionChanged”protected event NotifyCollectionChangedEventHandler? OnInternalCollectionChanged