Skip to content

Commit

Permalink
Fixed speeding up credits being able to make credits extremely fast
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSiriusSystem committed Oct 6, 2019
1 parent db21b84 commit b5732b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class EndingManager : MonoBehaviour
{
[Header("Credits Settings")]
[Tooltip("The Y position credits start at.")] [SerializeField] private float creditsY = 600;
[SerializeField] private float creditsScrollSpeed = 0.5f;
[SerializeField] private float creditsScrollSpeed = 0.375f;

[Header("Sound Effects")]
[SerializeField] private AudioClip buttonClick = null;
Expand All @@ -27,6 +27,7 @@ public class EndingManager : MonoBehaviour

private AudioSource audioSource;
private Controls input;
private float creditsFastScrollSpeed = 0.75f;
private string currentLoadingTip = "";
private bool loading = false;

Expand All @@ -38,6 +39,7 @@ void Awake()
audioSource = GetComponent<AudioSource>();
input = new Controls();
if (audioSource) audioSource.ignoreListenerPause = true;
creditsFastScrollSpeed = creditsScrollSpeed * 2;
currentLoadingTip = "";
loading = false;
Time.timeScale = 1;
Expand Down Expand Up @@ -161,10 +163,10 @@ void speedUpCredits(bool state)
{
if (state)
{
creditsScrollSpeed *= 2;
creditsScrollSpeed = creditsFastScrollSpeed;
} else
{
creditsScrollSpeed *= 0.5f;
creditsScrollSpeed = creditsFastScrollSpeed * 0.5f;
}
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class EndingManager : MonoBehaviour

private AudioSource audioSource;
private Controls input;
private float creditsFastScrollSpeed = 1;
private string currentLoadingTip = "";
private bool loading = false;

Expand All @@ -36,6 +37,7 @@ void Awake()
audioSource = GetComponent<AudioSource>();
input = new Controls();
if (audioSource) audioSource.ignoreListenerPause = true;
creditsFastScrollSpeed = creditsScrollSpeed * 2;
currentLoadingTip = "";
loading = false;
Time.timeScale = 1;
Expand Down Expand Up @@ -165,11 +167,11 @@ void speedUpCredits(bool state)
{
if (state)
{
creditsScrollSpeed *= 2;
creditsScrollSpeed = creditsFastScrollSpeed;
controllerSpeedUpButton.text = "Slow Down";
} else
{
creditsScrollSpeed *= 0.5f;
creditsScrollSpeed = creditsFastScrollSpeed * 0.5f;
controllerSpeedUpButton.text = "Speed Up";
}
}
Expand Down

0 comments on commit b5732b2

Please sign in to comment.