internal void Init()
    {
#if !CS2LUA_DEBUG
        ObjectCache.AddAQName(typeof(LinkedListNode <CsLibrary.EntityInfo>), "LinkedListNodeEntityInfo");
        ObjectCache.AddAQName(typeof(KeyValuePair <int, int>), "IntIntPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <int, float>), "IntFloatPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <int, string>), "IntStrPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <int, object>), "IntObjPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <int, UnityEngine.Object>), "IntUobjPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <string, int>), "StrIntPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <string, float>), "StrFloatPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <string, string>), "StrStrPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <string, object>), "StrObjPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <string, UnityEngine.Object>), "StrUobjPair");
        m_LuaSvr.init(null, () => {
            var entry = (LuaTable)m_LuaSvr.start("Cs2LuaScript__Program");
            entry.invoke("Init");
            m_LuaInited = true;
        });
#endif

#if CS2LUA_DEBUG || UNITY_IOS
        Cs2LuaScript.Program.Init();
#else
        Load(LoadFileFromStreamingAssets("Cs2LuaScript.dll"));
        if (null != m_Assembly)
        {
            var type = m_Assembly.GetType("Cs2LuaScript.Program");
            type.InvokeMember("Init", BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod, null, null, null);
        }
#endif
    }
Exemple #2
0
    internal void Init()
    {
        ObjectCache.AddAQName(typeof(KeyValuePair <int, int>), "IntIntPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <int, float>), "IntFloatPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <int, string>), "IntStrPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <int, object>), "IntObjPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <int, UnityEngine.Object>), "IntUobjPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <string, int>), "StrIntPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <string, float>), "StrFloatPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <string, string>), "StrStrPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <string, object>), "StrObjPair");
        ObjectCache.AddAQName(typeof(KeyValuePair <string, UnityEngine.Object>), "StrUobjPair");
        m_LuaSvr.init(null, () => {
            var entry = (LuaTable)m_LuaSvr.start("program");
            if (entry != null)
            {
                entry.invoke("Init");
                m_LuaInited = true;
            }
        });
#if CS2LUA_DEBUG || UNITY_IOS
        Cs2LuaScript.Program.Init();
#else
        Load(Path.Combine(Application.streamingAssetsPath, "Cs2LuaScript.dll"));
        if (null != m_Assembly)
        {
            var type = m_Assembly.GetType("Program");
            type.InvokeMember("Init", BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod, null, null, null);
        }
#endif
    }