So I have a situation where I need to cache off all scriptable objects of a particular type at run time.
I thought the solution would be to put them into a resource folder and use this command:
foreach( DurableEntry d in Resources.FindObjectsOfTypeAll(typeof(DurableEntry)) as DurableEntry[])
{
MyCache.Add(d);
}
This proves to be very unreliable however. I had 4 of these in the resource folder and sometimes this will find 1 of them. Sometimes 2. Sometimes all 4. Whats going on there?
My fallback is to hand drag the items into the MyCache list. But thats not what I wanted to do.
Any ideas?