- Home /
Question by
weltraumimport · Dec 01, 2021 at 02:22 PM ·
arraysresources.load
only load resources with specific string in their name
Hi! I have a Resources folder with different prefabs inside but most of them have similar names like "ball_1" "ball_2" and "cube_1" "cube_2". I want to load the Resources in my C# script to put them into an array, but i want to sort the different objects into their own arrays so that the balls are in one array and cubes in the other. So far I only load all of them in with
myballs = Resources.LoadAll<GameObject>(resourcesPath) as GameObject[];
but it loads all the GameObjects from the resources folder, so when i add the follwing i just get Errors.
myArmors = Resources.LoadAll<GameObject>(resourcesPath + / + "ball") as GameObject[];
Comment
Your answer

Follow this Question
Related Questions
Algorithm for loading sounds 1 Answer
How to load Audioclip using resources.load 1 Answer
Turning off single object in an array 2 Answers
Simple Tile Map 0 Answers