using UnityEngine;
using System.Collections;
public class Chap10_8 : MonoBehaviour {
public GameObject[] cubes;
Stack stack = new Stack();
// Use this for initialization
void Start () {
for(int i = 0; i < 5; i++)
stack.Push(cubes[i]);
}
// Update is called once per frame
void Update () {
if(Input.GetKeyDown(KeyCode.Space)){
Destroy(stack.Pop() as GameObject);
}
}
}
'Computer Language > 유니티' 카테고리의 다른 글
윤석씨 (바둑) (0) | 2014.05.19 |
---|---|
선생님 예제 입니다. (0) | 2014.05.19 |
이것만은 알고 갚시다. 10장 배열 컬렉션, 그리고 인덱서 (0) | 2014.05.19 |
arraylist, queue, stack, hashtable, sortedlist (0) | 2014.05.19 |
바둑게임 선생님 일차! (0) | 2014.05.19 |