binder = new CriFsBinder();
loader1 = new CriFsLoader();
loader2 = new CriFsLoader();
Create a binder and a couple of loaders when the application is started. if ( CriFsBinder.GetStatus(bind_id) == CriFsBinder.Status.Complete ) {
bind_stat = BindStatus.Complete;
}
Check whether binding has finished successfully by specifying the binding ID in the GetStatus function. int file_size = (int)binder.GetFileSize(path);
buffer1 = new byte[file_size];
loader1.Load(binder, path, 0, file_size, buffer1);
Obtain the file size by specifying the file name in the binder. If the CPK is bound, you can obtain the file size immediately from the directory information that is already in memory. if ( loader1.GetStatus() == CriFsLoader.Status.Complete ) {
this.texture = new Texture2D(0, 0);
this.texture.LoadImage(buffer1);
loader1.Stop();
}
Use the GetStatus function to check whether the loading is finished or not.