We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1bbaad8 + 0e49ca9 commit e7edb4dCopy full SHA for e7edb4d
1 file changed
Scripts/Runtime/Core/ScriptableObjectCollectionItem.cs
@@ -51,6 +51,21 @@ public ScriptableObjectCollection Collection
51
return cachedCollection;
52
}
53
54
+
55
+ [NonSerialized] private bool didCacheIndex;
56
+ [NonSerialized] private int cachedIndex;
57
+ public int Index
58
+ {
59
+ get
60
61
+ if (!didCacheIndex)
62
63
+ didCacheIndex = true;
64
+ cachedIndex = Collection.Items.IndexOf(this);
65
+ }
66
+ return cachedIndex;
67
68
69
70
public void SetCollection(ScriptableObjectCollection collection)
71
{
0 commit comments