public void ResetPlatformData() { if (CustomDebug.Enable) { if (OnSpriteCollectionReset != null) { OnSpriteCollectionReset(this); } } tk2dEditorSpriteDataUnloader.Unregister(this); if (platformSpecificData != null) { platformSpecificData.DestroyTextureInsts(); platformSpecificData.DestroyMaterialInsts(); } DestroyTextureInsts(); DestroyMaterialInsts(); if (platformSpecificData) { platformSpecificData = null; } materialInsts = null; }
/// <summary> /// Unloads the atlas texture data in this sprite collection. /// This will be reloaded when the data is accessed again. /// Make sure all sprites using this collection have already been destroyed. /// </summary> public void UnloadTextures() { // Debug.Log(Resources.FindObjectsOfTypeAll(typeof(Texture2D)).Length); tk2dSpriteCollectionData theInst = inst; foreach (Texture2D texture in theInst.textures) { Resources.UnloadAsset(texture); } theInst.DestroyMaterialInsts(); theInst.DestroyTextureInsts(); // Debug.Log(Resources.FindObjectsOfTypeAll(typeof(Texture2D)).Length); }
public void ResetPlatformData() { tk2dEditorSpriteDataUnloader.Unregister(this); if (platformSpecificData != null) { platformSpecificData.DestroyTextureInsts(); platformSpecificData.DestroyMaterialInsts(); } DestroyTextureInsts(); DestroyMaterialInsts(); if (platformSpecificData) { platformSpecificData = null; } materialInsts = null; }