示例#1
0
    public static MessageBox CreateMessageBox()
    {
        XYHY.IResourceMgr  resMgr       = Framework.GameKernel.Get <XYHY.IResourceMgr>();
        UnityEngine.Object verUpdateObj = resMgr.LoadNormalObjSync(new AssetBundleParams("Prefabs/UI/VersionUpdate/message_box_ui", typeof(GameObject)));
        GameObject         verUpdateGo  = GameObject.Instantiate(verUpdateObj) as GameObject;

        XYHY.LuaDestroyBundle ctrl = verUpdateGo.AddComponent <XYHY.LuaDestroyBundle>();
        ctrl.BundleName = "Prefabs/UI/VersionUpdate/message_box_ui";
        ctrl.ResType    = typeof(GameObject);
        verUpdateGo.transform.parent     = UICamera.mainCamera.transform;
        verUpdateGo.transform.localScale = Vector3.one;

        return(verUpdateGo.GetComponent <MessageBox>());
    }
    static int get_strName(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            XYHY.LuaDestroyBundle obj = (XYHY.LuaDestroyBundle)o;
            string ret = obj.strName;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index strName on a nil value" : e.Message));
        }
    }
    static int set_BundleName(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            XYHY.LuaDestroyBundle obj = (XYHY.LuaDestroyBundle)o;
            string arg0 = ToLua.CheckString(L, 2);
            obj.BundleName = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index BundleName on a nil value" : e.Message));
        }
    }
    static int set_ResType(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            XYHY.LuaDestroyBundle obj  = (XYHY.LuaDestroyBundle)o;
            System.Type           arg0 = (System.Type)ToLua.CheckObject(L, 2, typeof(System.Type));
            obj.ResType = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index ResType on a nil value" : e.Message));
        }
    }
    static int get_ResType(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            XYHY.LuaDestroyBundle obj = (XYHY.LuaDestroyBundle)o;
            System.Type           ret = obj.ResType;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index ResType on a nil value" : e.Message));
        }
    }
示例#6
0
    public void InitLoadUI()
    {
        XYHY.LuaDestroyBundle ldb = Utility_GameObject.AddMonoBehaviour <XYHY.LuaDestroyBundle>(this.gameObject);
        ldb.BundleName = LOAD_UI_PREFABS;
        ldb.ResType    = typeof(GameObject);
        AlwaysToTop();

        //scene_config = GameKernel.Get<ILoadSceneSys>().CurSceneConfig();
        //GameObject obj = gameObject.transform.FindChild("tex_bg").gameObject;
        //if (obj != null)
        //{

        /*bg = obj.GetComponent<UITexture>();
         * if (bg != null)
         * {
         *  string nextBgName = "bg_loading";
         *  if (bg.mainTexture == null || (bg.mainTexture != null && !bg.mainTexture.name.Equals(nextBgName)))
         *  {
         *      string lastBgName = null;
         *      string str = "UITextures/Loading/" + nextBgName;
         *      if (bg.mainTexture != null)
         *      {
         *          lastBgName = bg.mainTexture.name;
         *      }
         *      Texture2D tex = GameKernel.GetResourceMgr().LoadImmortalTextureSync(str);
         *      if (tex != null)
         *      {
         *          bg.mainTexture = tex;
         *          bg.MarkAsChanged();
         *      }
         *
         *      if (lastBgName != null && !lastBgName.Equals(nextBgName))
         *      {
         *          GameKernel.GetResourceMgr().UnloadImmortalResource(string.Format("UITextures/Loading/{0}", lastBgName), typeof(Texture2D));
         *      }
         *  }
         * }*/
        //}

        /*obj = gameObject.transform.FindChild("bottom_area/process_bar").gameObject;
         * process = obj.GetComponent<UISlider>();
         * process.value = 0;
         *
         * obj = gameObject.transform.FindChild("bottom_area/lbl_tip").gameObject;
         * tip = obj.GetComponent<UILabel>();
         * if (tip != null)
         * {
         *  tip.text = "正在加载中,请稍后……";
         * }
         * else
         *  obj.SetActive(false);*/


        //obj = gameObject.transform.FindChild("root/tips/lbl_tip").gameObject;
        //newTip = obj.GetComponent<UILabel>();
        //if (newTip != null)
        //    newTip.text = "正在为您加载,即将进入游戏";
        //else
        //    obj.SetActive(false);

        //newActionImg = gameObject.transform.FindChild("root/ani_root/img").GetComponent<UISprite>();
        //newActionImg.gameObject.SetActive(true);

        GameObject actionRoot = gameObject.transform.FindChild("root").gameObject;

        actionRoot.gameObject.SetActive(true);
    }