Exemplo n.º 1
0
        public static void Timer(float delay, OnAnimationCompleteCallback onDelayReachesCallback)
        {
            Tweener tweener   = new Timer();
            float   deltaMove = 1 / delay;

            tweener.SetData(deltaMove, 0, 1, false, false, null, null, onDelayReachesCallback);
            TweenUpdater.pTweeners.Add(tweener);
        }
 public TweenParam(float durationOrSpeed, float delay, int loopCount, bool pingPong, AnimationCurve animationCurve, OnAnimationCompleteCallback onAnimationCompleteCallback = null)
 {
     _DurationOrSpeed         = durationOrSpeed;
     _Delay                   = delay;
     _LoopCount               = loopCount;
     _PingPong                = pingPong;
     _Type                    = EaseType.Linear;
     _UseAnimationCurve       = true;
     _AnimationCurve          = animationCurve;
     pOnTweenCompleteCallback = onAnimationCompleteCallback;
 }
Exemplo n.º 3
0
 public void SetData(float deltaMove, float delay, int loopCount, bool pingPong, bool useAnimationCurve, AnimationCurve animationCurve, CustomCurve customAnimationCurve, OnAnimationCompleteCallback onAnimationCompleteCallback)
 {
     mDeltaMove                   = deltaMove;
     mDelay                       = delay;
     mLoopCount                   = loopCount == 0 ? 1 : loopCount;
     mPingPong                    = pingPong;
     mAnimationCurve              = animationCurve;
     mCustomAnimationCurve        = customAnimationCurve;
     pState                       = TweenState.RUNNING;
     useAnimationCurve            = mUseAnimationCurve;
     pOnAnimationCompleteCallback = onAnimationCompleteCallback;
 }
Exemplo n.º 4
0
        public static void PlayAnim(GameObject tweenObject, string name, OnAnimationCompleteCallback onAnimationCompleteCallback = null)
        {
            Animation anim = tweenObject.GetComponent <Animation>();

            if (anim == null)
            {
                Debug.Log("Aniamtion component has not been attached to this game object: " + tweenObject.name);
                return;
            }
            Tweener tweener = new AnimatoinComp(tweenObject, anim, name);

            TweenUpdater.pTweeners.Add(tweener);
        }
Exemplo n.º 5
0
        public static void Shake2D(GameObject tweenObject, float duration, float shakeAmount, OnAnimationCompleteCallback onAnimationCompleteCallback = null)
        {
            Tweener tweener   = new Shake2D(tweenObject, shakeAmount);
            float   deltaMove = 1 / duration;

            tweener.SetData(deltaMove, 0, 1, false, false, null, null, onAnimationCompleteCallback);
            TweenUpdater.pTweeners.Add(tweener);
        }
 public TweenParam(float durationOrSpeed, int loopCount, bool pingPong, AnimationCurve animationCurve, OnAnimationCompleteCallback onAnimationCompleteCallback = null)
     : this(durationOrSpeed, 0f, loopCount, pingPong, animationCurve, onAnimationCompleteCallback)
 {
 }
 public TweenParam(float durationOrSpeed, float delay, bool pingPong, AnimationCurve animationCurve, OnAnimationCompleteCallback onAnimationCompleteCallback = null)
     : this(durationOrSpeed, delay, 1, pingPong, animationCurve, onAnimationCompleteCallback)
 {
 }
 public TweenParam(float durationOrSpeed, float delay, int loopCount, AnimationCurve animationCurve, OnAnimationCompleteCallback onAnimationCompleteCallback = null)
     : this(durationOrSpeed, delay, loopCount, false, animationCurve, onAnimationCompleteCallback)
 {
 }
 public TweenParam(float durationOrSpeed, AnimationCurve animationCurve, OnAnimationCompleteCallback onAnimationCompleteCallback = null)
     : this(durationOrSpeed, 0f, animationCurve, onAnimationCompleteCallback)
 {
 }
Exemplo n.º 10
0
 public TweenParam(float durationOrSpeed, bool pingPong, EaseType type, OnAnimationCompleteCallback onAnimationCompleteCallback = null)
     : this(durationOrSpeed, 0f, 1, pingPong, type, onAnimationCompleteCallback)
 {
 }
Exemplo n.º 11
0
 public TweenParam(float durationOrSpeed, int loopCount, EaseType type, OnAnimationCompleteCallback onAnimationCompleteCallback = null)
     : this(durationOrSpeed, 0f, loopCount, false, type, onAnimationCompleteCallback)
 {
 }
Exemplo n.º 12
0
 public TweenParam(float durationOrSpeed, float delay, EaseType type, OnAnimationCompleteCallback onAnimationCompleteCallback = null)
     : this(durationOrSpeed, delay, 1, false, type, onAnimationCompleteCallback)
 {
 }
Exemplo n.º 13
0
 public TweenParam(float durationOrSpeed, OnAnimationCompleteCallback onAnimationCompleteCallback = null)
     : this(durationOrSpeed, 0f, 1, false, EaseType.Linear, onAnimationCompleteCallback)
 {
 }