#Hey guys ```cs

1 messages Β· Page 1 of 1 (latest)

soft mist
#

Let continue here

feral portal
#
Object[] skins = Resources.LoadAll(SKINS_RPATH, typeof(Skin));
        foreach (Object skin in skins)
        {
            Skin s = (Skin) skin;
            ...
        }
soft mist
#

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

feral portal
#

how to clone it?

soft mist
#

did you do the cast thing I mentioned?

feral portal
#

in foreach with List?

soft mist
#

myArray.Cast<Object>().ToList();

feral portal
#

lol

#

Thanks ❀️

soft mist
#

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 πŸ™‚

feral portal
#

I use array when I know the length

soft mist
#

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? πŸ™‚

soft mist
#

Cast should already return an Array, I think. let me check

feral portal
#

oh you have list

#

sorry

soft mist
#

Ah yeah, toArray in your case πŸ™‚

feral portal
#

Okay, thank you very much ❀️