Exemple #1
0
 static public int addStyle(IntPtr l)
 {
     try {
         XLoading     self = (XLoading)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         UnityEngine.GameObject a2;
         checkType(l, 3, out a2);
         UnityEngine.UI.Slider a3;
         checkType(l, 4, out a3);
         UnityEngine.UI.Image a4;
         checkType(l, 5, out a4);
         UnityEngine.UI.Text a5;
         checkType(l, 6, out a5);
         UnityEngine.UI.Text a6;
         checkType(l, 7, out a6);
         var ret = self.addStyle(a1, a2, a3, a4, a5, a6);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #2
0
    private void LoadRoot()
    {
        GameObject temp = GameObject.Find("UIRoot");

        if (temp != null)
        {
            GameObject.Destroy(temp);
        }
        string     rootpath = "UI/UIRoot";
        GameObject go       = XResources.Load <GameObject>(rootpath, AssetType.Prefab);

        GameObject.DontDestroyOnLoad(go);

        _uiCamera   = go.GetComponent <Camera>();
        _canvas     = go.transform.GetChild(0).GetComponent <Canvas>();
        _fade       = _canvas.transform.GetChild(0).GetComponent <Image>();
        _fade.color = new Color(1, 1, 1, 0);
        _loadimg    = _canvas.transform.GetChild(1).GetComponent <Image>();
        _loadtxt    = _loadimg.transform.GetChild(0).GetComponent <Text>();
        XLoading.Show(true);
        XTableMgr.tableLoaded += XLoading.OnLoadFinish;
        go = new GameObject("EventSystem");
        go.AddComponent <EventSystem>();
        go.AddComponent <StandaloneInputModule>();
        GameObject.DontDestroyOnLoad(go);
    }
Exemple #3
0
 static public int endShow(IntPtr l)
 {
     try {
         XLoading self = (XLoading)checkSelf(l);
         self.endShow();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #4
0
 static public int get_tip(IntPtr l)
 {
     try {
         XLoading self = (XLoading)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.tip);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #5
0
 static public int set_tip(IntPtr l)
 {
     try {
         XLoading self = (XLoading)checkSelf(l);
         string   v;
         checkType(l, 2, out v);
         self.tip = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #6
0
 static public int set__isAutoEnd(IntPtr l)
 {
     try {
         XLoading       self = (XLoading)checkSelf(l);
         System.Boolean v;
         checkType(l, 2, out v);
         self._isAutoEnd = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #7
0
 static public int set_progress(IntPtr l)
 {
     try {
         XLoading self = (XLoading)checkSelf(l);
         float    v;
         checkType(l, 2, out v);
         self.progress = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #8
0
 static public int set__showSyleId(IntPtr l)
 {
     try {
         XLoading     self = (XLoading)checkSelf(l);
         System.Int32 v;
         checkType(l, 2, out v);
         self._showSyleId = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #9
0
 static public int set_styles(IntPtr l)
 {
     try {
         XLoading self = (XLoading)checkSelf(l);
         System.Collections.Generic.Dictionary <System.Int32, XLoading.XLoadingStyle> v;
         checkType(l, 2, out v);
         self.styles = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #10
0
 static public int setAutoProgress(IntPtr l)
 {
     try {
         XLoading   self = (XLoading)checkSelf(l);
         XIProgress a1;
         checkType(l, 2, out a1);
         self.setAutoProgress(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #11
0
 static public int delStyle(IntPtr l)
 {
     try {
         XLoading     self = (XLoading)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         var ret = self.delStyle(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #12
0
 static public int beginShow(IntPtr l)
 {
     try {
         XLoading     self = (XLoading)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         XIProgress a2;
         checkType(l, 3, out a2);
         System.Boolean a3;
         checkType(l, 4, out a3);
         self.beginShow(a1, a2, a3);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #13
0
    void Start()
    {
        if (is_start_by_editor)
        {
            GameEnine.Init(this);
            _cut_scene_camera = new XCutSceneCamera();
            _cut_scene_camera.Initialize();
            _cut_scene_camera.Effect(cut_scene_data.CameraClip, cut_scene_data.Trigger);
            _cut_scene_camera.UnityCamera.fieldOfView = cut_scene_data.FieldOfView;
            XLoading.Show(false);
        }
        else
        {
            XScene.singleton.GameCamera.Effect(cut_scene_data.CameraClip, cut_scene_data.Trigger);
            XScene.singleton.GameCamera.UnityCamera.fieldOfView = cut_scene_data.FieldOfView;
        }
        start_play_time = Time.time;
        XCutSceneUI.singleton.Initial();

        if (!cut_scene_data.GeneralShow)
        {
            for (int i = 0, max = cut_scene_data.Actors.Count; i < max; i++)
            {
                XActorDataClip clip = cut_scene_data.Actors[i];
                XResources.Load <AnimationClip>(clip.Clip, AssetType.Anim);
                _times.Add(XTimerMgr.singleton.SetTimer(clip.TimeLineAt / FPS - 0.016f, BeOnStage, clip));
            }
            for (int i = 0, max = cut_scene_data.Player.Count; i < max; i++)
            {
                XPlayerDataClip clip = cut_scene_data.Player[i];
                XResources.Load <AnimationClip>(clip.Clip1, AssetType.Anim);
                _times.Add(XTimerMgr.singleton.SetTimer(clip.TimeLineAt / FPS - 0.016f, BePlayerOnStage, clip));
            }
            for (int i = 0, max = cut_scene_data.Fxs.Count; i < max; i++)
            {
                _times.Add(XTimerMgr.singleton.SetTimer(cut_scene_data.Fxs[i].TimeLineAt / FPS, Fx, cut_scene_data.Fxs[i]));
            }
        }
        for (int i = 0, max = cut_scene_data.Audios.Count; i < max; i++)
        {
            XAudioDataClip clip = cut_scene_data.Audios[i];
            _times.Add(XTimerMgr.singleton.SetTimer(clip.TimeLineAt / FPS, Audio, clip));
        }
        if (cut_scene_data.AutoEnd)
        {
            _times.Add(XTimerMgr.singleton.SetTimer((cut_scene_data.TotalFrame - 30) / FPS, EndShow, null));
        }
        if (cut_scene_data.Mourningborder)
        {
            XCutSceneUI.singleton.SetVisible(true);
            for (int i = 0, max = cut_scene_data.SubTitle.Count; i < max; i++)
            {
                XSubTitleDataClip clip = cut_scene_data.SubTitle[i];
                _times.Add(XTimerMgr.singleton.SetTimer(clip.TimeLineAt / FPS, SubTitle, clip));
            }
            for (int i = 0, max = cut_scene_data.Slash.Count; i < max; i++)
            {
                _times.Add(XTimerMgr.singleton.SetTimer(cut_scene_data.Slash[i].TimeLineAt / FPS, Slash, cut_scene_data.Slash[i]));
            }
        }
    }
Exemple #14
0
 // Use this for initialization
 void Awake()
 {
     instance = this;
     DontDestroyOnLoad(this);
 }
Exemple #15
0
    // XApp 启动
    IEnumerator init()
    {
        XDebug.Log("init:" + Time.realtimeSinceStartup);
        // 先启动装载服务器
        yield return(StartCoroutine(XLoad.instance.init()));

        if (!XLoad.instance.isOK)
        {
            // 弹对话框
            XDebug.LogError("致命错误XLoad没有装载成功");
        }
        else
        {
            // 先加载进度条
            XLoadDesc desc = XLoad.load("Assets/Res/progress/style1.prefab");
            yield return(desc);

            if (desc.ob == null)
            {
                XDebug.LogError("Assets/Res/progress/style1.prefab not exist, quit!!!");
                yield break;
            }

            XDebug.Log("onLoadProgress:" + Time.realtimeSinceStartup);
            xloading = this.gameObject.AddComponent <XLoading>();
            xpool    = this.gameObject.AddComponent <XPoolManager>();

            GameObject loadingStyle0 = GameObject.Instantiate(desc.ob, uiProgress) as GameObject;
            xloading.addStyle(0, loadingStyle0, loadingStyle0.transform.Find("Slider").GetComponent <UnityEngine.UI.Slider>(), null,
                              loadingStyle0.transform.Find("Info").GetComponent <UnityEngine.UI.Text>(), null);


            // 切换进度条
            XLoading.instance.beginShow(0);

            bool wantUpdateVersion = XConf.isUpdateVersion;

            // 是否更新
            if (!XLoad.instance.isLoadFromAB)
            {
                // editor状态下并不更新版本
                wantUpdateVersion = false;
            }


            if (wantUpdateVersion)
            {
                // 创建更新对象
                XUpdate xup = new XUpdate();

                // 开启更新协程
                yield return(StartCoroutine(xup.updateVersion(XConf.publishUrl)));

                if (xup.isFail)
                {
                    // 失败了MSGBOX,重新更新,下载链接?都是从头走,清除已装载的东西
                    yield break;
                }
                else
                {
                    // 成功了,那么走正式流程,再次来一发
                    // 清理操作-------
                    // StartCoroutine(init());
                    // yield break;
                }
            }


            XLoadDesc descBack = XLoad.load("Assets/Res/ui/uiBack.prefab");
            XLoading.instance.beginShow(0, descBack);

            yield return(descBack);

            if (descBack.ob != null)
            {
                GameObject.Instantiate(descBack.ob, this.uiBack);
            }

            #region 装载lua
            // 开始装载lua文件
            XLoadDesc descLua = loadLua();
            XLoading.instance.beginShow(0, descLua);

            yield return(descLua);

            var luaAsInfo = descLua.assetInfo;
            if (luaAsInfo.isSuccess)
            {
                luaDict = descLua.obDict;
            }

            // 装载lua函数
            LuaState.loaderDelegate += loadLuaFile;

            // 创建一个luaSvr
            luaSvr = new LuaSvr();
            luaSvr.init();

            XLuaBind luaBind = new XLuaBind {
                luaSvr = luaSvr
            };
            XLoading.instance.beginShow(0, luaBind);

            // 全局装载函数

            // 绑定的时间
            yield return(luaBind);

            // 绑定完成后从Main开始执行
            luaSvr.onBindComplete(() =>
            {
                // 初始化调试器
                ldb = new DebugInterface(luaSvr.luaState);
                ldb.init();


                XDebug.Log("luaBindComplete start Main" + Time.realtimeSinceStartup);
                luaSvr.start(XConf.luastart);
                XDebug.Log("luaBindComplete end Main" + Time.realtimeSinceStartup);
            });
            #endregion
        }
    }