//释放资源 public void Dispose() { if (abLoader != null) { abLoader.Dispose(); } }
void Update() { if (texturesLoader != null) { if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha1)) { Debug.Log("Unloads unused textures in the bundle"); texturesLoader.DisposeUnused(); } else if (Input.GetKey(KeyCode.D) && Input.GetKeyDown(KeyCode.Alpha1)) { Debug.Log("Unloads all textures in the bundle"); texturesLoader.Dispose(); } } if (materialsLoader != null) { if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha2)) { Debug.Log("Unloads unused materials in the bundle"); materialsLoader.DisposeUnused(); } else if (Input.GetKey(KeyCode.D) && Input.GetKeyDown(KeyCode.Alpha2)) { Debug.Log("Unloads all materials in the bundle"); materialsLoader.Dispose(); } } if (prefabsLoader != null) { if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha3)) { Debug.Log("Unloads unused prefabs in the bundle"); prefabsLoader.DisposeUnused(); } else if (Input.GetKey(KeyCode.D) && Input.GetKeyDown(KeyCode.Alpha3)) { Debug.Log("Unloads all prefabs in the bundle"); prefabsLoader.Dispose(); } } }
public void Dispose() { assetLoader.Dispose(); }