public static IEnumerator ReadCardFromCardFileToCurrentCardCoroutine(Image CardImage, InputField CardNameInputField, InputField CardTextInputField, string directory, string id) { isRunningCoroutine = true; string json_and_image_id = "0"; // 1) Open ".card" by parsing and decompressing the ".tar.gzip" and put it into a compatible Json and TextureImage DAO ReadTarGzip.ReadCardFromTGZ(id + ".cse-card", directory); // 2) Read Json ReadJson.ReadCardFromJSON(CardNameInputField, CardTextInputField, directory, json_and_image_id); // 3) Read TextureImage CardImage.overrideSprite = ReadCardTextureFromPNGTextureImageData(directory, json_and_image_id); //After we're done reading the uncompressed stuff, we need to pretend they never were extracted and clean stuff if (directory == null) { directory = Application.dataPath + "/Card Set Editor Projects/"; } File.Delete(directory + json_and_image_id + ".json"); File.Delete(directory + json_and_image_id + ".png"); yield return(null); isRunningCoroutine = false; }