Hello,
Besides txt filetypes I have some png-files in the levels folder of the resources folder that should be created as physically .png files in the datapath of the standalone:
foreach(TextAsset example in (TextAsset[])Resources.LoadAll("Levels"))
File.WriteAllText(Application.dataPath+"/Resources/Levels/"+example.name+".png",
example.text);
But I get an error: Cannot cast from source type to destination type.