1234567891011121314151617181920212223242526272829303132 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- public class Menu_Script : MonoBehaviour
- {
- public string nextSceneName;
-
- private GameObject scrollingText;
-
- // Start is called before the first frame update
- void Start()
- {
- scrollingText = GameObject.FindWithTag("ScrollingText");
- }
- // Update is called once per frame
- void Update()
- {
- if (scrollingText) {
- scrollingText.GetComponent<RectTransform>().localPosition = new Vector2(0, scrollingText.GetComponent<RectTransform>().localPosition.y + Time.deltaTime * 40f);
- }
-
- if (Input.GetKeyDown("space"))
- {
- if (nextSceneName != null) {
- SceneManager.LoadScene(nextSceneName);
- }
- }
- }
- }
|