Example #1
0
        public virtual void tick(float now)
        {
            if (startTime > now)
            {
                return;
            }

            if (_timer == 0f)
            {
                if (onStart != null)
                {
                    onStart(this);
                }
            }
            _timer = Mathf.Min(now - startTime, this.duration);
            float progress = (this.duration <= 0f) ? 1f : Mathf.Clamp01(this._timer / this.duration);

            doProgress(progress);

            if (onProgress != null)
            {
                onProgress(this, progress);
            }

            if (isCompleted)
            {
                if (onComplete != null)
                {
                    onComplete(this);
                }
                this.state = NodeActiveState.ToDoDelete;
            }
        }
Example #2
0
        public virtual void endTween()
        {
            _timer = this.duration;
            doProgress(1);

            if (onComplete != null)
            {
                onComplete(this);
            }

            this.state = NodeActiveState.ToDoDelete;
        }
Example #3
0
 public virtual void stop()
 {
     this.state = NodeActiveState.ToDoDelete;
 }