Ejemplo n.º 1
0
 public LerpNode(Lerp parent, float startVal, float endVal, long duration, Lerp.LFunc lFunc, LerpNode nextLerp = null, Lerp.Callback callback = null)
 {
     this.startVal = startVal;
     this.endVal   = endVal;
     this.duration = duration;
     isFirstUpdate = true;
     this.lFunc    = lFunc;
     this.nextLerp = nextLerp;
     this.parent   = parent;
     this.callback = callback;
 }
Ejemplo n.º 2
0
        public void Add(float startVal, float endVal, float durationInSec, Lerp.LFunc lFunc, bool loop = false, Callback callback = null)
        {
            long duration = Convert.ToInt64(durationInSec * TimeSpan.TicksPerSecond);

            if (Front == null)
            {
                Back           = new LerpNode(this, startVal, endVal, duration, lFunc, null, callback);
                Front          = Back;
                Current        = Front;
                Front.nextLerp = loop ? Front : null;
            }
            else
            {
                Back.nextLerp = new LerpNode(this, startVal, endVal, duration, lFunc, loop ? Front : null, callback);
                Back          = Back.nextLerp;
            }
        }