示例#1
0
 static public int set_onCompleteHandler(IntPtr l)
 {
     try {
         LResUpdate self = (LResUpdate)checkSelf(l);
         UnityEngine.Events.UnityAction v;
         int op = LuaDelegation.checkDelegate(l, 2, out v);
         if (op == 0)
         {
             self.onCompleteHandler = v;
         }
         else if (op == 1)
         {
             self.onCompleteHandler += v;
         }
         else if (op == 2)
         {
             self.onCompleteHandler -= v;
         }
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#2
0
 static public int checkUpdate(IntPtr l)
 {
     try {
         LResUpdate self = (LResUpdate)checkSelf(l);
         self.checkUpdate();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#3
0
    void complete()
    {
        if (LGameConfig.GetInstance().isShowFps)
        {
            LFPSView.Show();
        }

        if (!LGameConfig.GetInstance().isDebug) //生产环境
        {
            if (LGameConfig.GetInstance().isHotFix)
            {
                GameObject canvas    = GameObject.Find("Canvas");
                Text       lab_unzip = null;
                if (canvas.transform.Find("prog"))
                {
                    canvas.transform.Find("prog").gameObject.SetActive(true);
                    lab_unzip = canvas.transform.Find("prog/lab_unzip").GetComponent <Text>();
                }

                GameObject obj = new GameObject();
                obj.name = "ResUpdate";
                LResUpdate resUpdate = obj.AddComponent <LResUpdate> ();
                resUpdate.onUnzipProgressHandler = (int step) => {
                    if (lab_unzip)
                    {
                        lab_unzip.text = step.ToString();
                    }
                    Debug.Log(" unzip " + step);
                };
                resUpdate.onCompleteHandler = () => {
                    Destroy(obj);
                    LLoadBundle.GetInstance().LoadAllBundles(new string[] { "@lua.ab", "@luaconfig.ab" }, () =>
                    {
                        _l.start("main");
                    });
                };
                resUpdate.checkUpdate();
            }
            else
            {
                LLoadBundle.GetInstance().LoadAllBundles(new string[] { "@lua.ab", "@luaconfig.ab" }, () =>
                {
                    _l.start("main");
                });
            }
        }
        else //PC端开发
        {
            _l.start("main");
        }
    }
示例#4
0
文件: Game.cs 项目: memsyi/uLui
    void complete()
    {
        LFPSView.Show();

        if (!LGameConfig.GetInstance().isDebug) //生产环境
        {
            GameObject obj = new GameObject();
            obj.name = "ResUpdate";
            LResUpdate resUpdate = obj.AddComponent <LResUpdate>();
            resUpdate.onCompleteHandler = () =>
            {
                Destroy(obj);
                _l.start("main");
            };
            resUpdate.checkUpdate();
        }
        else
        {
            _l.start("main");
        }
    }
示例#5
0
    void complete()
    {
        if (LGameConfig.GetInstance().isShowFps)
        {
            LFPSView.Show();
        }

        if (!LGameConfig.GetInstance().isDebug) //生产环境
        {
            if (LGameConfig.GetInstance().isHotFix)
            {
                GameObject obj = new GameObject();
                obj.name = "ResUpdate";
                LResUpdate resUpdate = obj.AddComponent <LResUpdate> ();
                resUpdate.onCompleteHandler = () => {
                    Destroy(obj);
                    LLoadBundle.GetInstance().LoadAllBundles(new string[] { "@lua.ab" }, () =>
                    {
                        _l.start("main");
                    });
                };
                resUpdate.checkUpdate();
            }
            else
            {
                LLoadBundle.GetInstance().LoadAllBundles(new string[] { "@lua.ab" }, () =>
                {
                    _l.start("main");
                });
            }
        }
        else //PC端开发
        {
            _l.start("main");
        }
    }