コード例 #1
0
ファイル: BJTween.cs プロジェクト: bujian/BookPagesSwitch
 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();
 }
コード例 #2
0
ファイル: BJTween.cs プロジェクト: bujian/BookPagesSwitch
        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();
        }
コード例 #3
0
ファイル: BJTween.cs プロジェクト: bujian/BookPagesSwitch
    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);
    }
コード例 #4
0
ファイル: BJTween.cs プロジェクト: bujian/BookPagesSwitch
    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);
    }
コード例 #5
0
ファイル: BJTween.cs プロジェクト: bujian/BookPagesSwitch
    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);
    }
コード例 #6
0
ファイル: BJTween.cs プロジェクト: bujian/BookPagesSwitch
        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);
        }
コード例 #7
0
ファイル: BJTween.cs プロジェクト: bujian/BookPagesSwitch
        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();
        }