Esempio n. 1
0
    static int set_OnClickListen(IntPtr L)
    {
        object      o   = LuaScriptMgr.GetLuaObject(L, 1);
        ScaleButton obj = (ScaleButton)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

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

        LuaTypes funcType = LuaDLL.lua_type(L, 3);

        if (funcType != LuaTypes.LUA_TFUNCTION)
        {
            obj.OnClickListen = (DefAction)LuaScriptMgr.GetNetObject(L, 3, typeof(DefAction));
        }
        else
        {
            LuaFunction func = LuaScriptMgr.ToLuaFunction(L, 3);
            obj.OnClickListen = () =>
            {
                func.Call();
            };
        }
        return(0);
    }
Esempio n. 2
0
    static int OnClick(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        ScaleButton obj = (ScaleButton)LuaScriptMgr.GetUnityObjectSelf(L, 1, "ScaleButton");

        obj.OnClick();
        return(0);
    }
Esempio n. 3
0
    static int OnHold(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        ScaleButton obj  = (ScaleButton)LuaScriptMgr.GetUnityObjectSelf(L, 1, "ScaleButton");
        bool        arg0 = LuaScriptMgr.GetBoolean(L, 2);

        obj.OnHold(arg0);
        return(0);
    }
Esempio n. 4
0
 public void SetControlGO()
 {
     ctrlGO   = UITools.D("skill." + this.skillInfo.Pos);
     cdSprite = ctrlGO.GetChild("s_fore").GetComponent <UISprite>();
     if (ctrlGO is ScaleButton)
     {
         ScaleButton sb = ctrlGO as ScaleButton;
         sb.OnClickListen = OnClickSkill;
     }
 }
Esempio n. 5
0
    static int set_scaleFactor(IntPtr L)
    {
        object      o   = LuaScriptMgr.GetLuaObject(L, 1);
        ScaleButton obj = (ScaleButton)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

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

        obj.scaleFactor = (float)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }
Esempio n. 6
0
    static int get_OnClickListen(IntPtr L)
    {
        object      o   = LuaScriptMgr.GetLuaObject(L, 1);
        ScaleButton obj = (ScaleButton)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

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

        LuaScriptMgr.Push(L, obj.OnClickListen);
        return(1);
    }
Esempio n. 7
0
    private void CollisionEnded(object sender, PointerEventArgs e)
    {
        if (e.target.GetComponent <Point>() != null)
        {
            inPointCollision = false;
        }

        else if (e.target.GetComponent <ScaleButton>() != null)
        {
            scaleButton = null;
        }

        else if (e.target.GetComponent <AxisButton>() != null)
        {
            axisButton = null;
        }

        else if (e.target.GetComponent <InvertAxisButton>() != null)
        {
            invertAxisButton = null;
        }
    }
Esempio n. 8
0
    private void Collision(object sender, PointerEventArgs e)
    {
        if (e.target.GetComponent <Point>() != null)
        {
            inPointCollision = true;
            selectedPoint    = e.target.GetComponent <Point>();
        }

        else if (e.target.GetComponent <ScaleButton>() != null)
        {
            scaleButton = e.target.GetComponent <ScaleButton>();
        }

        else if (e.target.GetComponent <AxisButton>() != null)
        {
            axisButton = e.target.GetComponent <AxisButton>();
        }

        else if (e.target.GetComponent <InvertAxisButton>() != null)
        {
            invertAxisButton = e.target.GetComponent <InvertAxisButton>();
        }
    }
Esempio n. 9
0
 public ScaleManipulator(Editor e)
     : base(e)
 {
     scaleButton = new ScaleButton(this);
 }