Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region BIG EYE ROAD
- for (int col = 0; col < table.GetLength(0); col++)
- {
- for (int row = 0; row < table.GetLength(1); row++)
- {
- if (table[moveCol, moveRow] == null)
- {
- col0 = table[colIndex1, row];
- col1 = table[colIndex2, row];
- if (col0 != null)
- {
- sum1 += 1;
- }
- if (col1 != null)
- {
- sum2 += 1;
- }
- counter1++;
- }
- else
- {
- if (counter1 == 0)
- {
- data1 = table[firstTableCol, firstTableRow];
- data2 = table[secondTableCol, secondTableRow];
- data3 = table[thirdTableCol, thirdTableRow];
- data4 = table[fourthTableCol, fourthTableRow];
- }
- else
- {
- if (moveRow > 1)
- {
- firstTableRow = moveRow;
- secondTableRow = moveRow - 1;
- thirdTableRow = moveRow;
- fourthTableRow = moveRow - 1;
- }
- else if (moveRow == 1)
- {
- firstTableRow = 1;
- secondTableRow = 0;
- thirdTableRow = 1;
- fourthTableRow = 0;
- }
- if (moveCol > 1)
- {
- firstTableCol = moveCol;
- secondTableCol = moveCol;
- thirdTableCol = moveCol - 1;
- fourthTableCol = moveCol - 1;
- }
- data1 = table[firstTableCol, firstTableRow];
- data2 = table[secondTableCol, secondTableRow];
- data3 = table[thirdTableCol, thirdTableRow];
- data4 = table[fourthTableCol, fourthTableRow];
- }
- if (data1 != null && data2 != null && data3 != null && data4 != null)
- {
- redBead();
- }
- else if (data1 != null && data2 != null && data3 == null && data4 == null)
- {
- redBead();
- }
- else
- {
- blueBead();
- }
- if (moveRow + 1 < table.GetLength(1))
- {
- moveRow++;
- }
- }
- }
- if (sum1 == sum2)
- {
- redBead();
- }
- else
- {
- blueBead();
- }
- //reset
- sum1 = 0;
- sum2 = 0;
- if (colIndex1 + 1 < table.GetLength(0) && colIndex2 + 1 < table.GetLength(0))
- {
- colIndex1++;
- colIndex2++;
- }
- else
- {
- //nothing to do
- }
- if (moveCol + 1 < table.GetLength(0))
- {
- moveCol += 1;
- }
- if (moveRow + 1 < table.GetLength(1))
- {
- moveRow = 1;
- }
- #endregion
- }
- }
- void blueBead()
- {
- p = Instantiate(big_eye_gameobject) as GameObject;
- p.transform.SetParent(pos_big_eye_road);
- p.transform.localScale = Vector3.one;
- img = (RawImage)p.GetComponent<RawImage>();
- img.texture = NewTexture[0];
- p.SetActive(true);
- p.transform.localPosition = new Vector3(bigEyeXIndex * 56, bigEyeXIndex * -45, 0f);
- }
- void redBead()
- {
- p = Instantiate(big_eye_gameobject) as GameObject;
- p.transform.SetParent(pos_big_eye_road);
- p.transform.localScale = Vector3.one;
- img = (RawImage)p.GetComponent<RawImage>();
- img.texture = NewTexture[1];
- p.SetActive(true);
- p.transform.localPosition = new Vector3(bigEyeXIndex * 56, bigEyeXIndex * -45, 0f);
- }
Add Comment
Please, Sign In to add comment