Пример #1
0
    static int OnComplete(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 2);
            DG.Tweening.Sequence      obj  = (DG.Tweening.Sequence)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Sequence));
            DG.Tweening.TweenCallback arg0 = null;
            LuaTypes funcType2             = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (DG.Tweening.TweenCallback)ToLua.CheckObject(L, 2, typeof(DG.Tweening.TweenCallback));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(DG.Tweening.TweenCallback), func) as DG.Tweening.TweenCallback;
            }

            DG.Tweening.Tween o = obj.OnComplete(arg0);
            ToLua.PushObject(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static int QPYX_OnComplete_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 2);
         DG.Tweening.Sequence      QPYX_obj_YXQP  = (DG.Tweening.Sequence)ToLua.CheckObject(L_YXQP, 1, typeof(DG.Tweening.Sequence));
         DG.Tweening.TweenCallback QPYX_arg0_YXQP = (DG.Tweening.TweenCallback)ToLua.CheckDelegate <DG.Tweening.TweenCallback>(L_YXQP, 2);
         DG.Tweening.Tween         QPYX_o_YXQP    = QPYX_obj_YXQP.OnComplete(QPYX_arg0_YXQP);
         ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Пример #3
0
 static int OnComplete(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DG.Tweening.Sequence      obj  = (DG.Tweening.Sequence)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Sequence));
         DG.Tweening.TweenCallback arg0 = (DG.Tweening.TweenCallback)ToLua.CheckDelegate <DG.Tweening.TweenCallback>(L, 2);
         DG.Tweening.Tween         o    = obj.OnComplete(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #4
0
        static int _m_OnComplete(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            DG.Tweening.Sequence __cl_gen_to_be_invoked = (DG.Tweening.Sequence)translator.FastGetCSObj(L, 1);


            try {
                {
                    DG.Tweening.TweenCallback action = translator.GetDelegate <DG.Tweening.TweenCallback>(L, 2);

                    DG.Tweening.Tween __cl_gen_ret = __cl_gen_to_be_invoked.OnComplete(action);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Пример #5
0
        public override void OnExecute(FlowReactorComponent _flowReactor)
        {
            DG.Tweening.Sequence _seq = DG.Tweening.DOTween.Sequence();

            for (int s = 0; s < tweenSequence.Count; s++)
            {
                switch (tweenSequence[s].tweenObject)
                {
                case Sequence.TweenObject.floatValue:

                    switch (tweenSequence[s].tweenMethodVariables)
                    {
                    case Sequence.TweenMethodVariables.DOValue:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            var _float  = tweenSequence[s].floatValue.Value;
                            var _target = tweenSequence[s].targetFloat.Value;
                            var _index  = s;
                            _seq.Append(DG.Tweening.DOTween.To(x => _float = x, _float, _target, tweenSequence[s].duration)).OnUpdate(() => UpdateFloat(_index, _float));
                        }
                        else
                        {
                            var _float  = tweenSequence[s].floatValue.Value;
                            var _target = tweenSequence[s].targetFloat.Value;
                            var _index  = s;
                            _seq.Insert(tweenSequence[s].insertTime, DG.Tweening.DOTween.To(() => _float, x => _float = x, _target, tweenSequence[s].duration)).OnUpdate(() => UpdateFloat(_index, _float));
                        }
                        break;
                    }

                    break;

                case Sequence.TweenObject.intValue:

                    switch (tweenSequence[s].tweenMethodVariables)
                    {
                    case Sequence.TweenMethodVariables.DOValue:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            var _int    = tweenSequence[s].intValue.Value;
                            var _target = tweenSequence[s].targetInt.Value;
                            var _index  = s;
                            _seq.Append(DG.Tweening.DOTween.To(() => _int, x => _int = x, _target, tweenSequence[s].duration)).OnUpdate(() => UpdateInt(_index, _int));
                        }
                        else
                        {
                            var _int    = tweenSequence[s].intValue.Value;
                            var _target = tweenSequence[s].targetInt.Value;
                            var _index  = s;
                            _seq.Insert(tweenSequence[s].insertTime, DG.Tweening.DOTween.To(() => _int, x => _int = x, _target, tweenSequence[s].duration)).OnUpdate(() => UpdateInt(_index, _int));
                        }
                        break;
                    }

                    break;

                case Sequence.TweenObject.gameObject:

                    switch (tweenSequence[s].tweenMethodTransform)
                    {
                    case Sequence.TweenMethodTransform.DOLocalMove:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOLocalMove(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOLocalMove(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOLocalMoveX:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOLocalMoveX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOLocalMoveX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOLocalMoveY:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOLocalMoveY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOLocalMoveY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOLocalMoveZ:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOLocalMoveZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOLocalMoveZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOMove:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOMove(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOMove(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOMoveX:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOMoveX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOMoveX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOMoveY:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOMoveY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOMoveY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOMoveZ:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOMoveZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOMoveZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOScale:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOScale(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOScale(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOScaleX:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOScaleX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOScaleX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOScaleY:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOScaleY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOScaleY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOScaleZ:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOScaleZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOScaleZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOLocalRotate:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DOLocalRotate(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DOLocalRotate(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DORotate:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].gameObject.Value.transform.DORotate(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].gameObject.Value.transform.DORotate(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        break;
                    }

                    break;

                case Sequence.TweenObject.image:

                    switch (tweenSequence[s].tweenMethodImage)
                    {
                    case Sequence.TweenMethodImage.DOColor:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].image.Value.DOColor(tweenSequence[s].targetColor.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].image.Value.DOColor(tweenSequence[s].targetColor.Value, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodImage.DOFill:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].image.Value.DOFillAmount(tweenSequence[s].targetFloat.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].image.Value.DOFillAmount(tweenSequence[s].targetFloat.Value, tweenSequence[s].duration));
                        }
                        break;
                    }

                    break;

                case Sequence.TweenObject.rectTransform:

                    switch (tweenSequence[s].tweenMethodTransform)
                    {
                    case Sequence.TweenMethodTransform.DOAnchoredPosition:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOAnchorPos(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOAnchorPos(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }

                        break;

                    case Sequence.TweenMethodTransform.DOLocalMove:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOLocalMove(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOLocalMove(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOLocalMoveX:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOLocalMoveX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOLocalMoveX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOLocalMoveY:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOLocalMoveY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOLocalMoveY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOLocalMoveZ:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOLocalMoveZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOLocalMoveZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOMove:

                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOMove(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOMove(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }

                        break;

                    case Sequence.TweenMethodTransform.DOMoveX:

                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOMoveX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOMoveX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOMoveY:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOMoveY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOMoveY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOMoveZ:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOMoveZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOMoveZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOScale:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOScale(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOScale(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOScaleX:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOScaleX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOScaleX(tweenSequence[s].target.Value.x, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOScaleY:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOScaleY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOScaleY(tweenSequence[s].target.Value.y, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOScaleZ:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOScaleZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOScaleZ(tweenSequence[s].target.Value.z, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOLocalRotate:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOLocalRotate(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOLocalRotate(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DORotate:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DORotate(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DORotate(tweenSequence[s].target.Value, tweenSequence[s].duration));
                        }
                        break;

                    case Sequence.TweenMethodTransform.DOSizeDelta:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].rectTransform.Value.DOSizeDelta(tweenSequence[s].targetVector2.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].rectTransform.Value.DOSizeDelta(tweenSequence[s].targetVector2.Value, tweenSequence[s].duration));
                        }
                        break;
                    }

                    break;

                case Sequence.TweenObject.canvasGroup:

                    switch (tweenSequence[s].tweenMethodCanvas)
                    {
                    case Sequence.TweenMethodCanvas.DOFade:
                        if (tweenSequence[s].tweenState == Sequence.TweenState.append)
                        {
                            _seq.Append(tweenSequence[s].canvasGroup.Value.DOFade(tweenSequence[s].targetFloat.Value, tweenSequence[s].duration));
                        }
                        else
                        {
                            _seq.Insert(tweenSequence[s].insertTime, tweenSequence[s].canvasGroup.Value.DOFade(tweenSequence[s].targetFloat.Value, tweenSequence[s].duration));
                        }
                        break;
                    }

                    break;
                }

                _seq.SetEase(tweenSequence[s].easeType);
            }

            _seq.OnComplete(() => OnComplete());
            _seq.SetId(tweenID);
            _seq.Play();

            ExecuteNext(0, _flowReactor);
        }
Пример #6
0
        protected override void OnBegin()
        {
            mSequence = mTweenFactory.Invoke();

            mSequence.OnComplete(Finish);
        }