Ejemplo n.º 1
0
 public override void Work(float dt, LerpEngine engine)
 {
     onUpdate?.Invoke();
     if (Step(dt))
     {
         engine.RemoveJob(jobID);
         if (onComplete != null)
         {
             onComplete.Invoke();
         }
     }
 }
Ejemplo n.º 2
0
 public override void Work(float dt, LerpEngine engine)
 {
     floatField.Value += (target * dt) / time;
     onUpdate?.Invoke();
     if (Step(dt))
     {
         engine.RemoveJob(jobID);
         if (onComplete != null)
         {
             onComplete.Invoke();
         }
     }
 }
Ejemplo n.º 3
0
        public override void Work(float dt, LerpEngine engine)
        {
            onUpdate?.Invoke();

            rateCounter += dt;
            if (rate > 0 && rateCounter >= rate)
            {
                rateCounter = 0;
                callback?.Invoke();
            }
            else
            {
                callback?.Invoke();
            }

            if (Step(dt))
            {
                if (onComplete != null)
                {
                    onComplete.Invoke();
                }
                engine.RemoveJob(jobID);
            }
        }
Ejemplo n.º 4
0
        public override void Work(float dt, LerpEngine engine)
        {
            if (objectTransform == null)
            {
                engine.RemoveJob(jobID);
            }
            onUpdate?.Invoke();

            Move();

            if (Step(dt))
            {
                engine.RemoveJob(jobID);
                Move(true);
                if (onComplete != null)
                {
                    onComplete.Invoke();
                }

                #region old
                //if (curve != null) curveValue = (curve.Evaluate(1) * amplitude);
                ////Just snap to the target to clear fractions
                //switch (type)
                //{
                //    case TweenTypeSingle.MoveX:
                //        tempTarget.x = target + curveValue;
                //        objectTransform.position = tempTarget;
                //        break;
                //    case TweenTypeSingle.MoveY:
                //        tempTarget.y = target + curveValue;
                //        objectTransform.position = tempTarget;
                //        break;
                //    case TweenTypeSingle.MoveZ:
                //        tempTarget.z = target + curveValue;
                //        objectTransform.position = tempTarget;
                //        break;
                //    case TweenTypeSingle.LocalMoveX:
                //        tempTarget.x = target + curveValue;
                //        objectTransform.localPosition = tempTarget;
                //        break;
                //    case TweenTypeSingle.LocalMoveY:
                //        tempTarget.y = target + curveValue;
                //        objectTransform.localPosition = tempTarget;
                //        break;
                //    case TweenTypeSingle.LocalMoveZ:
                //        tempTarget.z = target + curveValue;
                //        objectTransform.localPosition = tempTarget;
                //        break;
                //    case TweenTypeSingle.ScaleX:
                //        tempTarget.x = target + curveValue;
                //        objectTransform.localScale = tempTarget;
                //        break;
                //    case TweenTypeSingle.ScaleY:
                //        tempTarget.x = target + curveValue;
                //        objectTransform.localScale = tempTarget;
                //        break;
                //    case TweenTypeSingle.ScaleZ:
                //        tempTarget.x = target + curveValue;
                //        objectTransform.localScale = tempTarget;
                //        break;
                //}
                #endregion
            }
        }