public void StartFadeOverTime(FadeDir dir, Action action) { if (action != null) { action(); } _fading = true; _fadeDir = dir; _currentTime = 0; }
public void StartFadeOverTime(FadeDir dir) { if (PreviousScene.screenshot != null) { // image.texture = PreviousScene.screenshot; } _alpha = Canvas.alpha; fading = true; currentTime = 0; fadeDir = dir; }
void Fade(FadeDir dir) { // don't do anything if we're already fading in the same direction // or are already faded in completely in that direction if (_fadeDir == dir) { return; } // start a new fade _timer = 0.0f; _timeFactor = 1.0f / fadeDuration; // we could calculate this only at the start but what if the user changes the duration _startWeight = _currentWeight; _fadeDir = dir; _fadeRunning = true; }