using UnityEngine;
using System.Collections;
using System;
public class chap10_Cube : MonoBehaviour {
void Show(int[,] array){
for(int i = 0; i < 2; i++){
for(int j = 0; j < 3; j++){
print (string.Format("array[{0}, {1}] = {2}", i, j , array[i, j]));
}
}
}
// Use this for initialization
void Start () {
int[,] array = new int[2, 3]{{1, 2, 3} , {4, 5, 6}} ;
// array[0, 0] = 1;
// array[0, 1] = 2;
// array[0, 2] = 3;
int[,] array2 = new int[,]{{1, 2, 3} , {4, 5, 6}} ;
int[,] array3 = {{1, 2, 3} , {4, 5, 6}} ;
Show (array2);
Show (array3);
Show (new[,]{{11, 22, 33} , {44, 55, 66}} );
}
// Update is called once per frame
void Update () {
}
}
'Computer Language > 유니티' 카테고리의 다른 글
시험 예제 (0) | 2014.05.16 |
---|---|
이차원 배열 getUpperBound []<- [] (0) | 2014.05.16 |
find 함수 (0) | 2014.05.16 |
c# array2 (0) | 2014.05.16 |
c# array (0) | 2014.05.16 |