Exemple #1
0
    public static int GetAnimationDuration(IntPtr l)
    {
        int result;

        try
        {
            int total = LuaDLL.lua_gettop(l);
            if (LuaObject.matchType(l, total, 2, typeof(int)))
            {
                UISpineGraphic uispineGraphic = (UISpineGraphic)LuaObject.checkSelf(l);
                int            trackIndex;
                LuaObject.checkType(l, 2, out trackIndex);
                float animationDuration = uispineGraphic.GetAnimationDuration(trackIndex);
                LuaObject.pushValue(l, true);
                LuaObject.pushValue(l, animationDuration);
                result = 2;
            }
            else if (LuaObject.matchType(l, total, 2, typeof(string)))
            {
                UISpineGraphic uispineGraphic2 = (UISpineGraphic)LuaObject.checkSelf(l);
                string         name;
                LuaObject.checkType(l, 2, out name);
                float animationDuration2 = uispineGraphic2.GetAnimationDuration(name);
                LuaObject.pushValue(l, true);
                LuaObject.pushValue(l, animationDuration2);
                result = 2;
            }
            else
            {
                LuaObject.pushValue(l, false);
                LuaDLL.lua_pushstring(l, "No matched override function GetAnimationDuration to call");
                result = 2;
            }
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }