/// <summary>Tweens an Image's colors using the given gradient /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). /// Also stores the image as the tween's target so it can be used for filtered operations</summary> /// <param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param> public static Sequence DOGradientColor(this Image target, Gradient gradient, float duration) { Sequence s = DOTween.Sequence(); GradientColorKey[] colors = gradient.colorKeys; int len = colors.Length; for (int i = 0; i < len; ++i) { GradientColorKey c = colors[i]; if (i == 0 && c.time <= 0) { target.color = c.color; continue; } float colorDuration = i == len - 1 ? duration - s.Duration(false) // Verifies that total duration is correct : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear)); } s.SetTarget(target); return(s); }
static int QPYX_SetTarget_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)); object QPYX_arg0_YXQP = ToLua.ToVarObject(L_YXQP, 2); DG.Tweening.Tween QPYX_o_YXQP = QPYX_obj_YXQP.SetTarget(QPYX_arg0_YXQP); ToLua.PushObject(L_YXQP, QPYX_o_YXQP); return(1); } catch (Exception e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP)); } }
static int SetTarget(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); DG.Tweening.Sequence obj = (DG.Tweening.Sequence)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Sequence)); object arg0 = ToLua.ToVarObject(L, 2); DG.Tweening.Tween o = obj.SetTarget(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int _m_SetTarget(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); DG.Tweening.Sequence __cl_gen_to_be_invoked = (DG.Tweening.Sequence)translator.FastGetCSObj(L, 1); try { { object target = translator.GetObject(L, 2, typeof(object)); DG.Tweening.Tween __cl_gen_ret = __cl_gen_to_be_invoked.SetTarget(target); translator.Push(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }