mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
feat: changed fade timer constants
This commit is contained in:
parent
e636e2a844
commit
a42ef6f46a
@ -14,7 +14,7 @@ namespace NewHorizons.Handlers
|
||||
Graphic graphic;
|
||||
Image image;
|
||||
|
||||
public float fadeSpeed = 0.01f;
|
||||
public float fadeSpeed = 0.005f;
|
||||
float fade = 1;
|
||||
bool fadingAway = true;
|
||||
|
||||
@ -24,6 +24,9 @@ namespace NewHorizons.Handlers
|
||||
|
||||
System.Random randomizer;
|
||||
|
||||
static readonly int PAUSE_TIMER_MAX = 50;
|
||||
int pauseTimer = PAUSE_TIMER_MAX;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
randomizer = new System.Random();
|
||||
@ -60,6 +63,12 @@ namespace NewHorizons.Handlers
|
||||
// don't fade transition subtitles if there's only one subtitle
|
||||
if (possibleSubtitles.Count <= 1) return;
|
||||
|
||||
if (pauseTimer > 0)
|
||||
{
|
||||
pauseTimer--;
|
||||
return;
|
||||
}
|
||||
|
||||
if (fadingAway)
|
||||
{
|
||||
fade -= fadeSpeed;
|
||||
@ -79,6 +88,7 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
fade = 1;
|
||||
fadingAway = true;
|
||||
pauseTimer = PAUSE_TIMER_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +105,6 @@ namespace NewHorizons.Handlers
|
||||
// that is, the below code will generate numbers up to and including Count-1, not Count.
|
||||
var newIndexOffset = randomizer.Next(1, possibleSubtitles.Count);
|
||||
subtitleIndex = (subtitleIndex + newIndexOffset) % possibleSubtitles.Count;
|
||||
NewHorizons.Utility.Logger.Log("NEW SPRITE INDEX OFFSET " + newIndexOffset + " NEW SPRITE INDEX " + subtitleIndex);
|
||||
|
||||
image.sprite = possibleSubtitles[subtitleIndex];
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user