GetUnpackRayRef() public static method

public static GetUnpackRayRef ( IntPtr L ) : void
L System.IntPtr
return void
示例#1
0
        public static Ray ToRay(IntPtr L, int stackPos)
        {
            int num = LuaDLL.lua_gettop(L);

            LuaStatic.GetUnpackRayRef(L);
            LuaDLL.lua_pushvalue(L, stackPos);
            if (LuaDLL.lua_pcall(L, 1, 2, 0) == 0)
            {
                Vector3 vector  = ToLua.ToVector3(L, num + 1);
                Vector3 vector2 = ToLua.ToVector3(L, num + 2);
                return(new Ray(vector, vector2));
            }
            string msg = LuaDLL.lua_tostring(L, -1);

            throw new LuaException(msg, null, 1);
        }
示例#2
0
        public static Ray ToRay(IntPtr L, int stackPos)
        {
            int top = LuaDLL.lua_gettop(L);

            LuaStatic.GetUnpackRayRef(L);
            LuaDLL.lua_pushvalue(L, stackPos);

            if (LuaDLL.lua_pcall(L, 1, 2, 0) == 0)
            {
                Vector3 origin = ToVector3(L, top + 1);
                Vector3 dir    = ToVector3(L, top + 2);
                return(new Ray(origin, dir));
            }
            else
            {
                string error = LuaDLL.lua_tostring(L, -1);
                throw new LuaException(error);
            }
        }