public void Play(float from, float to, float final, float duration, EaseActionHelper.MyMethod anitype = EaseActionHelper.MyMethod.Linear) { this.From = from; this.To = to; this.Duration = duration; this.Anitype = anitype; base.Play(); }
public static void FillAmountTo(this GameObject trans, float from, float to, float duration, EventHandler handle) { UITexture texture = trans.GetComponent <UITexture>(); if (texture == null) { return; } EaseActionHelper.MyMethod Anitype = EaseActionHelper.MyMethod.Linear; BJTweenAction baseAni = texture.gameObject.AddComponent <BJTweenAction>(); baseAni.Duration = duration; baseAni.AniAction = prog => { texture.fillAmount = EaseActionHelper.Instance.EaseCalculate(Anitype, from, to, prog); }; baseAni.AniEnded += handle; baseAni.Play(); }
public static void MoveSingle(this Transform trans, PosKind kind, float fromValue, float toValue, float duration, EventHandler handler = null, EaseActionHelper.MyMethod anitype = EaseActionHelper.MyMethod.Linear) { if (kind == PosKind.A) { return; } var pos = trans.gameObject.AddComponent <BJTweenPos>(); if (handler != null) { pos.AniEnded += handler; } var from = trans.localPosition; var to = from; switch (kind) { case PosKind.X: from.x = fromValue; to.x = toValue; break; case PosKind.Y: from.y = fromValue; to.y = toValue; break; case PosKind.Z: from.z = fromValue; to.z = toValue; break; } pos.Play(from, to, duration, anitype); }
public static void Move(this Transform trans, Vector3 from, Vector3 to, float duration, EventHandler handler = null, EaseActionHelper.MyMethod anitype = EaseActionHelper.MyMethod.Linear) { var pos = trans.gameObject.AddComponent <BJTweenPos>(); if (handler != null) { pos.AniEnded += handler; } pos.Play(from, to, duration, anitype); }
public static void MoveBy(this Transform trans, Vector3 del, float duration, EventHandler handler = null, EaseActionHelper.MyMethod anitype = EaseActionHelper.MyMethod.Linear) { Vector3 to = trans.localPosition + del; MoveTo(trans, to, duration, handler, anitype); }
public static void NGUIFadeIn(this Transform trans, float duration, float from = 0, float to = 1, EventHandler handler = null, EaseActionHelper.MyMethod anitype = EaseActionHelper.MyMethod.Linear) { var alpha = trans.gameObject.AddComponent <BJTweenNUIAlpha>(); if (handler != null) { alpha.AniEnded += handler; } alpha.StartAnimation(from, to, duration); }
public static void Scale(this GameObject obj, Vector3 from, Vector3 to, float duration, EventHandler handle = null, EaseActionHelper.MyMethod type = EaseActionHelper.MyMethod.Linear) { var scale = obj.AddComponent <BJTweenScale>(); scale.From = from; scale.To = to; scale.Anitype = type; scale.Duration = duration; scale.AniEnded += handle; scale.Play(); }