Esempio n. 1
0
 public static GameResFactory Instance()
 {
     if (sInstance == null)
     {
         sInstance = new GameResFactory();
         sInstance.mResManager = AppFacade.Instance.GetManager<ResourceManager>();
     }
     return sInstance;
 }
Esempio n. 2
0
 public static GameResFactory Instance()
 {
     if (sInstance == null)
     {
         sInstance             = new GameResFactory();
         sInstance.mResManager = AppFacade.Instance.GetManager <ResourceManager>();
     }
     return(sInstance);
 }
Esempio n. 3
0
 static int DestroyAllUIEffect(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         GameResFactory obj = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         obj.DestroyAllUIEffect();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 4
0
 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));
     }
 }
Esempio n. 5
0
 static int DestroyUIPrefab(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         GameResFactory         obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.GameObject));
         obj.DestroyUIPrefab(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 6
0
 static int CloseUIOnTouch(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         GameResFactory obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         LuaFunction    arg0 = ToLua.CheckLuaFunction(L, 2);
         obj.CloseUIOnTouch(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 7
0
 static int SetOnGetFocusCallBack(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         GameResFactory obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         LuaFunction    arg0 = ToLua.CheckLuaFunction(L, 2);
         obj.SetOnGetFocusCallBack(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 8
0
 static int LoadedLevelName(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         GameResFactory obj = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         int            o   = obj.LoadedLevelName();
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 9
0
 static int LoadLevel(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         GameResFactory obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         string         arg0 = ToLua.CheckString(L, 2);
         obj.LoadLevel(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 10
0
    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();
        }
    }
Esempio n. 11
0
 static int GetResSprite(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         GameResFactory     obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         string             arg0 = ToLua.CheckString(L, 2);
         UnityEngine.Sprite o    = obj.GetResSprite(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 12
0
 static int LoadMaterial(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         GameResFactory       obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         UnityEngine.UI.Image arg0 = (UnityEngine.UI.Image)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.UI.Image));
         string arg1 = ToLua.CheckString(L, 3);
         obj.LoadMaterial(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 13
0
 static int UIActiveFunc(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         GameResFactory         obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.GameObject));
         int arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
         obj.UIActiveFunc(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 14
0
 static int GetUIEffect(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         GameResFactory obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         string         arg0 = ToLua.CheckString(L, 2);
         LuaFunction    arg1 = ToLua.CheckLuaFunction(L, 3);
         obj.GetUIEffect(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 15
0
 static int GetString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         GameResFactory obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         string         arg0 = ToLua.CheckString(L, 2);
         string         o    = obj.GetString(arg0);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 16
0
 static int SetInt(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         GameResFactory obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         string         arg0 = ToLua.CheckString(L, 2);
         int            arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
         obj.SetInt(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 17
0
    static int set_mAssetPacker(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameResFactory obj  = (GameResFactory)o;
            AssetPacker    arg0 = (AssetPacker)ToLua.CheckUnityObject(L, 2, typeof(AssetPacker));
            obj.mAssetPacker = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index mAssetPacker on a nil value" : e.Message));
        }
    }
Esempio n. 18
0
    static int get_mAssetPacker(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameResFactory obj = (GameResFactory)o;
            AssetPacker    ret = obj.mAssetPacker;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index mAssetPacker on a nil value" : e.Message));
        }
    }
Esempio n. 19
0
 static int GetResourcesPrefab(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         GameResFactory        obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         string                arg0 = ToLua.CheckString(L, 2);
         UnityEngine.Transform arg1 = (UnityEngine.Transform)ToLua.CheckUnityObject(L, 3, typeof(UnityEngine.Transform));
         LuaFunction           arg2 = ToLua.CheckLuaFunction(L, 4);
         obj.GetResourcesPrefab(arg0, arg1, arg2);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 20
0
 static int LoadAudioClip(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         GameResFactory          obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         UnityEngine.AudioSource arg0 = (UnityEngine.AudioSource)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.AudioSource));
         string      arg1             = ToLua.CheckString(L, 3);
         LuaFunction arg2             = ToLua.CheckLuaFunction(L, 4);
         obj.LoadAudioClip(arg0, arg1, arg2);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 21
0
 static int GetUIPrefab(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 5);
         GameResFactory        obj  = (GameResFactory)ToLua.CheckObject <GameResFactory>(L, 1);
         string                arg0 = ToLua.CheckString(L, 2);
         UnityEngine.Transform arg1 = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 3);
         LuaTable              arg2 = ToLua.CheckLuaTable(L, 4);
         LuaFunction           arg3 = ToLua.CheckLuaFunction(L, 5);
         obj.GetUIPrefab(arg0, arg1, arg2, arg3);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 22
0
 static int GetUIPrefabByIdentification(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 6);
         GameResFactory        obj  = (GameResFactory)ToLua.CheckObject(L, 1, typeof(GameResFactory));
         string                arg0 = ToLua.CheckString(L, 2);
         UnityEngine.Transform arg1 = (UnityEngine.Transform)ToLua.CheckUnityObject(L, 3, typeof(UnityEngine.Transform));
         LuaTable              arg2 = ToLua.CheckLuaTable(L, 4);
         LuaFunction           arg3 = ToLua.CheckLuaFunction(L, 5);
         object                arg4 = ToLua.ToVarObject(L, 6);
         obj.GetUIPrefabByIdentification(arg0, arg1, arg2, arg3, arg4);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 23
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);
        }
    }
Esempio n. 24
0
	static int _CreateGameResFactory(IntPtr L)
	{
		try
		{
			int count = LuaDLL.lua_gettop(L);

			if (count == 0)
			{
				GameResFactory obj = new GameResFactory();
				ToLua.PushObject(L, obj);
				return 1;
			}
			else
			{
				return LuaDLL.luaL_throw(L, "invalid arguments to ctor method: GameResFactory.New");
			}
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}
Esempio n. 25
0
    static int _CreateGameResFactory(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                GameResFactory obj = new GameResFactory();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: GameResFactory.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }