public void scale(Vector3 target, bool locally, EaseAction easing = null)
 {
     if (this._timer > 0f)
     {
         Debug.LogError("Cannot modify task after it has been started!");
     }
     else
     {
         this._scaling        = new Scaling();
         this._scaling.axis   = new bool[] { true, true, true };
         this._scaling.start  = !locally ? this._transform.lossyScale : this._transform.localScale;
         this._scaling.target = target;
         this._scaling.local  = locally;
         this._scaling.easing = easing;
     }
 }
 public void translate(Vector3 target, bool locally, EaseAction easing = null)
 {
     if (this._timer > 0f)
     {
         Debug.LogError("Cannot modify task after it has been started!");
     }
     else
     {
         this._translation           = new Translation();
         this._translation.axis      = new bool[] { true, true, true };
         this._translation.start     = !locally ? this._transform.position : this._transform.localPosition;
         this._translation.target    = target;
         this._translation.local     = locally;
         this._translation.easing    = easing;
         this._translation.algorithm = TranslationAlgorithm.LINEAR;
     }
 }
 public void rotate(Vector3 rotateBy, bool locally = true, EaseAction easing = null)
 {
     if (this._timer > 0f)
     {
         Debug.LogError("Cannot modify task after it has been started!");
     }
     else
     {
         this._rotation          = new Rotation();
         this._rotation.axis     = new bool[] { true, true, true };
         this._rotation.start    = !locally ? this._transform.rotation : this._transform.localRotation;
         this._rotation.rotateBy = rotateBy;
         this._rotation.local    = locally;
         this._rotation.easing   = easing;
         this._rotation.lazy     = false;
     }
 }
 public void translateWithQuadraticBezier(Vector3 target, bool locally, Vector3 bezierP1,
                                          EaseAction easing = null)
 {
     if (this._timer > 0f)
     {
         Debug.LogError("Cannot modify task after it has been started!");
     }
     else
     {
         this._translation           = new Translation();
         this._translation.axis      = new bool[] { true, true, true };
         this._translation.start     = !locally ? this._transform.position : this._transform.localPosition;
         this._translation.target    = target;
         this._translation.local     = locally;
         this._translation.easing    = easing;
         this._translation.algorithm = TranslationAlgorithm.QUADRATIC_BEZIER;
         this._translation.cp0       = bezierP1;
     }
 }
 public void translateToAnchoredPos(Vector2 targetAnchoredPos, EaseAction easing = null)
 {
     if (this._timer > 0f)
     {
         Debug.LogError("Cannot modify task after it has been started!");
     }
     else if (this._rectTransform == null)
     {
         Debug.LogError("No RectTransform specified before attempting to translate to anchored position!");
     }
     else
     {
         this._translationAnchoredPosition           = new TranslationAnchoredPosition();
         this._translationAnchoredPosition.start     = this._rectTransform.anchoredPosition;
         this._translationAnchoredPosition.target    = targetAnchoredPos;
         this._translationAnchoredPosition.easing    = easing;
         this._translationAnchoredPosition.algorithm = TranslationAlgorithm.LINEAR;
     }
 }
 public void translateWithCatmullRom(Vector3 target, bool locally, Vector3 catmullRomP0, Vector3 catmullRomP1,
                                     EaseAction easing = null)
 {
     if (this._timer > 0f)
     {
         Debug.LogError("Cannot modify task after it has been started!");
     }
     else
     {
         this._translation           = new Translation();
         this._translation.axis      = new bool[] { true, true, true };
         this._translation.start     = !locally ? this._transform.position : this._transform.localPosition;
         this._translation.target    = target;
         this._translation.local     = locally;
         this._translation.easing    = easing;
         this._translation.algorithm = TranslationAlgorithm.CATMULL_ROM;
         this._translation.cp0       = catmullRomP0;
         this._translation.cp1       = catmullRomP1;
     }
 }
 public void reset(float duration, float delay, EaseAction ease)
 {
     this.reset();
     this.duration = duration;
     this.delay    = delay;
     if (this._translation != null)
     {
         this._translation.easing = ease;
     }
     if (this._translationAnchoredPosition != null)
     {
         this._translationAnchoredPosition.easing = ease;
     }
     if (this._rotation != null)
     {
         this._rotation.easing = ease;
     }
     if (this._scaling != null)
     {
         this._scaling.easing = ease;
     }
 }
Example #8
0
        public bool addTask(RFTweenerTask t, float delay = -1, EaseAction ease = null)
        {
            if (lastNode != null)
            {
                lastNode.next = t;
                t.prev        = lastNode;
                lastNode      = t;
            }
            else
            {
                firstNode = lastNode = t;
            }

            if (delay > 0)
            {
                t.delay = delay;
            }
            if (ease != null)
            {
                t.ease = ease;
            }
            t.reset();
            return(true);
        }
Example #9
0
 public Ease(AnimationCurve animationCurve)
 {
     this.animationCurve = animationCurve;
     Interpolate         = InterpolateAnimationCurve;
 }
Example #10
0
 public Ease(EaseAction easeAction)
 {
     Interpolate = easeAction;
 }