Exemplo n.º 1
0
        public static void OnPointerDown(this Transform btn, object param, Action <object> pointerDownEvent)
        {
            BButton bButton = btn.GetComponent <BButton>();

            if (!bButton)
            {
                bButton = btn.gameObject.AddComponent <BButton>();
            }
            bButton.param         = param;
            bButton.onPointerDown = pointerDownEvent;
        }
Exemplo n.º 2
0
        public static void OnClick(this Transform btn, object param, Action <object> clickEvent)
        {
            BButton bButton = btn.GetComponent <BButton>();

            if (!bButton)
            {
                bButton = btn.gameObject.AddComponent <BButton>();
            }
            bButton.param   = param;
            bButton.onClick = clickEvent;
        }
Exemplo n.º 3
0
 static int OnPointerClick(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         ToLuaUIFramework.BButton obj = (ToLuaUIFramework.BButton)ToLua.CheckObject <ToLuaUIFramework.BButton>(L, 1);
         UnityEngine.EventSystems.PointerEventData arg0 = (UnityEngine.EventSystems.PointerEventData)ToLua.CheckObject <UnityEngine.EventSystems.PointerEventData>(L, 2);
         obj.OnPointerClick(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 4
0
    static int get_canTriggerInterval(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ToLuaUIFramework.BButton obj = (ToLuaUIFramework.BButton)o;
            float ret = obj.canTriggerInterval;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index canTriggerInterval on a nil value"));
        }
    }
Exemplo n.º 5
0
    static int get_param(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ToLuaUIFramework.BButton obj = (ToLuaUIFramework.BButton)o;
            object ret = obj.param;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index param on a nil value"));
        }
    }
Exemplo n.º 6
0
    static int set_onPointerDown(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ToLuaUIFramework.BButton obj  = (ToLuaUIFramework.BButton)o;
            System.Action <object>   arg0 = (System.Action <object>)ToLua.CheckDelegate <System.Action <object> >(L, 2);
            obj.onPointerDown = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onPointerDown on a nil value"));
        }
    }
Exemplo n.º 7
0
    static int set_canTriggerInterval(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ToLuaUIFramework.BButton obj = (ToLuaUIFramework.BButton)o;
            float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.canTriggerInterval = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index canTriggerInterval on a nil value"));
        }
    }
Exemplo n.º 8
0
    static int set_param(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ToLuaUIFramework.BButton obj = (ToLuaUIFramework.BButton)o;
            object arg0 = ToLua.ToVarObject(L, 2);
            obj.param = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index param on a nil value"));
        }
    }
Exemplo n.º 9
0
    static int get_rectTransform(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ToLuaUIFramework.BButton  obj = (ToLuaUIFramework.BButton)o;
            UnityEngine.RectTransform ret = obj.rectTransform;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index rectTransform on a nil value"));
        }
    }
Exemplo n.º 10
0
    static int get_onPointerDown(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ToLuaUIFramework.BButton obj = (ToLuaUIFramework.BButton)o;
            System.Action <object>   ret = obj.onPointerDown;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onPointerDown on a nil value"));
        }
    }
Exemplo n.º 11
0
 void Awake()
 {
     if (!targetImg)
     {
         targetImg = GetComponent <Image>();
     }
     if (!targetRawImg)
     {
         targetRawImg = GetComponent <RawImage>();
     }
     if (targetImg)
     {
         spriteDefault = targetImg.sprite;
         colorDefault  = targetImg.color;
     }
     if (targetRawImg)
     {
         textureDefault = targetRawImg.texture;
         colorDefault   = targetRawImg.color;
     }
     button = GetComponent <BButton>();
 }