Beispiel #1
0
    public ConveyTool CreateConveyTool(uint sceneid, string uid, Vector3 rect, GameObject go, LuaTable luaTable)
    {
        ConveyTool t = go.GetComponent <ConveyTool>();

        if (t == null)
        {
            t = go.AddComponent <ConveyTool>();
        }
        entityBehaviors.Add(uid, t);
        t.uid      = uid;
        t.sceneid  = sceneid;
        t.luaTable = luaTable;

        BoxCollider boxCollider = go.GetComponent <BoxCollider>();

        if (boxCollider == null)
        {
            boxCollider = go.AddComponent <BoxCollider>();
        }
        boxCollider.isTrigger = true;
        boxCollider.size      = rect;
        boxCollider.center    = new Vector3(0, rect.y / 2, 0);

        return(t);
    }
Beispiel #2
0
    static int set_triggerFunc(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ConveyTool obj  = (ConveyTool)o;
            string     arg0 = ToLua.CheckString(L, 2);
            obj.triggerFunc = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index triggerFunc on a nil value" : e.Message));
        }
    }
Beispiel #3
0
    static int get_luaTable(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ConveyTool            obj = (ConveyTool)o;
            LuaInterface.LuaTable ret = obj.luaTable;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index luaTable on a nil value" : e.Message));
        }
    }
Beispiel #4
0
    static int get_triggerFunc(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ConveyTool obj = (ConveyTool)o;
            string     ret = obj.triggerFunc;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index triggerFunc on a nil value" : e.Message));
        }
    }
Beispiel #5
0
    static int set_luaTable(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ConveyTool obj  = (ConveyTool)o;
            LuaTable   arg0 = ToLua.CheckLuaTable(L, 2);
            obj.luaTable = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index luaTable on a nil value" : e.Message));
        }
    }
 static int CreateConveyTool(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 6);
         EntityBehaviorMgr obj       = (EntityBehaviorMgr)ToLua.CheckObject(L, 1, typeof(EntityBehaviorMgr));
         uint   arg0                 = (uint)LuaDLL.luaL_checknumber(L, 2);
         string arg1                 = ToLua.CheckString(L, 3);
         UnityEngine.Vector3    arg2 = ToLua.ToVector3(L, 4);
         UnityEngine.GameObject arg3 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 5, typeof(UnityEngine.GameObject));
         LuaTable   arg4             = ToLua.CheckLuaTable(L, 6);
         ConveyTool o                = obj.CreateConveyTool(arg0, arg1, arg2, arg3, arg4);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }