static bool TweenParams_SetEase__Ease__NullableT1_Single__NullableT1_Single(JSVCall vc, int argc) { int len = argc; if (len == 1) { DG.Tweening.Ease arg0 = (DG.Tweening.Ease)JSApi.getEnum((int)JSApi.GetType.Arg); JSMgr.datax.setObject((int)JSApi.SetType.Rval, ((DG.Tweening.TweenParams)vc.csObj).SetEase(arg0)); } else if (len == 2) { DG.Tweening.Ease arg0 = (DG.Tweening.Ease)JSApi.getEnum((int)JSApi.GetType.Arg); Nullable <System.Single> arg1 = (Nullable <System.Single>)JSMgr.datax.getObject((int)JSApi.GetType.Arg); JSMgr.datax.setObject((int)JSApi.SetType.Rval, ((DG.Tweening.TweenParams)vc.csObj).SetEase(arg0, arg1)); } else if (len == 3) { DG.Tweening.Ease arg0 = (DG.Tweening.Ease)JSApi.getEnum((int)JSApi.GetType.Arg); Nullable <System.Single> arg1 = (Nullable <System.Single>)JSMgr.datax.getObject((int)JSApi.GetType.Arg); Nullable <System.Single> arg2 = (Nullable <System.Single>)JSMgr.datax.getObject((int)JSApi.GetType.Arg); JSMgr.datax.setObject((int)JSApi.SetType.Rval, ((DG.Tweening.TweenParams)vc.csObj).SetEase(arg0, arg1, arg2)); } return(true); }
public TweenParams(DG.Tweening.Ease ease, float amplitude, float period) { this.mode = Mode.Ease; this.ease = ease; this.amplitude = amplitude; this.period = period; }
static int SetEase(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes <DG.Tweening.Tween, DG.Tweening.EaseFunction>(L, 1)) { DG.Tweening.Tweener obj = (DG.Tweening.Tweener)ToLua.ToObject(L, 1); DG.Tweening.EaseFunction arg0 = (DG.Tweening.EaseFunction)ToLua.ToObject(L, 2); DG.Tweening.Tween o = obj.SetEase(arg0); ToLua.PushObject(L, o); return(1); } else if (count == 2 && TypeChecker.CheckTypes <DG.Tweening.Tween, UnityEngine.AnimationCurve>(L, 1)) { DG.Tweening.Tweener obj = (DG.Tweening.Tweener)ToLua.ToObject(L, 1); UnityEngine.AnimationCurve arg0 = (UnityEngine.AnimationCurve)ToLua.ToObject(L, 2); DG.Tweening.Tween o = obj.SetEase(arg0); ToLua.PushObject(L, o); return(1); } else if (count == 2 && TypeChecker.CheckTypes <DG.Tweening.Tween, DG.Tweening.Ease>(L, 1)) { DG.Tweening.Tweener obj = (DG.Tweening.Tweener)ToLua.ToObject(L, 1); DG.Tweening.Ease arg0 = (DG.Tweening.Ease)ToLua.ToObject(L, 2); DG.Tweening.Tween o = obj.SetEase(arg0); ToLua.PushObject(L, o); return(1); } else if (count == 3) { DG.Tweening.Tweener obj = (DG.Tweening.Tweener)ToLua.CheckObject <DG.Tweening.Tweener>(L, 1); DG.Tweening.Ease arg0 = (DG.Tweening.Ease)ToLua.CheckObject(L, 2, typeof(DG.Tweening.Ease)); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); DG.Tweening.Tween o = obj.SetEase(arg0, arg1); ToLua.PushObject(L, o); return(1); } else if (count == 4) { DG.Tweening.Tweener obj = (DG.Tweening.Tweener)ToLua.CheckObject <DG.Tweening.Tweener>(L, 1); DG.Tweening.Ease arg0 = (DG.Tweening.Ease)ToLua.CheckObject(L, 2, typeof(DG.Tweening.Ease)); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); float arg2 = (float)LuaDLL.luaL_checknumber(L, 4); DG.Tweening.Tween o = obj.SetEase(arg0, arg1, arg2); ToLua.PushObject(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: DG.Tweening.Tweener.SetEase")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int EasedValue(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 4 && TypeChecker.CheckTypes <UnityEngine.AnimationCurve>(L, 4)) { float arg0 = (float)LuaDLL.luaL_checknumber(L, 1); float arg1 = (float)LuaDLL.luaL_checknumber(L, 2); float arg2 = (float)LuaDLL.luaL_checknumber(L, 3); UnityEngine.AnimationCurve arg3 = (UnityEngine.AnimationCurve)ToLua.ToObject(L, 4); float o = DG.Tweening.DOVirtual.EasedValue(arg0, arg1, arg2, arg3); LuaDLL.lua_pushnumber(L, o); return(1); } else if (count == 4 && TypeChecker.CheckTypes <DG.Tweening.Ease>(L, 4)) { float arg0 = (float)LuaDLL.luaL_checknumber(L, 1); float arg1 = (float)LuaDLL.luaL_checknumber(L, 2); float arg2 = (float)LuaDLL.luaL_checknumber(L, 3); DG.Tweening.Ease arg3 = (DG.Tweening.Ease)ToLua.ToObject(L, 4); float o = DG.Tweening.DOVirtual.EasedValue(arg0, arg1, arg2, arg3); LuaDLL.lua_pushnumber(L, o); return(1); } else if (count == 5) { float arg0 = (float)LuaDLL.luaL_checknumber(L, 1); float arg1 = (float)LuaDLL.luaL_checknumber(L, 2); float arg2 = (float)LuaDLL.luaL_checknumber(L, 3); DG.Tweening.Ease arg3 = (DG.Tweening.Ease)ToLua.CheckObject(L, 4, typeof(DG.Tweening.Ease)); float arg4 = (float)LuaDLL.luaL_checknumber(L, 5); float o = DG.Tweening.DOVirtual.EasedValue(arg0, arg1, arg2, arg3, arg4); LuaDLL.lua_pushnumber(L, o); return(1); } else if (count == 6) { float arg0 = (float)LuaDLL.luaL_checknumber(L, 1); float arg1 = (float)LuaDLL.luaL_checknumber(L, 2); float arg2 = (float)LuaDLL.luaL_checknumber(L, 3); DG.Tweening.Ease arg3 = (DG.Tweening.Ease)ToLua.CheckObject(L, 4, typeof(DG.Tweening.Ease)); float arg4 = (float)LuaDLL.luaL_checknumber(L, 5); float arg5 = (float)LuaDLL.luaL_checknumber(L, 6); float o = DG.Tweening.DOVirtual.EasedValue(arg0, arg1, arg2, arg3, arg4, arg5); LuaDLL.lua_pushnumber(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: DG.Tweening.DOVirtual.EasedValue")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int QPYX_SetEase_YXQP(IntPtr L_YXQP) { try { int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP); if (QPYX_count_YXQP == 2 && TypeChecker.CheckTypes <DG.Tweening.Tween, DG.Tweening.Ease>(L_YXQP, 1)) { DG.Tweening.Tweener QPYX_obj_YXQP = (DG.Tweening.Tweener)ToLua.ToObject(L_YXQP, 1); DG.Tweening.Ease QPYX_arg0_YXQP = (DG.Tweening.Ease)ToLua.ToObject(L_YXQP, 2); DG.Tweening.Tween QPYX_o_YXQP = QPYX_obj_YXQP.SetEase(QPYX_arg0_YXQP); ToLua.PushObject(L_YXQP, QPYX_o_YXQP); return(1); } else if (QPYX_count_YXQP == 2 && TypeChecker.CheckTypes <DG.Tweening.Tween, UnityEngine.AnimationCurve>(L_YXQP, 1)) { DG.Tweening.Tweener QPYX_obj_YXQP = (DG.Tweening.Tweener)ToLua.ToObject(L_YXQP, 1); UnityEngine.AnimationCurve QPYX_arg0_YXQP = (UnityEngine.AnimationCurve)ToLua.ToObject(L_YXQP, 2); DG.Tweening.Tween QPYX_o_YXQP = QPYX_obj_YXQP.SetEase(QPYX_arg0_YXQP); ToLua.PushObject(L_YXQP, QPYX_o_YXQP); return(1); } else if (QPYX_count_YXQP == 2 && TypeChecker.CheckTypes <DG.Tweening.Tween, DG.Tweening.EaseFunction>(L_YXQP, 1)) { DG.Tweening.Tweener QPYX_obj_YXQP = (DG.Tweening.Tweener)ToLua.ToObject(L_YXQP, 1); DG.Tweening.EaseFunction QPYX_arg0_YXQP = (DG.Tweening.EaseFunction)ToLua.ToObject(L_YXQP, 2); DG.Tweening.Tween QPYX_o_YXQP = QPYX_obj_YXQP.SetEase(QPYX_arg0_YXQP); ToLua.PushObject(L_YXQP, QPYX_o_YXQP); return(1); } else if (QPYX_count_YXQP == 3) { DG.Tweening.Tweener QPYX_obj_YXQP = (DG.Tweening.Tweener)ToLua.CheckObject <DG.Tweening.Tweener>(L_YXQP, 1); DG.Tweening.Ease QPYX_arg0_YXQP = (DG.Tweening.Ease)ToLua.CheckObject(L_YXQP, 2, typeof(DG.Tweening.Ease)); float QPYX_arg1_YXQP = (float)LuaDLL.luaL_checknumber(L_YXQP, 3); DG.Tweening.Tween QPYX_o_YXQP = QPYX_obj_YXQP.SetEase(QPYX_arg0_YXQP, QPYX_arg1_YXQP); ToLua.PushObject(L_YXQP, QPYX_o_YXQP); return(1); } else if (QPYX_count_YXQP == 4) { DG.Tweening.Tweener QPYX_obj_YXQP = (DG.Tweening.Tweener)ToLua.CheckObject <DG.Tweening.Tweener>(L_YXQP, 1); DG.Tweening.Ease QPYX_arg0_YXQP = (DG.Tweening.Ease)ToLua.CheckObject(L_YXQP, 2, typeof(DG.Tweening.Ease)); float QPYX_arg1_YXQP = (float)LuaDLL.luaL_checknumber(L_YXQP, 3); float QPYX_arg2_YXQP = (float)LuaDLL.luaL_checknumber(L_YXQP, 4); DG.Tweening.Tween QPYX_o_YXQP = QPYX_obj_YXQP.SetEase(QPYX_arg0_YXQP, QPYX_arg1_YXQP, QPYX_arg2_YXQP); ToLua.PushObject(L_YXQP, QPYX_o_YXQP); return(1); } else { return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to method: DG.Tweening.Tweener.SetEase")); } } catch (Exception e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP)); } }
static bool DOVirtual_EasedValue__Single__Single__Single__Ease(JSVCall vc, int argc) { int len = argc; if (len == 4) { System.Single arg0 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg); System.Single arg1 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg); System.Single arg2 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg); DG.Tweening.Ease arg3 = (DG.Tweening.Ease)JSApi.getEnum((int)JSApi.GetType.Arg); JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(DG.Tweening.DOVirtual.EasedValue(arg0, arg1, arg2, arg3))); } return(true); }
static int SetEase(IntPtr L) { int count = LuaDLL.lua_gettop(L); if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(DG.Tweening.Tween), typeof(DG.Tweening.EaseFunction))) { DG.Tweening.Tween obj = (DG.Tweening.Tween)LuaScriptMgr.GetNetObjectSelf(L, 1, "DG.Tweening.Tween"); DG.Tweening.EaseFunction arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (DG.Tweening.EaseFunction)LuaScriptMgr.GetLuaObject(L, 2); } else { LuaFunction func = LuaScriptMgr.GetLuaFunction(L, 2); arg0 = (param0, param1, param2, param3) => { int top = func.BeginPCall(); LuaScriptMgr.Push(L, param0); LuaScriptMgr.Push(L, param1); LuaScriptMgr.Push(L, param2); LuaScriptMgr.Push(L, param3); func.PCall(top, 4); object[] objs = func.PopValues(top); func.EndPCall(top); return((float)objs[0]); }; } DG.Tweening.Tween o = obj.SetEase(arg0); LuaScriptMgr.PushObject(L, o); return(1); } else if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(DG.Tweening.Tween), typeof(AnimationCurve))) { DG.Tweening.Tween obj = (DG.Tweening.Tween)LuaScriptMgr.GetNetObjectSelf(L, 1, "DG.Tweening.Tween"); AnimationCurve arg0 = (AnimationCurve)LuaScriptMgr.GetLuaObject(L, 2); DG.Tweening.Tween o = obj.SetEase(arg0); LuaScriptMgr.PushObject(L, o); return(1); } else if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(DG.Tweening.Tween), typeof(DG.Tweening.Ease))) { DG.Tweening.Tween obj = (DG.Tweening.Tween)LuaScriptMgr.GetNetObjectSelf(L, 1, "DG.Tweening.Tween"); DG.Tweening.Ease arg0 = (DG.Tweening.Ease)LuaScriptMgr.GetLuaObject(L, 2); DG.Tweening.Tween o = obj.SetEase(arg0); LuaScriptMgr.PushObject(L, o); return(1); } else if (count == 3) { DG.Tweening.Tween obj = (DG.Tweening.Tween)LuaScriptMgr.GetNetObjectSelf(L, 1, "DG.Tweening.Tween"); DG.Tweening.Ease arg0 = (DG.Tweening.Ease)LuaScriptMgr.GetNetObject(L, 2, typeof(DG.Tweening.Ease)); float arg1 = (float)LuaScriptMgr.GetNumber(L, 3); DG.Tweening.Tween o = obj.SetEase(arg0, arg1); LuaScriptMgr.PushObject(L, o); return(1); } else if (count == 4) { DG.Tweening.Tween obj = (DG.Tweening.Tween)LuaScriptMgr.GetNetObjectSelf(L, 1, "DG.Tweening.Tween"); DG.Tweening.Ease arg0 = (DG.Tweening.Ease)LuaScriptMgr.GetNetObject(L, 2, typeof(DG.Tweening.Ease)); float arg1 = (float)LuaScriptMgr.GetNumber(L, 3); float arg2 = (float)LuaScriptMgr.GetNumber(L, 4); DG.Tweening.Tween o = obj.SetEase(arg0, arg1, arg2); LuaScriptMgr.PushObject(L, o); return(1); } else { LuaDLL.luaL_error(L, "invalid arguments to method: DG.Tweening.Tween.SetEase"); } return(0); }
static int SetEase(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.Tween), typeof(DG.Tweening.Ease))) { DG.Tweening.Tweener obj = (DG.Tweening.Tweener)ToLua.ToObject(L, 1); DG.Tweening.Ease arg0 = (DG.Tweening.Ease)ToLua.ToObject(L, 2); DG.Tweening.Tween o = obj.SetEase(arg0); ToLua.PushObject(L, o); return(1); } else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.Tween), typeof(UnityEngine.AnimationCurve))) { DG.Tweening.Tweener obj = (DG.Tweening.Tweener)ToLua.ToObject(L, 1); UnityEngine.AnimationCurve arg0 = (UnityEngine.AnimationCurve)ToLua.ToObject(L, 2); DG.Tweening.Tween o = obj.SetEase(arg0); ToLua.PushObject(L, o); return(1); } else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.Tween), typeof(DG.Tweening.EaseFunction))) { DG.Tweening.Tweener obj = (DG.Tweening.Tweener)ToLua.ToObject(L, 1); DG.Tweening.EaseFunction arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (DG.Tweening.EaseFunction)ToLua.ToObject(L, 2); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(DG.Tweening.EaseFunction), func) as DG.Tweening.EaseFunction; } DG.Tweening.Tween o = obj.SetEase(arg0); ToLua.PushObject(L, o); return(1); } else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.Tween), typeof(DG.Tweening.Ease), typeof(float))) { DG.Tweening.Tweener obj = (DG.Tweening.Tweener)ToLua.ToObject(L, 1); DG.Tweening.Ease arg0 = (DG.Tweening.Ease)ToLua.ToObject(L, 2); float arg1 = (float)LuaDLL.lua_tonumber(L, 3); DG.Tweening.Tween o = obj.SetEase(arg0, arg1); ToLua.PushObject(L, o); return(1); } else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.Tween), typeof(DG.Tweening.Ease), typeof(float), typeof(float))) { DG.Tweening.Tweener obj = (DG.Tweening.Tweener)ToLua.ToObject(L, 1); DG.Tweening.Ease arg0 = (DG.Tweening.Ease)ToLua.ToObject(L, 2); float arg1 = (float)LuaDLL.lua_tonumber(L, 3); float arg2 = (float)LuaDLL.lua_tonumber(L, 4); DG.Tweening.Tween o = obj.SetEase(arg0, arg1, arg2); ToLua.PushObject(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: DG.Tweening.Tweener.SetEase")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public static Sequence DOArc(this Transform obj, Vector3 target, float time, float delay, float offsetAmount, Vector3 symmetry, bool lookAt, ArcOffsetType type = ArcOffsetType.Normal, DG.Tweening.Ease arcEase = Ease.InOutSine) { var sequence = DOTween.Sequence(); var source = obj.localPosition; var diff = (source - target).normalized; var rot_z = Mathf.Atan2(diff.y, diff.x) * Mathf.Rad2Deg; var aimRotation = Quaternion.Euler(0f, 0f, rot_z + 90); var mid = (source + target) / 2f; var arcOffsetDirection = Quaternion.Euler(0f, 0f, 90f) * (source - target).normalized; switch (type) { case ArcOffsetType.Unadjusted: break; case ArcOffsetType.Normal: if (Vector3.Dot(arcOffsetDirection, symmetry) < 0) { arcOffsetDirection = Quaternion.Euler(0f, 0f, 180f) * arcOffsetDirection; } break; case ArcOffsetType.Inverted: if (Vector3.Dot(arcOffsetDirection, symmetry) >= 0) { arcOffsetDirection = Quaternion.Euler(0f, 0f, 180f) * arcOffsetDirection; } break; case ArcOffsetType.Random: var random = UnityEngine.Random.Range(-1, 1); if (random > 0) { arcOffsetDirection = Quaternion.Euler(0f, 0f, 180f) * arcOffsetDirection; } break; } var arcPoint = mid + arcOffsetDirection * offsetAmount; var arcPath = new List <Vector3>(); arcPath.Add(arcPoint); arcPath.Add(target); if (lookAt) { sequence.Append(obj.transform.DORotate(aimRotation.eulerAngles, delay, RotateMode.Fast)); sequence.Append(obj.DOLocalPath(arcPath.ToArray(), time, PathType.CatmullRom, PathMode.TopDown2D, 10, Color.red).SetLookAt(0.01f, Vector3.forward, Vector3.right).SetEase(arcEase)); } else { sequence.AppendInterval(delay); sequence.Append(obj.DOLocalPath(arcPath.ToArray(), time, PathType.CatmullRom, PathMode.TopDown2D, 10, Color.red).SetEase(arcEase)); } sequence.Play(); return(sequence); }
void EmitDOTweenScaleFor(Transform t, Vector3 to, float twDuration, DG.Tweening.Ease ease) { t.localScale = Vector3.one; t.DOScale(to, twDuration).SetEase(ease).OnComplete(() => EmitDOTweenScaleFor(t, to, twDuration, ease)); }
void EmitDOTweenRotationFor(Transform t, Vector3 to, float twDuration, DG.Tweening.Ease ease) { t.rotation = Quaternion.identity; t.DORotate(to, twDuration).SetEase(ease).OnComplete(() => EmitDOTweenRotationFor(t, to, twDuration, ease)); }
void EmitDOTweenPositionFor(Transform t, Vector3 to, float twDuration, DG.Tweening.Ease ease) { t.position = Vector3.zero; t.DOMove(to, twDuration).SetEase(ease).OnComplete(() => EmitDOTweenPositionFor(t, to, twDuration, ease)); }
void SetupTweens() { // Ease DG.Tweening.Ease dotweenEase = easing == Easing.Linear ? DG.Tweening.Ease.Linear : DG.Tweening.Ease.InOutQuad; Holoville.HOTween.EaseType hotweenEase = easing == Easing.Linear ? Holoville.HOTween.EaseType.Linear : Holoville.HOTween.EaseType.EaseInOutQuad; LeanTweenType leanEase = easing == Easing.Linear ? LeanTweenType.linear : LeanTweenType.easeInOutQuad; GoEaseType goEase = easing == Easing.Linear ? GoEaseType.Linear : GoEaseType.QuadInOut; iTween.EaseType iTweenEase = easing == Easing.Linear ? iTween.EaseType.linear : iTween.EaseType.easeInOutQuad; // Loop int loops = testSetup == TestSetup.Emit ? 1 : -1; DG.Tweening.LoopType dotweenLoopType = testSetup == TestSetup.YoyoLoop ? DG.Tweening.LoopType.Yoyo : DG.Tweening.LoopType.Restart; Holoville.HOTween.LoopType hotweenLoopType = testSetup == TestSetup.YoyoLoop ? Holoville.HOTween.LoopType.Yoyo : Holoville.HOTween.LoopType.Restart; LeanTweenType leanLoopType = testSetup == TestSetup.YoyoLoop ? LeanTweenType.pingPong : LeanTweenType.clamp; GoLoopType goLoopType = testSetup == TestSetup.YoyoLoop ? GoLoopType.PingPong : GoLoopType.RestartFromBeginning; iTween.LoopType iTweenLoopType = loops != -1 ? iTween.LoopType.none : testSetup == TestSetup.YoyoLoop ? iTween.LoopType.pingPong : iTween.LoopType.loop; // Create tweens switch (testType) { case TestType.Floats: for (int i = 0; i < numTweens; ++i) { TestObjectData data = testObjsData[i]; switch (engine) { case Engine.HOTween: HOTween.To(data, duration, new Holoville.HOTween.TweenParms() .Prop("floatValue", rndFloats[i]) .Ease(hotweenEase) .Loops(loops, hotweenLoopType) ); break; case Engine.LeanTween: LeanTween.value(this.gameObject, x => data.floatValue = x, data.floatValue, rndFloats[i], duration).setEase(leanEase).setRepeat(loops).setLoopType(leanLoopType); break; case Engine.GoKit: Go.to(data, duration, new GoTweenConfig() .floatProp("floatValueProperty", rndFloats[i]) .setEaseType(goEase) .setIterations(loops, goLoopType) ); break; case Engine.iTween: Hashtable hs = new Hashtable(); hs.Add("from", data.floatValue); hs.Add("to", rndFloats[i]); hs.Add("time", duration); hs.Add("onupdate", "UpdateiTweenFloat"); hs.Add("looptype", iTweenLoopType); hs.Add("easetype", iTweenEase); iTween.ValueTo(this.gameObject, hs); break; default: // tCopy is needed to create correct closure object, // otherwise closure will pass the same t to all the loop TestObjectData dataCopy = data; DOTween.To(() => dataCopy.floatValue, x => dataCopy.floatValue = x, rndFloats[i], duration).SetEase(dotweenEase).SetLoops(loops, dotweenLoopType); break; } } break; default: for (int i = 0; i < numTweens; ++i) { float twDuration = testSetup == TestSetup.Emit ? UnityEngine.Random.Range(0.25f, 1f) : duration; Transform t = testObjsTrans[i]; GameObject go = testObjsGos[i]; // Used by LeanTween and iTween switch (engine) { case Engine.HOTween: Holoville.HOTween.TweenParms tp = new Holoville.HOTween.TweenParms() .Ease(hotweenEase) .Loops(loops, hotweenLoopType); if (positionTween) { Vector3 toPos = rndPositions[i]; tp.Prop("position", toPos); if (testSetup == TestSetup.Emit) { tp.OnComplete(() => EmitHOTweenPositionFor(t, toPos, twDuration, hotweenEase)); } } if (rotationTween) { Vector3 toRot = rndRotations[i]; tp.Prop("rotation", toRot); if (testSetup == TestSetup.Emit) { tp.OnComplete(() => EmitHOTweenRotationFor(t, toRot, twDuration, hotweenEase)); } } if (scaleTween) { tp.Prop("localScale", rndScale); if (testSetup == TestSetup.Emit) { tp.OnComplete(() => EmitHOTweenScaleFor(t, rndScale, twDuration, hotweenEase)); } } HOTween.To(t, twDuration, tp); break; case Engine.LeanTween: LTDescr leanTween; if (positionTween) { Vector3 toPos = rndPositions[i]; leanTween = LeanTween.move(go, rndPositions[i], twDuration).setEase(leanEase).setRepeat(loops).setLoopType(leanLoopType); if (testSetup == TestSetup.Emit) { leanTween.setOnComplete(() => EmitLeanTweenPositionFor(t, go, toPos, twDuration, leanEase)); } } if (rotationTween) { Vector3 toRot = rndRotations[i]; leanTween = LeanTween.rotate(go, rndRotations[i], twDuration).setEase(leanEase).setRepeat(loops).setLoopType(leanLoopType); if (testSetup == TestSetup.Emit) { leanTween.setOnComplete(() => EmitLeanTweenRotationFor(t, go, toRot, twDuration, leanEase)); } } if (scaleTween) { leanTween = LeanTween.scale(go, rndScale, twDuration).setEase(leanEase).setRepeat(loops).setLoopType(leanLoopType); if (testSetup == TestSetup.Emit) { leanTween.setOnComplete(() => EmitLeanTweenScaleFor(t, go, rndScale, twDuration, leanEase)); } } break; case Engine.GoKit: GoTweenConfig goConfig = new GoTweenConfig() .setEaseType(goEase) .setIterations(loops, goLoopType); if (positionTween) { Vector3 toPos = rndPositions[i]; goConfig.addTweenProperty(new PositionTweenProperty(toPos)); if (testSetup == TestSetup.Emit) { goConfig.onComplete(x => EmitGoKitPositionFor(t, toPos, twDuration, goEase)); } } if (rotationTween) { Vector3 toRot = rndRotations[i]; goConfig.addTweenProperty(new RotationTweenProperty(toRot)); if (testSetup == TestSetup.Emit) { goConfig.onComplete(x => EmitGoKitRotationFor(t, toRot, twDuration, goEase)); } } if (scaleTween) { goConfig.addTweenProperty(new ScaleTweenProperty(rndScale)); if (testSetup == TestSetup.Emit) { goConfig.onComplete(x => EmitGoKitScaleFor(t, rndScale, twDuration, goEase)); } } Go.to(t, twDuration, goConfig); break; case Engine.iTween: Hashtable hs; if (positionTween) { hs = new Hashtable(); hs.Add("position", rndPositions[i]); hs.Add("time", twDuration); hs.Add("looptype", iTweenLoopType); hs.Add("easetype", iTweenEase); iTween.MoveTo(go, hs); } if (rotationTween) { hs = new Hashtable(); hs.Add("rotation", rndRotations[i]); hs.Add("time", twDuration); hs.Add("looptype", iTweenLoopType); hs.Add("easetype", iTweenEase); iTween.RotateTo(go, hs); } if (scaleTween) { hs = new Hashtable(); hs.Add("scale", rndScale); hs.Add("time", twDuration); hs.Add("looptype", iTweenLoopType); hs.Add("easetype", iTweenEase); iTween.ScaleTo(go, hs); } break; default: // tCopy is needed to create correct closure object, // otherwise closure will pass the same t to all the loop Transform tCopy = t; DG.Tweening.Tween dotween; if (positionTween) { Vector3 toPos = rndPositions[i]; dotween = tCopy.DOMove(toPos, twDuration).SetEase(dotweenEase).SetLoops(loops, dotweenLoopType); if (testSetup == TestSetup.Emit) { dotween.OnComplete(() => EmitDOTweenPositionFor(t, toPos, twDuration, dotweenEase)); } } if (rotationTween) { Vector3 toRot = rndRotations[i]; dotween = tCopy.DORotate(toRot, twDuration).SetEase(dotweenEase).SetLoops(loops, dotweenLoopType); if (testSetup == TestSetup.Emit) { dotween.OnComplete(() => EmitDOTweenRotationFor(t, toRot, twDuration, dotweenEase)); } } if (scaleTween) { dotween = tCopy.DOScale(rndScale, twDuration).SetEase(dotweenEase).SetLoops(loops, dotweenLoopType); if (testSetup == TestSetup.Emit) { dotween.OnComplete(() => EmitDOTweenScaleFor(t, rndScale, twDuration, dotweenEase)); } } break; } } break; } }
public TweenParams(DG.Tweening.Ease ease, float overshot) { this.mode = Mode.Ease; this.ease = ease; this.overshot = overshot; }
public TweenParams(DG.Tweening.Ease ease) { this.mode = Mode.Ease; this.ease = ease; }