private void TimeManager() { if (isSlowing) { //Debug.Log("Time is slowing : current time Scale = " + Time.timeScale); timeSlowCompletion += currentTimeBeforeFullSlow * Time.unscaledDeltaTime; Time.timeScale = Interpolator.Interpolate(1f, currentTargetTimeScale, 0, 1, timeSlowCompletion); if (timeSlowCompletion >= 1) { isSlowing = false; } } }
private void Update() { sprite.sharedMaterial.SetVector("_Tiling", new Vector2(1 / (float)(frameNumber), lineNumber)); sprite.sharedMaterial.SetVector("_Offset", new Vector2(Interpolator.Interpolate(0, 1, 0, (frameNumber), currentFrame), 0)); if (currentFrame < 0) { currentFrame = 0; } if (currentFrame > frameNumber - 1) { currentFrame = frameNumber - 1; } }