using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour {
public GameObject go;
public UIPanel panel;
public UIPanel panel2;
private GameObject child;
public void DeleteRows() {
// Destroy();
DestroyImmediate(panel2.gameObject);
StartCoroutine(UnloadResource());
}
public void Create() {
GameObject tmp;
if (child != null) {
for (int i = 0; i < 200; i++) {
tmp = Instantiate(go) as GameObject;
tmp.transform.parent = panel2.transform;
tmp.transform.localScale = Vector3.one;
}
}
}
IEnumerator UnloadResource() {
yield return new WaitForEndOfFrame
(); Resources.UnloadUnusedAssets();
}
}