using UnityEngine; using System.Collections; public class TreeMapDelete : MonoBehaviour { // Use this for initialization void Start () { TreeMap map = new TreeMap (); for (int count = 1; count < 5; count++) { map = map.put (count, count); map.checkDepth (); } ArrayList list = new ArrayList (); for (int i = 1; i < 5; i++) { list.Add (i); } for (int i = 1; i < 5; i++) { int ran = Random.Range (1, 6); object obj = list [i]; list [i] = list [ran]; list [ran] = obj; } foreach(int num in list){ Debug.Log (num); map = map.delete(num); map.checkDepth(); } Debug.Log ("end"); } }