Instance() public static method

public static Instance ( ) : GameResFactory,
return GameResFactory,
 static int Instance(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 0);
         GameResFactory o = GameResFactory.Instance();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    private IEnumerator InitFunc(Action OnLoadStep, Action loadOver)
    {
        GameObject gameMgr = GameObject.Find("GameManager");

        if (gameMgr != null)
        {
            gameMgr.AddComponent <AppView>();
        }

        //-----------------关联命令-----------------------
        AppFacade.Instance.RegisterCommand(NotiConst.DISPATCH_MESSAGE, typeof(SocketCommand));

        AppFacade.Instance.AddManager <LuaManager>();
        ResourceManager resMgr = AppFacade.Instance.AddManager <ResourceManager>();

        AppFacade.Instance.AddManager <NetworkManager>();
        AppFacade.Instance.AddManager <ThreadManager>();
        AppFacade.Instance.AddManager <SimpleTimerManager>();

        bool canNext = false;

        resMgr.LoadAssetPacker("res_asset_packer.unity", "res_asset_packer", delegate(UnityEngine.Object[] objs)
        {
            if (objs.Length == 0)
            {
                return;
            }
            GameResFactory.Instance().mAssetPacker = objs[0] as AssetPacker;
            canNext = true;
        });

        while (canNext == false)
        {
            yield return(null);
        }

        if (OnLoadStep != null)
        {
            OnLoadStep();
        }

        AppFacade.Instance.AddManager <GameManager>();

        if (loadOver != null)
        {
            loadOver();
        }
    }
Beispiel #3
0
    //加载资源包
    IEnumerator LoadAssetPacker()
    {
        bool canNext = false;

        resMgr.LoadAssetPacker("res_asset_packer.unity3d", "res_asset_packer", delegate(UnityEngine.Object[] objs)
        {
            if (objs.Length == 0)
            {
                return;
            }
            GameResFactory.Instance().mAssetPacker = objs[0] as AssetPacker;
            GameResFactory.Instance().mAssetPacker.CopyAssets();
            canNext = true;
        });

        while (canNext == false)
        {
            yield return(null);
        }
    }