UnityStreamingAssetsFS
Namespace: Shadop.Archmage.Sdk
Implements the IFS interface to load files from Unity StreamingAssets via UnityWebRequest.
Paths are resolved relative to Application.streamingAssetsPath.
Only LoadAtlasAsync is supported, and it must be called from the main thread.
public class UnityStreamingAssetsFS : IFSInheritance Object → UnityStreamingAssetsFS
Implements IFS
Remarks:
On WebGL, StreamingAssets is deployed to the web server along with the build, so files are downloaded over HTTP. A 404 response is treated as a missing file. Any other error, such as a 403 response or a network failure, makes the load fail.
Properties
Section titled “Properties”MainThreadOnly
Section titled “MainThreadOnly”public bool MainThreadOnly { get; }Property Value
Section titled “Property Value”Constructors
Section titled “Constructors”UnityStreamingAssetsFS()
Section titled “UnityStreamingAssetsFS()”public UnityStreamingAssetsFS()Methods
Section titled “Methods”ReadAllBytes(String)
Section titled “ReadAllBytes(String)”public Byte[] ReadAllBytes(string path)Parameters
Section titled “Parameters”path String
Returns
Section titled “Returns”ReadAllBytesAsync(String, CancellationToken)
Section titled “ReadAllBytesAsync(String, CancellationToken)”public Task<Byte[]> ReadAllBytesAsync(string path, CancellationToken cancellationToken)Parameters
Section titled “Parameters”path String
cancellationToken CancellationToken
Returns
Section titled “Returns”FileExists(String)
Section titled “FileExists(String)”Checks the file system directly where StreamingAssets is a plain directory. Returns true on platforms where it is a URI (Android, WebGL).
public bool FileExists(string path)Parameters
Section titled “Parameters”path String
Returns
Section titled “Returns”DirectoryExists(String)
Section titled “DirectoryExists(String)”Checks the file system directly where StreamingAssets is a plain directory. Returns true on platforms where it is a URI (Android, WebGL).
public bool DirectoryExists(string path)Parameters
Section titled “Parameters”path String