CRIWARE Unity Plugin Manual
Last Updated: 2024-07-12
Loading a regular file
Data flow
Like any normal file system, FileMajik PRO can access individual files that are not packed.
Overview of loading a file
When a file is loaded, a loader object is automatically created to load it.
The same API can be used, not only to load local files, but also files stored on a remote server.
Process flow
A coroutine is used to load a file.
The yield statement is used to wait for the completion of the loading operation.
A file loading request is issued and the file is loaded asynchronously in the background.
The yield statement waits for the completion of the loading.
If the error returned is null, the file was loaded successfully.
As an example, the following code shows the processing of a text file which was loaded.
yield return request.WaitForDone(this);
if (request.error == null) { // The file is loaded successfully
// Obtain a buffer from the request object and process the data