no message
This commit is contained in:
31
UnnamedFishProject/Assets/Scripts/CreditsScript.cs
Normal file
31
UnnamedFishProject/Assets/Scripts/CreditsScript.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class CreditsScript : MonoBehaviour
|
||||
{
|
||||
|
||||
public float scrollSpeed = 20f;
|
||||
|
||||
private RectTransform rectTransform;
|
||||
|
||||
void Start()
|
||||
{
|
||||
rectTransform = GetComponent<RectTransform>();
|
||||
}
|
||||
|
||||
|
||||
void Update()
|
||||
{
|
||||
rectTransform.anchoredPosition += new Vector2(0, scrollSpeed * Time.deltaTime);
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.KeypadEnter))
|
||||
{
|
||||
SceneManager.LoadSceneAsync(0);
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
scrollSpeed += 100;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user