22 lines
582 B
C#
22 lines
582 B
C#
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
namespace NEG.UI.UnityUi.Buttons
|
|
{
|
|
[RequireComponent(typeof(BaseButton))]
|
|
public class ChangeSceneButton : ButtonReaction
|
|
{
|
|
[Header("Leave empty to use int value")] [SerializeField]
|
|
private string sceneName;
|
|
|
|
[SerializeField] private int sceneIndex;
|
|
|
|
protected override void OnClicked()
|
|
{
|
|
if (string.IsNullOrEmpty(sceneName))
|
|
SceneManager.LoadScene(sceneIndex);
|
|
else
|
|
SceneManager.LoadScene(sceneName);
|
|
}
|
|
}
|
|
} |