forked from JXPorter/OkitaUnity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample.cs
More file actions
43 lines (36 loc) · 845 Bytes
/
Example.cs
File metadata and controls
43 lines (36 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using UnityEngine;
using System.Collections;
public class Example : MonoBehaviour
{
// Use this for initialization
void Start()
{
GameObject a = new GameObject("A");
GameObject b = new GameObject("B");
GameObject c = new GameObject("C");
GameObject d = new GameObject("D");
GameObject e = new GameObject("E");
GameObject f = new GameObject("F");
GameObject[,] twoDimension =
new GameObject[2, 3]{ {a, b, c} , {d, e, f} };
InspectArray(twoDimension);
}
void InspectArray(GameObject[,] gos)
{
int columns = gos.GetLength(0);
Debug.Log("Columns: " + columns);
int rows = gos.GetLength(1);
Debug.Log("Rows: " + rows);
for (int c = 0; c < columns; c++)
{
for (int r = 0; r < rows; r++)
{
Debug.Log(gos [c, r].name);
}
}
}
// Update is called once per frame
void Update()
{
}
}