Computer Language/유니티

해쉬 테이블 -> 어레이 리스트

알 수 없는 사용자 2014. 5. 20. 13:25

using UnityEngine;

using System.Collections;



public class chap10_9 : MonoBehaviour {


// Use this for initialization

void Start () {

Hashtable ht = new Hashtable(10);

ht[10] = "c";

ht[11] = "b";

ht[12] = "a";

ht[13] = 300;

/*

foreach(int key in ht.Keys){

print ("key = " + key);

}

foreach(string s in ht.Values){

print ("data = " + s);

}

*/

ArrayList list = new ArrayList(ht.Values);

foreach(object s in list){

print ("list data = " + s);

}

foreach(string s in list){

print ("list data = " + s);

}

}

// Update is called once per frame

void Update () {

}

}