public void OnDisable() { #if QINSHI for (int i = 0; i < subscribes.Count; i++) { Utility.EventSystem.Unsubscribe(subscribes[i]); } #endif subscribes.Clear(); TerrainGrassTile[,] tile = rollMap.GetAll(); for (int i = 0; i < tile.GetLength(0); i++) { for (int j = 0; j < tile.GetLength(1); j++) { if (tile[i, j] != null) { GameObject.Destroy(tile[i, j].gameObject); } } } rollMap = null; for (int i = 0; i < tilePool.objects.Count; i++) { GameObject.Destroy(tilePool.objects[i].gameObject); } tilePool = null; meshPool = null; GameObject.Destroy(recyle.gameObject); recyle = null; taskList.Clear(); }