Exemplo n.º 1
0
    static int SetLoops(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                DG.Tweening.Sequence obj = (DG.Tweening.Sequence)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Sequence));
                int arg0            = (int)LuaDLL.luaL_checknumber(L, 2);
                DG.Tweening.Tween o = obj.SetLoops(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3)
            {
                DG.Tweening.Sequence obj = (DG.Tweening.Sequence)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Sequence));
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                DG.Tweening.LoopType arg1 = (DG.Tweening.LoopType)ToLua.CheckObject(L, 3, typeof(DG.Tweening.LoopType));
                DG.Tweening.Tween    o    = obj.SetLoops(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DG.Tweening.Sequence.SetLoops"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static int QPYX_SetLoops_YXQP(IntPtr L_YXQP)
 {
     try
     {
         int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
         if (QPYX_count_YXQP == 2)
         {
             DG.Tweening.Sequence QPYX_obj_YXQP = (DG.Tweening.Sequence)ToLua.CheckObject(L_YXQP, 1, typeof(DG.Tweening.Sequence));
             int QPYX_arg0_YXQP            = (int)LuaDLL.luaL_checknumber(L_YXQP, 2);
             DG.Tweening.Tween QPYX_o_YXQP = QPYX_obj_YXQP.SetLoops(QPYX_arg0_YXQP);
             ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
             return(1);
         }
         else if (QPYX_count_YXQP == 3)
         {
             DG.Tweening.Sequence QPYX_obj_YXQP = (DG.Tweening.Sequence)ToLua.CheckObject(L_YXQP, 1, typeof(DG.Tweening.Sequence));
             int QPYX_arg0_YXQP = (int)LuaDLL.luaL_checknumber(L_YXQP, 2);
             DG.Tweening.LoopType QPYX_arg1_YXQP = (DG.Tweening.LoopType)ToLua.CheckObject(L_YXQP, 3, typeof(DG.Tweening.LoopType));
             DG.Tweening.Tween    QPYX_o_YXQP    = QPYX_obj_YXQP.SetLoops(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
             ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
             return(1);
         }
         else
         {
             return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to method: DG.Tweening.Sequence.SetLoops"));
         }
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Exemplo n.º 3
0
        static int _m_SetLoops(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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


                int __gen_param_count = LuaAPI.lua_gettop(L);

                if (__gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int loops = LuaAPI.xlua_tointeger(L, 2);

                    DG.Tweening.Tween __cl_gen_ret = __cl_gen_to_be_invoked.SetLoops(loops);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
                if (__gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <DG.Tweening.LoopType>(L, 3))
                {
                    int loops = LuaAPI.xlua_tointeger(L, 2);
                    DG.Tweening.LoopType loopType; translator.Get(L, 3, out loopType);

                    DG.Tweening.Tween __cl_gen_ret = __cl_gen_to_be_invoked.SetLoops(loops, loopType);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to DG.Tweening.Sequence.SetLoops!"));
        }
Exemplo n.º 4
0
        IEnumerator Start()
        {
            // Start after one second delay (to ignore Unity hiccups when activating Play mode in Editor)
            yield return new WaitForSeconds(1);

            // Create a new Sequence.
            // We will set it so that the whole duration is 6
            Sequence s = DOTween.Sequence();
            // Add an horizontal relative move tween that will last the whole Sequence's duration
            s.Append(cube.DOMoveX(6, duration).SetRelative().SetEase(Ease.InOutQuad));
            // Insert a rotation tween which will last half the duration
            // and will loop forward and backward twice
            s.Insert(0, cube.DORotate(new Vector3(0, 45, 0), duration / 2).SetEase(Ease.InQuad).SetLoops(2, LoopType.Yoyo));
            // Add a color tween that will start at half the duration and last until the end
            s.Insert(duration / 2, cube.GetComponent<Renderer>().material.DOColor(Color.yellow, duration / 2));
            // Set the whole Sequence to loop infinitely forward and backwards
            s.SetLoops(-1, LoopType.Yoyo);
        }
Exemplo n.º 5
0
        /// <summary>
        /// [BUTTON]这个动画放在UI上可以根据改Pivot来改变振动效果 (即改变旋转位置) 建议-1
        /// </summary>
        /// <param name="_RT"></param>
        /// <param name="_Loops"></param>
        /// <param name="_Strength"></param>
        /// <returns></returns>
        public static Sequence Ani_LoopJump_Shake(this RectTransform _RT, int _Loops = -1, float _Strength = 1)
        {
            float _BasePositionY = _RT.localPosition.y;
            float _Hight         = Screen.height * 0.03F + _BasePositionY;
            float _Width         = Screen.width * 0.1F;

            int _Angle = 8;

            Sequence sequence = DOTween.Sequence();

            sequence.

            //step1 risea
            Append(_RT.DOLocalMoveY(_Hight, 0.1F).SetEase(Ease.Linear))
            .Join(_RT.DOLocalRotate(Vector3.forward * -_Angle, 0.1F).SetEase(Ease.Linear))
            //step2 shakeansform.DOLocalRotate(Vector3.forward * _Angle, 0.1F).SetEase(Ease.Linear))

            .Append(_RT.DOLocalRotate(Vector3.forward * _Angle, 0.1F).SetEase(Ease.Linear))
            .Append(_RT.DOLocalRotate(Vector3.forward * -_Angle, 0.1F).SetEase(Ease.Linear))
            .Append(_RT.DOLocalRotate(Vector3.forward * _Angle, 0.1F).SetEase(Ease.Linear))
            .Append(_RT.DOLocalRotate(Vector3.forward * -_Angle, 0.1F).SetEase(Ease.Linear))
            .Append(_RT.DOLocalRotate(Vector3.forward * _Angle, 0.1F).SetEase(Ease.Linear))
            .Append(_RT.DOLocalRotate(Vector3.forward * -_Angle, 0.1F).SetEase(Ease.Linear))

            .Append(_RT.DOLocalRotate(Vector3.zero, 0.1F).SetEase(Ease.Linear))

            .Append(_RT.DOLocalMoveY(_BasePositionY, 0.2F).SetEase(Ease.Linear))
            .AppendInterval(0.7F)
            ;

            sequence.onComplete += () =>
            {
                _RT.localScale = Vector3.one;
            };
            sequence.SetLoops(_Loops);
            return(sequence);
        }
        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();
        }