/**
         * @private
         */
        protected void _doAction(ActionData value)
        {
            switch (value.type)
            {
            case ActionType.Play:
                _animation.Play((string)value.data[0], (int)value.data[1]);
                break;

            case ActionType.Stop:
                _animation.Stop((string)value.data[0]);
                break;

            case ActionType.GotoAndPlay:
                _animation.GotoAndPlayByTime((string)value.data[0], (float)value.data[1], (int)value.data[2]);
                break;

            case ActionType.GotoAndStop:
                _animation.GotoAndStopByTime((string)value.data[0], (float)value.data[1]);
                break;

            case ActionType.FadeIn:
                _animation.FadeIn((string)value.data[0], (float)value.data[1], (int)value.data[2]);
                break;

            case ActionType.FadeOut:
                // TODO fade out
                break;

            default:
                break;
            }
        }
예제 #2
0
    static int GotoAndStopByTime(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                DragonBones.AnimationState o = obj.GotoAndStopByTime(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                DragonBones.AnimationState o = obj.GotoAndStopByTime(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DragonBones.Animation.GotoAndStopByTime"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #3
0
 static int GotoAndStopByTime(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject(L, 1, typeof(DragonBones.Animation));
         string arg0 = ToLua.CheckString(L, 2);
         float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
         DragonBones.AnimationState o = obj.GotoAndStopByTime(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }