Example #1
0
 void L_onProgress(LoadingEventArg arg)
 {
     if (onProgressFn != null)
     {
         onProgressFn.call(arg);
     }
 }
Example #2
0
 static public int get_current(IntPtr l)
 {
     try {
         Hugula.Loader.LoadingEventArg self = (Hugula.Loader.LoadingEventArg)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.current);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #3
0
 static public int constructor(IntPtr l)
 {
     try {
         Hugula.Loader.LoadingEventArg o;
         o = new Hugula.Loader.LoadingEventArg();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #4
0
 static public int set_current(IntPtr l)
 {
     try {
         Hugula.Loader.LoadingEventArg self = (Hugula.Loader.LoadingEventArg)checkSelf(l);
         System.Int32 v;
         checkType(l, 2, out v);
         self.current = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #5
0
        internal static IEnumerator StartClearOldFiles(System.Action <LoadingEventArg> onProgress, System.Action onComplete)
        {
            string        path  = CUtils.GetRealPersistentDataPath();
            DirectoryInfo dinfo = new DirectoryInfo(path);

            if (dinfo.Exists)
            {
                var allFiles        = dinfo.GetFiles("*", SearchOption.AllDirectories);
                var loadingEventArg = new LoadingEventArg();
                loadingEventArg.total = allFiles.Length;

                FileInfo fino;
                for (int i = 0; i < allFiles.Length; i++)
                {
                    fino = allFiles[i];
                    fino.Delete();
                    loadingEventArg.current++;
                    loadingEventArg.progress = (float)loadingEventArg.current / (float)loadingEventArg.total;
                    if (onProgress != null)
                    {
                        onProgress(loadingEventArg);
                    }
                    yield return(null);
                }
                ;

                if (onProgress != null)
                {
                    onProgress(loadingEventArg);
                }
            }

            if (onComplete != null)
            {
                onComplete();
            }
        }
Example #6
0
        private static IEnumerator StartClearOldFiles(System.Action <LoadingEventArg> onProgress, System.Action onComplete)
        {
            var    allStreamAbs = fileManifest.allAbInfo;
            var    oldAbs       = updateFileManifest.allAbInfo;
            ABInfo abinfo;
            var    loadingEventArg = new LoadingEventArg();

            loadingEventArg.total = oldAbs.Count;
            for (int i = 0; i < oldAbs.Count; i++)
            {
                abinfo = oldAbs[i];
                loadingEventArg.current++;

                if (!fileManifest.CheckABCrc(abinfo))
                {
                    FileHelper.DeletePersistentFile(abinfo.abName);
#if UNITY_EDITOR
                    Debug.LogFormat("Delete old file ({0})", abinfo.abName);
#endif
                    loadingEventArg.progress = (float)loadingEventArg.current / (float)loadingEventArg.total;
                    if (onProgress != null)
                    {
                        onProgress(loadingEventArg);
                    }
                    yield return(null);
                }
            }
            if (onProgress != null)
            {
                onProgress(loadingEventArg);
            }
            if (onComplete != null)
            {
                onComplete();
            }
        }
Example #7
0
 void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     loadingEvent = new LoadingEventArg();
     CreateFreeLoader();
 }
Example #8
0
 void L_onProgress(CResLoader loader, LoadingEventArg arg)
 {
     if (onProgressFn != null)
         onProgressFn.call(loader, arg);
 }
Example #9
0
 void L_onProgress(LoadingEventArg arg)
 {
     if (onProgressFn != null)
         onProgressFn.call(arg);
 }
Example #10
0
 void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     loadingEvent = new LoadingEventArg();
     CreateFreeLoader();
 }