Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Scripts/Runtime/Core/ScriptableObjectCollectionItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ public ScriptableObjectCollection Collection
return cachedCollection;
}
}

[NonSerialized] private bool didCacheIndex;
[NonSerialized] private int cachedIndex;
public int Index
{
get
{
if (!didCacheIndex)
{
didCacheIndex = true;
cachedIndex = Collection.Items.IndexOf(this);
}
return cachedIndex;
}
}

public void SetCollection(ScriptableObjectCollection collection)
{
Expand Down