26 lines
599 B
C#
26 lines
599 B
C#
using Unity.FPS.Game;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
namespace Unity.FPS.UI
|
|
{
|
|
public class LoadSceneButton : MonoBehaviour
|
|
{
|
|
public string SceneName = "";
|
|
|
|
void Update()
|
|
{
|
|
if (EventSystem.current.currentSelectedGameObject == gameObject
|
|
&& Input.GetButtonDown(GameConstants.k_ButtonNameSubmit))
|
|
{
|
|
LoadTargetScene();
|
|
}
|
|
}
|
|
|
|
public void LoadTargetScene()
|
|
{
|
|
SceneManager.LoadScene(SceneName);
|
|
}
|
|
}
|
|
} |