Ejemplo n.º 1
0
        static public bool checkType(IntPtr l, int p, out Color c)
        {
            float x, y, z, w;

            LuaDLL.luaS_checkColor(l, p, out x, out y, out z, out w);
            c = new Color(x, y, z, w);
            return(true);
        }
Ejemplo n.º 2
0
        static public bool checkType(IntPtr l, int p, out Color c)
        {
            float x, y, z, w;

            if (LuaDLL.luaS_checkColor(l, p, out x, out y, out z, out w) != 0)
            {
                throw new Exception(string.Format("Invalid color argument at {0}", p));
            }
            c = new Color(x, y, z, w);
            return(true);
        }
Ejemplo n.º 3
0
        static public bool checkType(IntPtr l, int p, out Color c)
        {
            float x, y, z, w;

            if (LuaDLL.lua_type(l, p) == LuaTypes.LUA_TUSERDATA)
            {
                object o = checkObj(l, p);
                if (o is Color32)
                {
                    c = (Color32)o;
                    return(true);
                }
                throw new Exception(string.Format("Invalid color argument at {0}", p));
            }
            if (LuaDLL.luaS_checkColor(l, p, out x, out y, out z, out w) != 0)
            {
                throw new Exception(string.Format("Invalid color argument at {0}", p));
            }
            c = new Color(x, y, z, w);
            return(true);
        }