GetPackRaycastHit() public static method

public static GetPackRaycastHit ( IntPtr L ) : void
L System.IntPtr
return void
Example #1
0
        public static void Push(IntPtr L, RaycastHit hit, int flag)
        {
            LuaStatic.GetPackRaycastHit(L);

            if ((flag & RaycastBits.Collider) != 0)
            {
                Push(L, hit.collider);
            }
            else
            {
                LuaDLL.lua_pushnil(L);
            }

            LuaDLL.lua_pushnumber(L, hit.distance);

            if ((flag & RaycastBits.Normal) != 0)
            {
                Push(L, hit.normal);
            }
            else
            {
                LuaDLL.lua_pushnil(L);
            }

            if ((flag & RaycastBits.Point) != 0)
            {
                Push(L, hit.point);
            }
            else
            {
                LuaDLL.lua_pushnil(L);
            }

            if ((flag & RaycastBits.Rigidbody) != 0)
            {
                Push(L, hit.rigidbody);
            }
            else
            {
                LuaDLL.lua_pushnil(L);
            }

            if ((flag & RaycastBits.Transform) != 0)
            {
                Push(L, hit.transform);
            }
            else
            {
                LuaDLL.lua_pushnil(L);
            }

            if (LuaDLL.lua_pcall(L, 6, 1, 0) != 0)
            {
                string error = LuaDLL.lua_tostring(L, -1);
                throw new LuaException(error);
            }
        }
Example #2
0
 public static void Push(IntPtr L, RaycastHit hit, int flag)
 {
     LuaStatic.GetPackRaycastHit(L);
     if ((flag & 1) != 0)
     {
         ToLua.Push(L, hit.get_collider());
     }
     else
     {
         LuaDLL.lua_pushnil(L);
     }
     LuaDLL.lua_pushnumber(L, (double)hit.get_distance());
     if ((flag & 2) != 0)
     {
         ToLua.Push(L, hit.get_normal());
     }
     else
     {
         LuaDLL.lua_pushnil(L);
     }
     if ((flag & 4) != 0)
     {
         ToLua.Push(L, hit.get_point());
     }
     else
     {
         LuaDLL.lua_pushnil(L);
     }
     if ((flag & 8) != 0)
     {
         ToLua.Push(L, hit.get_rigidbody());
     }
     else
     {
         LuaDLL.lua_pushnil(L);
     }
     if ((flag & 16) != 0)
     {
         ToLua.Push(L, hit.get_transform());
     }
     else
     {
         LuaDLL.lua_pushnil(L);
     }
     if (LuaDLL.lua_pcall(L, 6, 1, 0) != 0)
     {
         string msg = LuaDLL.lua_tostring(L, -1);
         throw new LuaException(msg, null, 1);
     }
 }