Exemplo n.º 1
0
    void CheckResUpdate()
    {
        Transform bgTrans = CSBridge.s_sceneRoot.FindChild("default_bg(clone)");

        if (bgTrans)
        {
            GameObject.Destroy(bgTrans.gameObject);
        }
        Transform textTrans = CSBridge.s_uiRoot.FindChild("default_text(clone)");

        if (textTrans)
        {
            GameObject.Destroy(textTrans.gameObject);
        }

        AssetBundle loginAB = ABManager.get(AppConst.AB_LOGIN);

        if (null == loginAB)
        {
            Debug.LogError("CheckResUpdate failed,login ab file not found");
            return;
        }

        GameObject bgPrefab = loginAB.LoadAsset("background") as GameObject;

        if (null == bgPrefab)
        {
            Debug.LogError("CheckResUpdate failed,backgroundprefab not found");
        }
        else
        {
            bgTrans = GameObject.Instantiate(bgPrefab).transform;
            bgTrans.SetParent(CSBridge.s_sceneRoot, false);
        }

        if (s_resUpdateChecked)
        {
            GameObject accountPrefab = loginAB.LoadAsset("account") as GameObject;
            if (null == accountPrefab)
            {
                Debug.LogError("CheckResUpdate failed,accountprefab not found");
                return;
            }
            GameObject accountGo = GameObject.Instantiate(accountPrefab);
            accountGo.transform.SetParent(CSBridge.s_uiRoot, false);

            Destroy(this.gameObject);   // destroy appstartcontroller instance
        }
        else
        {
            GameObject resUpdatePrefab = loginAB.LoadAsset("res_update") as GameObject;
            if (null == resUpdatePrefab)
            {
                Debug.LogError("CheckResUpdate failed,resourceupdateprefab not found");
                return;
            }
            GameObject resUpdateGo = GameObject.Instantiate(resUpdatePrefab);
            resUpdateGo.transform.SetParent(CSBridge.s_uiRoot, false);
        }
    }
Exemplo n.º 2
0
 static int get(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         string arg0 = ToLua.CheckString(L, 1);
         UnityEngine.AssetBundle o = ABManager.get(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 3
0
    private void ShowLoginBtn()
    {
        GameObject loginBtnPrefab = ABManager.get(AppConst.AB_LOGIN).LoadAsset("login_btn") as GameObject;

        if (null == loginBtnPrefab)
        {
            Debug.LogError("ShowLoginBtn failed,loginBtnPrefab load failed");
            return;
        }

        GameObject loginBtnGo = GameObject.Instantiate(loginBtnPrefab);

        loginBtnGo.transform.SetParent(CSBridge.s_uiRoot, false);
        //loginBtnGo.transform.localPosition = new Vector3(0f, -425f, 0f);
        //loginBtnGo.transform.localScale = new Vector3(1f, 1f, 1f);

        Destroy(this.gameObject);
        //BGMController btm = BGMController.Instance;
    }
Exemplo n.º 4
0
    IEnumerator AccountLogin()
    {
        // TODO ... account reg or account login to other platform ...
        yield return(new WaitForSeconds(2f));

        // after account login, load the zone list UI ...
        AssetBundle loginAB = ABManager.get(AppConst.AB_LOGIN);

        if (null != loginAB)
        {
            GameObject zongListPrefab = loginAB.LoadAsset("zone_list") as GameObject;
            if (null != zongListPrefab)
            {
                GameObject zoneListGo = GameObject.Instantiate(zongListPrefab);
                zoneListGo.transform.SetParent(CSBridge.s_uiRoot, false);
                Destroy(this.gameObject);   // destroy account controller instance
            }
            else
            {
                Debug.LogError("load asset from login ab failed: zone_list");
            }
        }
    }