// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.KeypadEnter)) { Book.Cur_Style = MyBook.TurningStyle.BottomRight; BJTweenPlugins.BJTweenAction be = this.gameObject.AddComponent <BJTweenPlugins.BJTweenAction>(); be.AniAction = progress => { var bpPos = BJTweenPlugins.BJBezier.GetBezierTPoint(Points, progress); Book.FollowPoint(bpPos); }; be.Duration = 3f; be.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(); }