Example #1
0
    static int SetColor(IntPtr L)
    {
        L.ChkArgsCount(2);
        ThreeDButton obj  = (ThreeDButton)L.ChkUnityObjectSelf(1, "ThreeDButton");
        var          arg0 = L.ToColor(2);

        obj.SetColor(arg0);
        return(0);
    }
Example #2
0
    static int get_color(IntPtr L)
    {
        object       o   = L.ToUserData(1);
        ThreeDButton obj = (ThreeDButton)o;

        if (obj == null)
        {
            LuaTypes types = L.Type(1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name color");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index color on a nil value");
            }
        }

        L.PushUData(obj.color);
        return(1);
    }
Example #3
0
    static int set_onClick(IntPtr L)
    {
        object       o   = L.ToUserData(1);
        ThreeDButton obj = (ThreeDButton)o;

        if (obj == null)
        {
            LuaTypes types = L.Type(1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name onClick");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index onClick on a nil value");
            }
        }

        LuaTypes funcType = L.Type(3);

        if (funcType != LuaTypes.LUA_TFUNCTION)
        {
            obj.onClick = (UnityEngine.Events.UnityAction <GameObject>)L.ChkUserData(3, typeof(UnityEngine.Events.UnityAction <GameObject>));
        }
        else
        {
            LuaFunction func = L.ToLuaFunction(3);
            obj.onClick = (param0) =>
            {
                int top = func.BeginPCall();
                L.PushLightUserData(param0);
                func.PCall(top, 1);
                func.EndPCall(top);
            };
        }
        return(0);
    }