- Home /
Variables inside an element list
Hello, I want to create variables where each element can have individual properties inside of it.
I know I can create sort of a list with elements by using the brackets [ ]
inside my script, to get an effect like this:
However I want to get an effect like this:
See how each element in the second image has it's own properties? Is there any way I can achieve this? (in JS)
Thanks in advance!
Answer by dood2 · Aug 05, 2013 at 11:15 PM
Something like this?
public class MySweetData
{
var someBool : boolean = false;
var someFloat : float = 0.0f;
var someGameObject : GameObject;
}
var SweetDataArray : MySweetData[];
// Use this for initialization
function Start ()
{
}
It works, but I keep getting error of "Warning Namespace system.collection is never used.
Anyways I need this in c#, I tried to figure out how to convert it, with no success. That's probably because I don't know Java. Also tried looking online for the c# version, also without success.
Any help is very much appreciated, been looking for this since February this year.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
how to know when list is empty? 3 Answers
How To Assign List Elements To Array Elements? 2 Answers
GUI.Window write elements by pages 0 Answers