You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
599 B
26 lines
599 B
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);
|
|
}
|
|
}
|
|
}
|