Skip to content

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 : IFS

Inheritance 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.

public bool MainThreadOnly { get; }

Boolean

public UnityStreamingAssetsFS()
public Byte[] ReadAllBytes(string path)

path String

Byte[]

ReadAllBytesAsync(String, CancellationToken)

Section titled “ReadAllBytesAsync(String, CancellationToken)”
public Task<Byte[]> ReadAllBytesAsync(string path, CancellationToken cancellationToken)

path String

cancellationToken CancellationToken

Task<Byte[]>

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)

path String

Boolean

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)

path String

Boolean