#Hey guys ```cs
1 messages Β· Page 1 of 1 (latest)
Object[] skins = Resources.LoadAll(SKINS_RPATH, typeof(Skin));
foreach (Object skin in skins)
{
Skin s = (Skin) skin;
...
}
So whats your issue? You already have an object array. A skin is an object, just with more attributes. So copying it again and doing the same stuff will result in the same thing. I fyou need that Skin array a lot, you can clone it into a SkinArray, if not, just cast it
how to clone it?
did you do the cast thing I mentioned?
in foreach with List?
myArray.Cast<Object>().ToList();
List<TestEverything> testArray;
// Start is called before the first frame update
void Start()
{
testArray = Resources.LoadAll("", typeof(TestEverything)).Cast<TestEverything>().ToList();
}
Simple as that π
I prefer lists over arrays, but that depends on what you do π
I use array when I know the length
I do a lot of list modifying and so on, guess that led me to lists for everything π anyway, glad I could help. π can we close the thread? π
.ToArray(), no?
Cast should already return an Array, I think. let me check
Ah yeah, toArray in your case π
Okay, thank you very much β€οΈ