Ejemplo n.º 1
0
    static int LoadAsset(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent), typeof(string), typeof(GameFramework.Resource.LoadAssetCallbacks)))
            {
                UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.ToObject(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                GameFramework.Resource.LoadAssetCallbacks arg1 = (GameFramework.Resource.LoadAssetCallbacks)ToLua.ToObject(L, 3);
                obj.LoadAsset(arg0, arg1);
                return(0);
            }
            else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent), typeof(string), typeof(GameFramework.Resource.LoadAssetCallbacks), typeof(object)))
            {
                UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.ToObject(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                GameFramework.Resource.LoadAssetCallbacks arg1 = (GameFramework.Resource.LoadAssetCallbacks)ToLua.ToObject(L, 3);
                object arg2 = ToLua.ToVarObject(L, 4);
                obj.LoadAsset(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityGameFramework.Runtime.ResourceComponent.LoadAsset"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 2
0
    static int SetDecryptResourceCallback(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 2);
            UnityGameFramework.Runtime.ResourceComponent   obj  = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
            GameFramework.Resource.DecryptResourceCallback arg0 = null;
            LuaTypes funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (GameFramework.Resource.DecryptResourceCallback)ToLua.CheckObject(L, 2, typeof(GameFramework.Resource.DecryptResourceCallback));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(GameFramework.Resource.DecryptResourceCallback), func) as GameFramework.Resource.DecryptResourceCallback;
            }

            obj.SetDecryptResourceCallback(arg0);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 3
0
    static int LoadBytes(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 3);
            UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
            string arg0 = ToLua.CheckString(L, 2);
            GameFramework.Resource.LoadBytesCallback arg1 = null;
            LuaTypes funcType3 = LuaDLL.lua_type(L, 3);

            if (funcType3 != LuaTypes.LUA_TFUNCTION)
            {
                arg1 = (GameFramework.Resource.LoadBytesCallback)ToLua.CheckObject(L, 3, typeof(GameFramework.Resource.LoadBytesCallback));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 3);
                arg1 = DelegateFactory.CreateDelegate(typeof(GameFramework.Resource.LoadBytesCallback), func) as GameFramework.Resource.LoadBytesCallback;
            }

            obj.LoadBytes(arg0, arg1);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 4
0
 private void Start()
 {
     m_ResourceComponent = GameEntry.GetComponent<m_ResourceComponent>();
     if (m_ResourceComponent == null)
     {
         return;
     }
 }
Ejemplo n.º 5
0
 private void Start()
 {
     m_ResourceComponent = GameEntry.GetComponent <ResourceComponent>();
     if (m_ResourceComponent == null)
     {
         Log.Fatal("Resource component is invalid.");
         return;
     }
 }
