/**
         * @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;
            }
        }
Exemplo n.º 2
0
 static int FadeIn(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 11);
         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);
         int    arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
         int    arg3 = (int)LuaDLL.luaL_checknumber(L, 5);
         string arg4 = ToLua.CheckString(L, 6);
         DragonBones.AnimationFadeOutMode arg5 = (DragonBones.AnimationFadeOutMode)ToLua.CheckObject(L, 7, typeof(DragonBones.AnimationFadeOutMode));
         bool arg6 = LuaDLL.luaL_checkboolean(L, 8);
         bool arg7 = LuaDLL.luaL_checkboolean(L, 9);
         bool arg8 = LuaDLL.luaL_checkboolean(L, 10);
         bool arg9 = LuaDLL.luaL_checkboolean(L, 11);
         DragonBones.AnimationState o = obj.FadeIn(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 3
0
    public void Update()
    {
        if (_states.Count < 0)
        {
            return;
        }

        if (_currentState == null)
        {
            if (OriginStateName.Length > 0 && _states.ContainsKey(OriginStateName))
            {
                _currentState = _states[OriginStateName];
                _DBAnimation.FadeIn(OriginStateName);
            }
            else
            {
                Debug.LogError("[DBStateMachine] No origin state!\t----\t" + OriginStateName);
            }
        }

        if (_currentState == null)
        {
            Debug.LogError("[DBStateMachine] Current state is not valid!");
            return;
        }

        var transIter = _currentState.Transitions.GetEnumerator();

        while (transIter.MoveNext())
        {
            var  currTrans = transIter.Current.Value;
            var  condIter  = currTrans.Conditions.GetEnumerator();
            bool isAllPass = true;
            while (condIter.MoveNext())
            {
                var checkParamName = condIter.Current.Key;
                var currCond       = condIter.Current.Value;

                isAllPass = isAllPass && CheckParameterByCondition(checkParamName, currCond);
            }
        }
    }
Exemplo n.º 4
0
    static int FadeIn(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.FadeIn(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.FadeIn(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 4)
            {
                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);
                int    arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
                DragonBones.AnimationState o = obj.FadeIn(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 5)
            {
                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);
                int    arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
                int    arg3 = (int)LuaDLL.luaL_checknumber(L, 5);
                DragonBones.AnimationState o = obj.FadeIn(arg0, arg1, arg2, arg3);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 6)
            {
                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);
                int    arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
                int    arg3 = (int)LuaDLL.luaL_checknumber(L, 5);
                string arg4 = ToLua.CheckString(L, 6);
                DragonBones.AnimationState o = obj.FadeIn(arg0, arg1, arg2, arg3, arg4);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 7)
            {
                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);
                int    arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
                int    arg3 = (int)LuaDLL.luaL_checknumber(L, 5);
                string arg4 = ToLua.CheckString(L, 6);
                DragonBones.AnimationFadeOutMode arg5 = (DragonBones.AnimationFadeOutMode)ToLua.CheckObject(L, 7, typeof(DragonBones.AnimationFadeOutMode));
                DragonBones.AnimationState       o    = obj.FadeIn(arg0, arg1, arg2, arg3, arg4, arg5);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DragonBones.Animation.FadeIn"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }