Scripte hinzugefügt, CreditsScene komplett bis auf Audio
This commit is contained in:
@@ -4,7 +4,9 @@ using UnityEngine.SceneManagement;
|
||||
public class CreditsScript : MonoBehaviour
|
||||
{
|
||||
|
||||
public float scrollSpeed = 20f;
|
||||
public float scrollSpeed;
|
||||
private float maxScrollSpeed = 300f;
|
||||
[SerializeField] public float maxYPosition;
|
||||
|
||||
private RectTransform rectTransform;
|
||||
|
||||
@@ -23,9 +25,24 @@ public class CreditsScript : MonoBehaviour
|
||||
SceneManager.LoadSceneAsync(0);
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
if (Input.GetKey(KeyCode.Space))
|
||||
{
|
||||
scrollSpeed += 100;
|
||||
scrollSpeed += 50;
|
||||
|
||||
if (scrollSpeed > maxScrollSpeed)
|
||||
{
|
||||
scrollSpeed = maxScrollSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
scrollSpeed = 100f;
|
||||
}
|
||||
|
||||
if (transform.position.y >= maxYPosition)
|
||||
{
|
||||
Debug.Log("The End");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user