Sample.cs
usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;// 2次元配列// * Table/表publicclassSample:MonoBehaviour{// 宣言方法// 1次元配列int[]arrayInt=newint[3];// 2次元配列int[,]tabelInt=newint[3,2];voidStart(){// 代入方法tabelInt[0,0]=1;tabelInt[2,1]=10;// 取得方法//int x = tabelInt[0, 0];//長さ//Debug.Log(arrayInt.Length);Debug.Log(tabelInt.GetLength(0));Debug.Log(tabelInt.GetLength(1));for(intx=0;x<tabelInt.GetLength(0);x++){for(inty=0;y<tabelInt.GetLength(1);y++){Debug.Log(tabelInt[x,y]);}}for(inty=0;y<tabelInt.GetLength(1);y++){for(intx=0;x<tabelInt.GetLength(0);x++){Debug.Log(tabelInt[x,y]);}}}}