Ejemplo n.º 6
0
 static int UpdateResources(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         obj.UpdateResources();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 7
0
 static int UnloadAsset(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         object arg0 = ToLua.ToVarObject(L, 2);
         obj.UnloadAsset(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 8
0
 static int GetReadWritePath(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         string o = obj.GetReadWritePath();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 9
0
 static int ForceUnloadUnusedAssets(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
         obj.ForceUnloadUnusedAssets(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 10
0
 static int SetResourceMode(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityGameFramework.Runtime.ResourceComponent obj  = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         GameFramework.Resource.ResourceMode          arg0 = (GameFramework.Resource.ResourceMode)ToLua.CheckObject(L, 2, typeof(GameFramework.Resource.ResourceMode));
         obj.SetResourceMode(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 11
0
 static int SetCurrentVariant(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         string arg0 = ToLua.CheckString(L, 2);
         obj.SetCurrentVariant(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 12
0
            protected override void OnDrawScrollableWindow()
            {
                GUILayout.Label("<b>Operations</b>");
                GUILayout.BeginVertical("box");
                {
                    ObjectPoolComponent objectPoolComponent = GameEntry.GetComponent <ObjectPoolComponent>();
                    if (objectPoolComponent != null)
                    {
                        if (GUILayout.Button("Object Pool Release", GUILayout.Height(30f)))
                        {
                            objectPoolComponent.Release();
                        }

                        if (GUILayout.Button("Object Pool Release All Unused", GUILayout.Height(30f)))
                        {
                            objectPoolComponent.ReleaseAllUnused();
                        }
                    }

                    ResourceComponent resourceCompoent = GameEntry.GetComponent <ResourceComponent>();
                    if (resourceCompoent != null)
                    {
                        if (GUILayout.Button("Unload Unused Assets", GUILayout.Height(30f)))
                        {
                            resourceCompoent.ForceUnloadUnusedAssets(false);
                        }

                        if (GUILayout.Button("Unload Unused Assets and Garbage Collect", GUILayout.Height(30f)))
                        {
                            resourceCompoent.ForceUnloadUnusedAssets(true);
                        }
                    }

                    if (GUILayout.Button("Shutdown Game Framework (None)", GUILayout.Height(30f)))
                    {
                        GameEntry.Shutdown(ShutdownType.None);
                    }
                    if (GUILayout.Button("Shutdown Game Framework (Restart)", GUILayout.Height(30f)))
                    {
                        GameEntry.Shutdown(ShutdownType.Restart);
                    }
                    if (GUILayout.Button("Shutdown Game Framework (Quit)", GUILayout.Height(30f)))
                    {
                        GameEntry.Shutdown(ShutdownType.Quit);
                    }
                }
                GUILayout.EndVertical();
            }
Ejemplo n.º 13
0
 static int CheckVersionList(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         GameFramework.Resource.CheckVersionListResult o = obj.CheckVersionList(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
            public override void Initialize(params object[] args)
            {
                m_BaseComponent = GameEntry.GetComponent <BaseComponent>();
                if (m_BaseComponent == null)
                {
                    Log.Fatal("Base component is invalid.");
                    return;
                }

                m_ResourceComponent = GameEntry.GetComponent <ResourceComponent>();
                if (m_ResourceComponent == null)
                {
                    Log.Fatal("Resource component is invalid.");
                    return;
                }
            }
Ejemplo n.º 15
0
        private void Start()
        {
            m_ResourceComponent = GameEntry.GetComponent <ResourceComponent>();
            if (m_ResourceComponent == null)
            {
                Log.Fatal("Resource component is invalid.");
                return;
            }

            m_ConfigManager = GameFrameworkEntry.GetModule <IConfigManager>();
            if (m_ConfigManager == null)
            {
                Log.Fatal("ConfigCustom manager is invalid.");
                return;
            }
        }
Ejemplo n.º 16
0
        private void Start()
        {
            m_ResourceComponent = GameEntry.GetComponent <ResourceComponent>();
            if (m_ResourceComponent == null)
            {
                Log.Fatal("Resource component is invalid.");
                return;
            }

            m_LocalizationManager = GameFrameworkEntry.GetModule <ILocalizationManager>();
            if (m_LocalizationManager == null)
            {
                Log.Fatal("Localization manager is invalid.");
                return;
            }
        }
Ejemplo n.º 17
0
 static int GetResourceGroupProgress(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         string arg0 = ToLua.CheckString(L, 2);
         float  o    = obj.GetResourceGroupProgress(arg0);
         LuaDLL.lua_pushnumber(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 18
0
 static int UnloadAssetBundle(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         string arg0 = ToLua.CheckString(L, 2);
         bool   arg1 = LuaDLL.luaL_checkboolean(L, 3);
         obj.UnloadAssetBundle(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 19
0
 static int GetAssetBundle(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         string arg0 = ToLua.CheckString(L, 2);
         UnityEngine.AssetBundle o = obj.GetAssetBundle(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 20
0
    static int set_UpdatePrefixUri(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)o;
            string arg0 = ToLua.CheckString(L, 2);
            obj.UpdatePrefixUri = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index UpdatePrefixUri on a nil value" : e.Message));
        }
    }
Ejemplo n.º 21
0
    static int get_AssetPriority(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)o;
            int ret = obj.AssetPriority;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index AssetPriority on a nil value" : e.Message));
        }
    }
Ejemplo n.º 22
0
    static int set_ResourceExpireTime(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)o;
            float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.ResourceExpireTime = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index ResourceExpireTime on a nil value" : e.Message));
        }
    }
Ejemplo n.º 23
0
    static int get_UpdatePrefixUri(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)o;
            string ret = obj.UpdatePrefixUri;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index UpdatePrefixUri on a nil value" : e.Message));
        }
    }
Ejemplo n.º 24
0
    static int set_LoadResourceAgentHelperCount(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.LoadResourceAgentHelperCount = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index LoadResourceAgentHelperCount on a nil value" : e.Message));
        }
    }
Ejemplo n.º 25
0
    static int get_UnloadUnusedAssetsInterval(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)o;
            float ret = obj.UnloadUnusedAssetsInterval;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index UnloadUnusedAssetsInterval on a nil value" : e.Message));
        }
    }
Ejemplo n.º 26
0
    static int get_ReadWritePathType(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)o;
            UnityGameFramework.Runtime.ReadWritePathType ret = obj.ReadWritePathType;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index ReadWritePathType on a nil value" : e.Message));
        }
    }
Ejemplo n.º 27
0
    static int set_IsLoadResourceReady(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.IsLoadResourceReady = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index IsLoadResourceReady on a nil value" : e.Message));
        }
    }
Ejemplo n.º 28
0
 static int LoadAssetBundle(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         string arg0 = ToLua.CheckString(L, 2);
         GameFramework.Resource.LoadAssetBundleCallbacks arg1 = (GameFramework.Resource.LoadAssetBundleCallbacks)ToLua.CheckObject(L, 3, typeof(GameFramework.Resource.LoadAssetBundleCallbacks));
         object arg2 = ToLua.ToVarObject(L, 4);
         obj.LoadAssetBundle(arg0, arg1, arg2);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 29
0
 static int GetLocalResourceVersion(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         string arg0 = ToLua.CheckString(L, 2);
         byte[] arg1 = ToLua.CheckByteBuffer(L, 3);
         string arg2 = ToLua.CheckString(L, 4);
         int    o    = obj.GetLocalResourceVersion(arg0, arg1, arg2);
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 30
0
 static int UpdateVersionList(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 5);
         UnityGameFramework.Runtime.ResourceComponent obj = (UnityGameFramework.Runtime.ResourceComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.ResourceComponent));
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         int arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
         int arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
         int arg3 = (int)LuaDLL.luaL_checknumber(L, 5);
         obj.UpdateVersionList(arg0, arg1, arg2, arg3);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }