This commit is contained in:
zhangzheng
2026-02-27 18:35:40 +08:00
parent adef8b4cce
commit 1bb1fee5cc
265 changed files with 104076 additions and 92 deletions

View File

@@ -0,0 +1,41 @@
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;
namespace Unity.RenderStreaming.Samples
{
internal class BackButton : MonoBehaviour
{
[SerializeField]
GameObject m_BackButton;
public GameObject backButton
{
get => m_BackButton;
set => m_BackButton = value;
}
void Start()
{
if (Application.CanStreamedLevelBeLoaded("Menu"))
{
m_BackButton.SetActive(true);
}
}
void Update()
{
if (Keyboard.current != null && Keyboard.current[Key.Escape].wasPressedThisFrame)
{
BackButtonPressed();
}
}
public void BackButtonPressed()
{
if (Application.CanStreamedLevelBeLoaded("Menu"))
{
SceneManager.LoadScene("Menu", LoadSceneMode.Single);
}
}
}
}