19 lines
543 B
C#
19 lines
543 B
C#
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.SceneManagement;
|
||
|
|
using UnityEngine.UI;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Game 씬의 뒤로가기 버튼에 자동으로 추가됩니다.
|
||
|
|
/// SceneBuilder가 Button에 이 컴포넌트를 달아 씬 이동을 처리합니다.
|
||
|
|
/// </summary>
|
||
|
|
[RequireComponent(typeof(Button))]
|
||
|
|
public class GameBackButton : MonoBehaviour
|
||
|
|
{
|
||
|
|
[SerializeField] private string targetScene = "SongSelect";
|
||
|
|
|
||
|
|
private void Start()
|
||
|
|
{
|
||
|
|
GetComponent<Button>().onClick.AddListener(() => SceneManager.LoadScene(targetScene));
|
||
|
|
}
|
||
|
|
}
|