예제 #1
0
        static int _m_Insert(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    float             atPosition = (float)LuaAPI.lua_tonumber(L, 2);
                    DG.Tweening.Tween t          = (DG.Tweening.Tween)translator.GetObject(L, 3, typeof(DG.Tweening.Tween));

                    DG.Tweening.Sequence __cl_gen_ret = __cl_gen_to_be_invoked.Insert(atPosition, t);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
예제 #2
0
    static int Insert(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        DG.Tweening.Sequence obj = (DG.Tweening.Sequence)LuaScriptMgr.GetNetObjectSelf(L, 1, "DG.Tweening.Sequence");
        float arg0 = (float)LuaScriptMgr.GetNumber(L, 2);

        DG.Tweening.Tween    arg1 = (DG.Tweening.Tween)LuaScriptMgr.GetNetObject(L, 3, typeof(DG.Tweening.Tween));
        DG.Tweening.Sequence o    = obj.Insert(arg0, arg1);
        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
        private void AnimateGuardian()
        {
            animatedGuardian.SetActive(true);
            guardianSequence = DOTween.Sequence();
            guardianSequence.Append(animatedGuardian.transform.DOMove(finalGuardian.position, guardianAnimationDuration).SetEase(guardianAnimationEase));

            for (int i = 0; i < extraGuardians.Length; i++)
            {
                guardianSequence.Insert(extraAnimationsStartSecond, extraGuardians[i].
                    DOMoveY(finalGuardian.position.y, guardianAnimationDuration - extraAnimationsStartSecond).
                    SetEase(extraGuardiansEase));
            }

            guardianSequence.AppendCallback(OnGuardianAnimationComplete);
        }
 static int QPYX_Insert_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 3);
         DG.Tweening.Sequence QPYX_obj_YXQP  = (DG.Tweening.Sequence)ToLua.CheckObject(L_YXQP, 1, typeof(DG.Tweening.Sequence));
         float                QPYX_arg0_YXQP = (float)LuaDLL.luaL_checknumber(L_YXQP, 2);
         DG.Tweening.Tween    QPYX_arg1_YXQP = (DG.Tweening.Tween)ToLua.CheckObject <DG.Tweening.Tween>(L_YXQP, 3);
         DG.Tweening.Sequence QPYX_o_YXQP    = QPYX_obj_YXQP.Insert(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
         ToLua.PushSealed(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
예제 #5
0
 static int Insert(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         DG.Tweening.Sequence obj  = (DG.Tweening.Sequence)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Sequence));
         float                arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         DG.Tweening.Tween    arg1 = (DG.Tweening.Tween)ToLua.CheckObject <DG.Tweening.Tween>(L, 3);
         DG.Tweening.Sequence o    = obj.Insert(arg0, arg1);
         ToLua.PushSealed(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
        private void InitLevelsAlarms()
        {
            var shieldFrequency = 0.3f;
            shieldGaugeBackgroundImageOriginalColor = shieldGaugeBackgroundImage.color.Copy();
            shieldAlarmSequence = DOTween.Sequence();
            shieldAlarmSequence.Append(shieldGaugeBackgroundImage.DOColor(new Color(1f, 0, 0, 1f), shieldFrequency));
            shieldAlarmSequence.Append(shieldGaugeBackgroundImage.DOColor(shieldGaugeBackgroundImageOriginalColor, shieldFrequency));
            shieldAlarmSequence.SetLoops(-1);
            shieldAlarmSequence.Pause();

            var hullFrequency = 0.1f;
            hullGaugeBackgroundImageOriginalColor = hullGaugeBackgroundImage.color.Copy();
            hullAlarmSequence = DOTween.Sequence();
            hullAlarmSequence.Append(hullGaugeBackgroundImage.DOColor(new Color(1f, 0, 0, 1f), hullFrequency));
            hullAlarmSequence.Append(hullGaugeBackgroundImage.DOColor(hullGaugeBackgroundImageOriginalColor, hullFrequency));
            hullAlarmSequence.Insert(0, alarmLight.DOIntensity(alarmLightHighIntensity, hullFrequency));
            hullAlarmSequence.Insert(hullFrequency, alarmLight.DOIntensity(alarmLightLowIntensity, hullFrequency));
            hullAlarmSequence.SetLoops(-1);
            hullAlarmSequence.Pause();
        }
예제 #7
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);
        }
예제 #8
0
        void Start()
        {
            _initialized = true;

            _isRadioButton = _toggleGroupid != "";

            List<IHOtk2dBase> childrenSprites = null;
            bool hasChildrenToTween = false;
            bool hasTextMeshesToTween = false;
            if (_tweenChildren && _tweenColorOn != ButtonActionType.None) {
                Component[] children = gameObject.GetComponentsInChildren(typeof(IHOtk2dBase));
                childrenSprites = new List<IHOtk2dBase>();
                foreach (Component child in children) {
                    if (child == sprite) continue;
                    childrenSprites.Add(child as IHOtk2dBase);
                    IHOtk2dTextMesh txtMesh = child as IHOtk2dTextMesh;
                    if (txtMesh != null) _txtMeshesToUpdate.Add(txtMesh);
                }
                hasChildrenToTween = childrenSprites.Count > 0;
                hasTextMeshesToTween = _txtMeshesToUpdate.Count > 0;
            }

            // Hide eventual tooltip
            if (_tooltip != null) {
                _tooltip.SetActive(false);
                _showTooltip = true;
            }

            // Create tweens
            if (hasRollover) {
                _rolloutTween = DOTween.Sequence().SetUpdate(true).SetAutoKill(false)
                    .OnKill(() =>_rolloutTween = null)
                    .Pause();
                if (hasTextMeshesToTween) _rolloutTween.OnUpdate(UpdateTextMeshes);
                if (_tweenScaleOn == ButtonActionType.OnRollover)
                    _rolloutTween.Insert(0, trans.DOScale(trans.localScale * _tweenScaleMultiplier, _TweenDuration).From());
                if (_tweenColorOn == ButtonActionType.OnRollover) {
                    _rolloutTween.Insert(0, DOTween.To(() => sprite.color, x => sprite.color = x, _tweenColor, _TweenDuration).From());
                    if (hasChildrenToTween) {
                        foreach (IHOtk2dBase childSprite in childrenSprites) {
                            IHOtk2dBase s = childSprite;
                            _rolloutTween.Insert(0, DOTween.To(() => s.color, x => s.color = x, _tweenColor, _TweenDuration).From());
                        }
                    }
                }
                _rolloutTween.Complete();
            }
            if (_tweenColorOn == ButtonActionType.OnPress || _tweenScaleOn == ButtonActionType.OnPress) {
                _unpressTween = DOTween.Sequence().SetUpdate(true).SetAutoKill(false)
                    .OnKill(() => _unpressTween = null)
                    .Pause();
                if (hasTextMeshesToTween) _unpressTween.OnUpdate(UpdateTextMeshes);
                if (_tweenScaleOn == ButtonActionType.OnPress)
                    _unpressTween.Insert(0, trans.DOScale(trans.localScale * _tweenScaleMultiplier, _TweenDuration).From());
                if (_tweenColorOn == ButtonActionType.OnPress) {
                    _unpressTween.Insert(0, DOTween.To(() => sprite.color, x => sprite.color = x, _tweenColor, _TweenDuration).From());
                    if (hasChildrenToTween) {
                        foreach (IHOtk2dBase childSprite in childrenSprites) {
                            IHOtk2dBase s = childSprite;
                            _rolloutTween.Insert(0, DOTween.To(() => s.color, x => s.color = x, _tweenColor, _TweenDuration).From());
                        }
                    }
                }
                _unpressTween.Complete();
            }
            if (_tweenColorOn == ButtonActionType.OnClick || _tweenScaleOn == ButtonActionType.OnClick) {
                _unclickTween = DOTween.Sequence().SetUpdate(true).SetAutoKill(false)
                    .OnKill(() => _unclickTween = null)
                    .Pause();
                if (hasTextMeshesToTween) _unclickTween.OnUpdate(UpdateTextMeshes);
                if (_tweenScaleOn == ButtonActionType.OnClick)
                    _unclickTween.Insert(0.15f, trans.DOScale(trans.localScale * _tweenScaleMultiplier, _TweenDuration).From());
                if (_tweenColorOn == ButtonActionType.OnClick) {
                    _unclickTween.Insert(0.15f, DOTween.To(() => sprite.color, x => sprite.color = x, _tweenColor, _TweenDuration).From());
                    if (hasChildrenToTween) {
                        foreach (IHOtk2dBase childSprite in childrenSprites) {
                            IHOtk2dBase s = childSprite;
                            _rolloutTween.Insert(0, DOTween.To(() => s.color, x => s.color = x, _tweenColor, _TweenDuration).From());
                        }
                    }
                }
                _unclickTween.Complete();
            }

            // Execute eventual cued actions
            if (_preinitActionsQueue != null) {
                foreach (PreinitActionType visualActionType in _preinitActionsQueue) {
                    switch (visualActionType) {
                    case PreinitActionType.ToggleOn:
                        ToggleOn();
                        break;
                    case PreinitActionType.ToggleOnWithoutEventDispatching:
                        ToggleOn(false);
                        break;
                    case PreinitActionType.ToggleOff:
                        ToggleOff();
                        break;
                    case PreinitActionType.ToggleOffWithoutEventDispatching:
                        ToggleOff(false);
                        break;
                    }
                }
            }
        }