- Home /
Sort a list by apparition
Hello! I'm not sure how to make a list with textlabels and organise them. Maybe there is a better option but more or less I want to do something similar to this.
#pragma strict
var a = false;
var b = false;
var c = false;
var d = false;
Having different variables, when I activate them (randomly), It has to appear one behind the other.
function onGUI (){
if (a){
GUI.Label(a position), "Buy apples");
}
if (b){
GUI.Label(a position), "Do my bed");
}
if (c){
GUI.Label(a position), "Do my homework");
}
}
In other words, if I have "a" but not "b" I don't want to have an empty space between a and c. And I mean sort by apparition, because it can be as well "c", "a", "b".
Do you know what is the best way to do that?
Comment
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Get list of gameObjects and change booleans within them 2 Answers
Sort list game objects based on name 3 Answers
how to make letters appear one by one in a list 1 Answer
Sorting a list based of a variable 1 Answer