- Home /
multiple classes?
Hi all! Ok, so I have this trading station that I want to have multiple wares. However, I want to be able to change the amount of wares from the inspector. Normally to start an array, i would do this:
var wares : Transform[];
So, now since i want multiple prefs for the array, i write something like this:
class wares {
var testimage : Texture2D;
var object : Transform
var price = 250.0;
}
var wares = wares();
Alright, so this works fine and dandy, but now I want to make an Array of these classes (element 0, element 1 etc.) If someone could tell me how to turn classes into an array I would appreciate it greatly. Thanks in advance!
-Stopsecret design
Your answer
![](https://koobas.hobune.stream/wayback/20220612190322im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Need help with assigning game objects to variable 2 Answers
Organizing variables in the inspector 5 Answers
how to construct all arrays (classes) with default constructor (not possible) 2 Answers
Getting an error trying to assign a value to an array of classes element 0 Answers
Spawn Multiple Monsters 1 Answer