- Home /
Listing multiple objects
There are multiple prefabs that i need to put in a "list" which i can choose from ingame. I was trying it with enums, structs and arrays but i cant really wrap my head around it..
The Unit Factory should have a Unit selected that it produces and the amount that it's producing should go to the UnitManager so it can store the specific Unit. But I don't know how or in what kind of Datatype i should store that value!
Answer by Kudorado · Apr 22, 2018 at 12:04 PM
Trying store prefabs just like: public List<GameObject> lists;
Answer by TheIrrlicht · Apr 22, 2018 at 06:53 PM
Right now i'm using a 2D array like this:
[ Unit1 ] [ Unit2 ]...
[ Amount ]...
But it's kind of a hassle to refer to the units as just numbers in the inspector.. also i can't find a way to see what values are in the array directly! I would like to have an enumerator but also the amount stored in one, if that's possible!
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Enum instead of numbers in arrays 1 Answer
Array with multiple variables in Inspector 1 Answer
Smart Tile Info ? 2 Answers
Is it possible to Change mesh also multi materials by a button or a key 0 Answers