LTDescr.setLoopCount C# (CSharp) Method

setLoopCount() public method

public setLoopCount ( int loopCount ) : LTDescr
loopCount int
return LTDescr
    public LTDescr setLoopCount( int loopCount )
    {
        this.loopType = LeanTweenType.clamp;
        this.loopCount = loopCount;
        return this;
    }

Usage Example

    static public int RepeatCall(float timeInterval, RepeatCallAction callOnUpdate)
    {
        Action  at    = null;
        int     id    = 0;
        LTDescr descr = null;

        at = () =>
        {
            if (!callOnUpdate())
            {
                LeanTween.cancel(id);
                descr = null;
                at    = null;
            }
            else
            {
                if (descr.loopCount <= 1)
                {
                    descr.setLoopCount(int.MaxValue - 1);
                }
            }
        };

        descr = LeanTween.delayedCall(timeInterval, at).setRepeat(int.MaxValue - 1);
        id    = descr.id;
        return(id);
    }
All Usage Examples Of LTDescr::setLoopCount
LTDescr