예제 #1
0
    /// <summary>
    /// The method we will continuously call to move the player around
    /// </summary>
    void SequenceDOTLogic()
    {
        PLAYER.localRotation = Quaternion.identity;

        if (sequenceDOT != null)
        {
            sequenceDOT.Kill(false);
        }

        if (firstStart)
        {
            ResetPosition();
        }

        firstStart = false;

        sequenceDOT = DOTween.Sequence();

        rotateDOTVector *= -1f;

        PLAYER.DOScaleX(-rotateDOTVector.z, 0.2f);

        LoopType loopDot = LoopType.Incremental;

        sequenceDOT.Append(rotatePlayer.DOLocalRotate(rotateDOTVector * 360, 5, RotateMode.FastBeyond360).SetEase(Ease.Linear).SetRelative(true));
        sequenceDOT.SetLoops(1, loopDot);

        sequenceDOT.OnStepComplete(() => {
            SequenceDOTLogic();
        });
    }