LTDescr.setLoopPingPong C# (CSharp) Method

setLoopPingPong() public method

public setLoopPingPong ( ) : LTDescr
return LTDescr
    public LTDescr setLoopPingPong()
    {
        this.loopType = LeanTweenType.pingPong;
        if(this.loopCount==0)
            this.loopCount = -1;
        return this;
    }

Same methods

LTDescr::setLoopPingPong ( int loops ) : LTDescr

Usage Example

Beispiel #1
0
        //IEnumerator HandleTweenDelayed()
        //{
        //    float counter = 0;
        //    while (counter < delay)
        //    {
        //        counter += Time.deltaTime;
        //        yield return null;
        //    }
        //    HandleTween();
        //}

        //IEnumerator Activate()
        //{
        //    float counter = 0;
        //    while (counter < delay)
        //    {
        //        counter += Time.deltaTime;
        //        yield return null;
        //    }
        //    objectToAnimate.SetActive(true);
        //}

        public void HandleTween()
        {
            if (objectToAnimate == null)
            {
                objectToAnimate = gameObject;
            }

            switch (animationType)
            {
            case UIAnimationType.Fade:
                Fade();
                break;

            case UIAnimationType.Move:
                Move();
                break;

            case UIAnimationType.MoveAbsolute:
                MoveAbsolute();
                break;

            case UIAnimationType.Scale:
                Scale();
                break;

            case UIAnimationType.ScaleX:
                ScaleX();
                break;

            case UIAnimationType.ScaleY:
                ScaleY();
                break;

            default:
                break;
            }

            _tweenObject.setDelay(delay);
            _tweenObject.setEase(easeType);

            if (loop)
            {
                _tweenObject.loopCount = int.MaxValue;
            }
            if (pingpong)
            {
                _tweenObject.setLoopPingPong();
            }
        }
All Usage Examples Of LTDescr::setLoopPingPong
LTDescr