splitext( dest)ĭest = dest + '.png' data. # make sure that the dir of that path exists os. # create dest based on original path dest = os. # alternative way which keeps the original path for path, obj in env. splitext( dest)ĭest = dest + '.png' img = data. # make sure that the extension is correct # you probably only want to do so with images/textures dest, ext = os. # iterate over internal objects for obj in env. # load that file via UnityPy.load env = UnityPy. # iterate over all files in source folder for root, dirs, files in os. Import os import UnityPy def unpack_all_assets( source_folder : str, destination_folder : str):