示例#1
0
 static public int get_lua(IntPtr l)
 {
     try {
         LuaUIBehaviour self = (LuaUIBehaviour)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.lua);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static int ClearClick(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         LuaUIBehaviour obj = (LuaUIBehaviour)ToLua.CheckObject <LuaUIBehaviour>(L, 1);
         obj.ClearClick();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#3
0
 static public int set_lua(IntPtr l)
 {
     try {
         LuaUIBehaviour        self = (LuaUIBehaviour)checkSelf(l);
         UnityEngine.TextAsset v;
         checkType(l, 2, out v);
         self.lua = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#4
0
 static int RegistSelft(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         LuaUIBehaviour obj = (LuaUIBehaviour)ToLua.CheckObject(L, 1, typeof(LuaUIBehaviour));
         obj.RegistSelft();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#5
0
 static int AddButtonDownLisenter(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         LuaUIBehaviour obj  = (LuaUIBehaviour)ToLua.CheckObject(L, 1, typeof(LuaUIBehaviour));
         LuaFunction    arg0 = ToLua.CheckLuaFunction(L, 2);
         obj.AddButtonDownLisenter(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#6
0
 static int SetInteractable(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         LuaUIBehaviour obj  = (LuaUIBehaviour)ToLua.CheckObject(L, 1, typeof(LuaUIBehaviour));
         bool           arg0 = LuaDLL.luaL_checkboolean(L, 2);
         obj.SetInteractable(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#7
0
 static int GetImage(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         LuaUIBehaviour       obj = (LuaUIBehaviour)ToLua.CheckObject(L, 1, typeof(LuaUIBehaviour));
         UnityEngine.UI.Image o   = obj.GetImage();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int RemoveClick(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         LuaUIBehaviour         obj  = (LuaUIBehaviour)ToLua.CheckObject <LuaUIBehaviour>(L, 1);
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject));
         obj.RemoveClick(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#9
0
 static int SetButtonSprites(IntPtr L)
 {
     try
     {
         int                   count = LuaDLL.lua_gettop(L);
         LuaUIBehaviour        obj   = (LuaUIBehaviour)ToLua.CheckObject(L, 1, typeof(LuaUIBehaviour));
         UnityEngine.Sprite[]  arg0  = ToLua.CheckParamsObject <UnityEngine.Sprite>(L, 2, count - 1);
         UnityEngine.UI.Button o     = obj.SetButtonSprites(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#10
0
 static int GetTextWidth(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         LuaUIBehaviour obj  = (LuaUIBehaviour)ToLua.CheckObject(L, 1, typeof(LuaUIBehaviour));
         string         arg0 = ToLua.CheckString(L, 2);
         int            o    = obj.GetTextWidth(arg0);
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#11
0
 static int SetTextColor(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         LuaUIBehaviour      obj  = (LuaUIBehaviour)ToLua.CheckObject(L, 1, typeof(LuaUIBehaviour));
         UnityEngine.UI.Text arg0 = (UnityEngine.UI.Text)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.UI.Text));
         UnityEngine.Color   arg1 = ToLua.ToColor(L, 3);
         obj.SetTextColor(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#12
0
 static int GetTextColor(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         LuaUIBehaviour      obj  = (LuaUIBehaviour)ToLua.CheckObject(L, 1, typeof(LuaUIBehaviour));
         UnityEngine.UI.Text arg0 = (UnityEngine.UI.Text)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.UI.Text));
         UnityEngine.Color   o    = obj.GetTextColor(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#13
0
 static int SetImageSprite(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         LuaUIBehaviour       obj  = (LuaUIBehaviour)ToLua.CheckObject(L, 1, typeof(LuaUIBehaviour));
         UnityEngine.Sprite   arg0 = (UnityEngine.Sprite)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Sprite));
         UnityEngine.UI.Image o    = obj.SetImageSprite(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#14
0
    static int get_panelName(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LuaUIBehaviour obj = (LuaUIBehaviour)o;
            string         ret = obj.panelName;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index panelName on a nil value" : e.Message));
        }
    }
示例#15
0
    void Awake()
    {
        Transform[] childrens = GetComponentsInChildren <Transform>();

        for (int i = 1; i < childrens.Length; i++)
        {
            if (!childrens[i].name.EndsWith("_n"))
            {
                LuaUIBehaviour behav = childrens[i].gameObject.AddComponent <LuaUIBehaviour>();
                behav.panelName = this.name;
            }
        }



        CallMethod(name, "Awake", gameObject);
    }
示例#16
0
    static int set_panelName(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LuaUIBehaviour obj  = (LuaUIBehaviour)o;
            string         arg0 = ToLua.CheckString(L, 2);
            obj.panelName = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index panelName on a nil value" : e.Message));
        }
    }
示例#17
0
    static int AddButtonLisenter(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(LuaUIBehaviour), typeof(LuaInterface.LuaFunction)))
            {
                LuaUIBehaviour obj  = (LuaUIBehaviour)ToLua.ToObject(L, 1);
                LuaFunction    arg0 = ToLua.ToLuaFunction(L, 2);
                obj.AddButtonLisenter(arg0);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(LuaUIBehaviour), typeof(LuaInterface.LuaFunction), typeof(object)))
            {
                LuaUIBehaviour obj  = (LuaUIBehaviour)ToLua.ToObject(L, 1);
                LuaFunction    arg0 = ToLua.ToLuaFunction(L, 2);
                object         arg1 = ToLua.ToVarObject(L, 3);
                obj.AddButtonLisenter(arg0, arg1);
                return(0);
            }
            else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(LuaUIBehaviour), typeof(LuaInterface.LuaFunction), typeof(object), typeof(object)))
            {
                LuaUIBehaviour obj  = (LuaUIBehaviour)ToLua.ToObject(L, 1);
                LuaFunction    arg0 = ToLua.ToLuaFunction(L, 2);
                object         arg1 = ToLua.ToVarObject(L, 3);
                object         arg2 = ToLua.ToVarObject(L, 4);
                obj.AddButtonLisenter(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: LuaUIBehaviour.AddButtonLisenter"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }