Skip to content

ScriptableList Class

Base class for all ScriptableList<T>.

C#
[HelpURL("https://hertzole.github.io/scriptable-values/types/scriptable-list")]
public abstract class ScriptableList : RuntimeScriptableObject, INotifyPropertyChanging, INotifyPropertyChanged, IStackTraceProvider, ICanBeReadOnly, INotifyCollectionChanged

Inheritance object → UnityEngine.Object → UnityEngine.ScriptableObject → RuntimeScriptableObject

Implements INotifyPropertyChanging, INotifyPropertyChanged, IStackTraceProvider, ICanBeReadOnly, INotifyCollectionChanged

You should probably inherit from ScriptableList<T> instead.

C#
public static readonly PropertyChangingEventArgs clearOnStartChangingArgs
C#
public static readonly PropertyChangedEventArgs clearOnStartChangedArgs
C#
public static readonly PropertyChangingEventArgs isReadOnlyChangingArgs
C#
public static readonly PropertyChangedEventArgs isReadOnlyChangedArgs
C#
public static readonly PropertyChangingEventArgs setEqualityCheckChangingArgs
C#
public static readonly PropertyChangedEventArgs setEqualityCheckChangedArgs
C#
public static readonly PropertyChangingEventArgs countChangingArgs
C#
public static readonly PropertyChangedEventArgs countChangedArgs
C#
public static readonly PropertyChangingEventArgs capacityChangingArgs
C#
public static readonly PropertyChangedEventArgs capacityChangedArgs

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.

C#
[CreateProperty]
public abstract bool SetEqualityCheck { get; set; }

If true, the ScriptableList<T> will be cleared on play mode start/game boot.

C#
[CreateProperty]
public abstract bool ClearOnStart { get; set; }

Gets the number of elements contained in the ScriptableList<T>.

C#
[CreateProperty]
public abstract int Count { get; protected set; }

Gets the total number of elements the internal data structure can hold without resizing.

C#
[CreateProperty]
public abstract int Capacity { get; set; }

If read only, the ScriptableList<T> cannot be changed at runtime and won’t be cleared on start.

C#
[CreateProperty]
public abstract bool IsReadOnly { get; set; }

Warns if there are any left-over subscribers to the events.

C#
protected override void WarnIfLeftOverSubscribers()

This will only be called in the Unity editor and builds with the DEBUG flag.

Removes all elements from the ScriptableList<T>.

C#
public abstract void Clear()

ReadOnlyException
If the object is read-only and the application is playing.

Ensures that the list has at least the specified capacity.

C#
public abstract void EnsureCapacity(int capacity)

capacity int
The minimum capacity to ensure.

Reverses the order of the elements in the entire ScriptableList<T>.

C#
public abstract void Reverse()

ReadOnlyException
If the object is read-only and the application is playing.

Reverses the order of the elements in the specified range.

C#
public abstract void Reverse(int index, int count)

index int
The starting index of the range to reverse.

count int
The number of elements in the range to reverse.

ReadOnlyException
If the object is read-only and the application is playing.

Sets the capacity to the actual number of elements in the ScriptableList<T>, if that number is less than a threshold value.

C#
public abstract void TrimExcess()
C#
protected event NotifyCollectionChangedEventHandler? OnInternalCollectionChanged

NotifyCollectionChangedEventHandler