- Home /
How to Input Image to Array?
So i've been given to this project lately, but because i'm still new in unity i still not accustomed...
here's my array, but i don't know how to put an image to that array, can anyone tell me how to put image?
public Text newText;
int[] array = new int[56];
int[] arro = new int[21];
int i;
int j;
int check = 0;
int check2 = 0;
// Use this for initialization
void Start () {
arro[0] = 1;
arro[8] = 1;
arro[11] = 0;
arro[12] = 0;
arro[13] = 0;
arro[14] = 0;
arro[15] = 0;
arro[16] = 0;
arro[17] = 0;
for (i = 0; i <= 27; i++) {
array [i] = i + 1;
for (j = 1; j <= 7; j++) {
arro [j] = Random.Range(0,9);
//newText.text = newText.text + " " + (arro [j].ToString ());
if (arro[j] == 0){
check++;
}
}
for (j = 1; j <= 7; j++) {
if (arro [j] == 0) {
if (arro [j - 1] == 0) {
check2++;
}
if (arro [j + 1] == 0) {
check2++;
}
if (arro [j + 10] == 0) {
check2++;
}
}
}
if (check <= 2) {
i--;
} else if (check2 <= 1.5 * check) {
i--;
}
else {
for (j = 1; j <= 7; j++) {
newText.text = newText.text + " " + (arro [j].ToString ());
arro [j + 10] = arro [j];
}
newText.text = newText.text + "\n" /*+ (array [i].ToString ())*/;
}
check = 0;
check2 = 0;
}
}
Comment
Your answer
Follow this Question
Related Questions
How to create an image gallery with previous and next button with C#? 6 Answers
How do i load entire folders into arrays? 2 Answers
How to add all sequence images at once in array. 1 Answer
My array of images is null for some reason? 2 Answers
How can I put the single pieces of a sliced Sprite into an array? 0 Answers