Esempio n. 1
0
    static int Bind(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                CSharpLua.BridgeMonoBehaviour obj = (CSharpLua.BridgeMonoBehaviour)ToLua.CheckObject(L, 1, typeof(CSharpLua.BridgeMonoBehaviour));
                LuaTable arg0 = ToLua.CheckLuaTable(L, 2);
                obj.Bind(arg0);
                return(0);
            }
            else if (count == 3)
            {
                CSharpLua.BridgeMonoBehaviour obj = (CSharpLua.BridgeMonoBehaviour)ToLua.CheckObject(L, 1, typeof(CSharpLua.BridgeMonoBehaviour));
                LuaTable arg0 = ToLua.CheckLuaTable(L, 2);
                string   arg1 = ToLua.CheckString(L, 3);
                obj.Bind(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: CSharpLua.BridgeMonoBehaviour.Bind"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Esempio n. 2
0
 public void Bind()
 {
     foreach (var pair in SerializeInfo.MonoBehaviourFields)
     {
         var gameObject = (GameObject)SerializeInfo.Objects[pair.Key];
         var bridges    = gameObject.GetComponents <BridgeMonoBehaviour>();
         var item       = bridges.Single(i => i.LuaClass == pair.Value);
         SerializeInfo.Objects[pair.Key] = item;
     }
     BridgeMonoBehaviour.Bind(ClassName, SerializeInfo.GetSerializeData(), SerializeInfo.GetSerializeObjects());
 }
 public void Bind()
 {
     foreach (var field in SerializeInfo.MonoBehaviourFields)
     {
         var gameObject = (GameObject)SerializeInfo.ObjectsPool[field.PoolIndex];
         var bridges    = gameObject.GetComponents <BridgeMonoBehaviour>();
         var item       = bridges.Single(i => i.LuaClass == field.ClassName);
         SerializeInfo.ObjectsPool[field.PoolIndex] = item;
     }
     BridgeMonoBehaviour.Bind(ClassName, SerializeInfo.GetSerializeData(), SerializeInfo.GetSerializeObjects());
 }
Esempio n. 4
0
 static int Bind(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         CSharpLua.BridgeMonoBehaviour obj = (CSharpLua.BridgeMonoBehaviour)ToLua.CheckObject(L, 1, typeof(CSharpLua.BridgeMonoBehaviour));
         LuaTable arg0 = ToLua.CheckLuaTable(L, 2);
         obj.Bind(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }