Beispiel #1
0
    void Awake()
    {
        if (_instance == null)
        {
            _instance        = this;
            this.requestList = new List <CriFsRequest>();

            /* 高速化のため、ダミーを追加してListの内部配列の自動確保を促す
             * 追加による自動確保が目的なのでダミーはすぐに削除する */
            CriFsRequest dummy = new CriFsRequest();
            this.requestList.Add(dummy);
            this.requestList.RemoveAt(0);
        }
        else
        {
            GameObject.Destroy(this);
        }
    }
Beispiel #2
0
    void Update()
    {
                #pragma warning disable 162
        if (CriWare.supportsCriFsInstaller == true)
        {
            CriFsInstaller.ExecuteMain();
            if (CriFsWebInstaller.isInitialized)
            {
                CriFsWebInstaller.ExecuteMain();
            }
        }
                #pragma warning restore 162

        for (int i = 0; i < this.requestList.Count; i++)
        {
            CriFsRequest request = this.requestList[i];
            request.Update();
        }
        this.requestList.RemoveAll((CriFsRequest request) => { return(request.isDone || request.isDisposed); });
    }
Beispiel #3
0
 public CriFsInstallRequest(CriFsBinder srcBinder, string srcPath, string dstPath, CriFsRequest.DoneDelegate doneDelegate, int installBufferSize)
 {
     this.sourcePath = srcPath;
     this.destinationPath = dstPath;
     this.doneDelegate = doneDelegate;
     this.progress = 0.0f;
     this.installer = new CriFsInstaller();
     this.installer.Copy(srcBinder, srcPath, dstPath, installBufferSize);
 }
Beispiel #4
0
 public static CriFsLoadFileRequest LoadFile(string path, CriFsRequest.DoneDelegate doneDelegate, int readUnitSize = DefaultReadUnitSize)
 {
     return CriFsServer.instance.LoadFile(null, path, doneDelegate, readUnitSize);
 }
Beispiel #5
0
 public static CriFsInstallRequest Install(CriFsBinder srcBinder, string srcPath, string dstPath, CriFsRequest.DoneDelegate doneDeleagate)
 {
     return CriFsServer.instance.Install(srcBinder, srcPath, dstPath, doneDeleagate);
 }
Beispiel #6
0
 public static CriFsInstallRequest Install(string srcPath, string dstPath, CriFsRequest.DoneDelegate doneDeleagate)
 {
     return CriFsUtility.Install(null, srcPath, dstPath, doneDeleagate);
 }
Beispiel #7
0
    public CriFsLoadFileRequest(CriFsBinder srcBinder, string path, CriFsRequest.DoneDelegate doneDelegate, int readUnitSize)
    {
        /* パスの保存 */
        this.path = path;

        /* 完了コールバック指定 */
        this.doneDelegate = doneDelegate;

        /* readUnitSizeの保存 */
        this.readUnitSize = readUnitSize;

        /* ファイルのバインド要求 */
        if (srcBinder == null) {
            this.newBinder = new CriFsBinder();
            this.refBinder = this.newBinder;
            this.bindId = this.newBinder.BindFile(srcBinder, path);
            this.phase = Phase.Bind;
        } else {
            this.newBinder = null;
            this.refBinder = srcBinder;
            this.fileSize = srcBinder.GetFileSize(path);
            if (this.fileSize < 0) {
                this.phase = Phase.Error;
            } else {
                this.phase = Phase.Load;
            }
        }
    }
Beispiel #8
0
 public CriFsInstallRequest Install(CriFsBinder srcBinder, string srcPath, string dstPath, CriFsRequest.DoneDelegate doneDelegate)
 {
     var request = new CriFsInstallRequest(srcBinder, srcPath, dstPath, doneDelegate, this.installBufferSize);
     this.requestList.Add(request);
     return request;
 }
Beispiel #9
0
 public void AddRequest(CriFsRequest request)
 {
     this.requestList.Add(request);
 }
Beispiel #10
0
 void Awake()
 {
     if (_instance == null) {
         _instance = this;
         this.requestList = new List<CriFsRequest>();
         /* 高速化のため、ダミーを追加してListの内部配列の自動確保を促す
          * 追加による自動確保が目的なのでダミーはすぐに削除する */
         CriFsRequest dummy = new CriFsRequest();
         this.requestList.Add(dummy);
         this.requestList.RemoveAt(0);
     } else {
         GameObject.Destroy(this);
     }
 }
Beispiel #11
0
 public CriFsLoadFileRequest LoadFile(CriFsBinder binder, string path, CriFsRequest.DoneDelegate doneDelegate, int readUnitSize)
 {
     var request = new CriFsLoadFileRequest(binder, path, doneDelegate, readUnitSize);
     this.AddRequest(request);
     return request;
 }
Beispiel #12
0
 public void AddRequest(CriFsRequest request)
 {
     this.requestList.Add(request);
 }