CRIWARE Unity Plugin Manual
Last Updated: 2025-05-08
FileMajik PRO for Web
Overview
This chapter gives some information about FileMajik PRO for Web.
Limitations
CriFsWebInstaller can be used.
CriFsInstaller does not work.
Specification of each file system
You can access the following file systems.
When a file path is passed as an argument to a loading function of ADX2, Sofdec2 or FileMajik PRO,
the file acquisition is performed using the file system that corresponds to that path.
Remote file system
For a URL path starting with "http://" or "https://",
send a request to the remote server using fetch Application
to retrieve the file.
In the WebGL environment, StreamingAssets is a directory on a remote server,
and Application.streamingAssetsPath returns a URL.
The access speed is affected by the communication status of the network,
and an error occurs when the connection is interrupted or a timeout occurs during loading.
Once a file has been successfully loaded, it is cached using IndexedDB and will be loaded from the cache until the page is reloaded.
There is also a restriction concerning Cross-Origin Resource Sharing (CORS).
To know more, please refer to Resource loading fails (CORS) for details.
Memory file system
If the URL path starts with "/", access is done with the Emscripten standard file system.
It is possible to access the data by using Unity's File class etc.
In that case, Application.temporaryCachePath returns "/tmp".
Although the access speed is higher when using the memory file system, the memory cost is of course higher as well.
Because it is volatile storage, it will be reset when reloading the web page.
IndexedDB Filesystem
The file system using IndexedDB backs up nonvolatile storage.
It is mounted on "/idbfs" and can be accessed like a memory file system.
Application.persistentDataPath returns "/idbfs".
Please note that it is similar to the memory file system with a backup function,
so it will cost memory.
When writing files with the File class etc., in order to synchronize with nonvolatile storage, it is necessary to call FS.syncfs() from the WebGL NativePlugin.
There is a difference of storage capacity between browsers.
If indexedDB is invalidated in the browser settings, or if it is not permitted to write,an error will occur.
When starting a Unity WebGL game, all the files saved in IndexedDB are loaded into memory,
therefore increasing the number of files will reduce the memory available and affect startup time.
Also, since "idbfs" is shared on the same host, files from other games may be adversely affected.
Notes:When using WWW.LoadFromCacheOrDownload(), data will be written under "/idbfs".