Thanks for the follow up... You have a couple different questions here, and I'll do my best to answer them.
Regarding accessing WinRT APIs in Unity, you will need to wrap them in the pre-processor directive in order not to see script errors. When you build the Universal Windows project type from the Unity Build settings, the flag will be set and your code will be included. For more information, you can refer to the Unity documentation here:
Universal Windows Platform: WinRT API in C# scripts
In general, you should consider writing your files to one of the known file locations / libraries:
Files and folders in the Music, Pictures, and Videos libraries
The question about accessing content on the device has a bit of a different answer. There are only two primary ways to connect into the device to access it:
- Using the Device Portal
- Connecting the device via USB
When you connect via the device portal, you will have access to a bit more of the files on the device, specifically the content under AppData\Local\Packages<productname>\LocalState. So if you write to this path (similar to the Unity Player Log), you will need to utilize device portal to access it via a browser experience.
When you connect via USB (and log into the device), we expose part of the storage via MTP (Media Transfer Protocol). This has a subset of the content that is available via device portal. The easiest way to access the content here is via File Explorer, and you would just need to ensure that you put the file in a known location as discussed in the article linked above.
It would be possible if you wanted to programmatically access the content via an MTP client application. One way to do this would be via the Windows Media Device Manager SDK which is included as part of the standard Windows SDK:
Windows Media Device Manager SDK
However, this would not generally enable you to see additional file locations beyond what File Explorer would typically show you.