unity-atoms/Source/Actions/SceneManagement/ChangeScene.cs
2019-05-29 18:52:27 +02:00

21 lines
483 B
C#

using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "Unity Atoms/Actions/Scene Management/Change Scene")]
public sealed class ChangeScene : VoidAction
{
[FormerlySerializedAs("SceneName")]
[SerializeField]
private StringReference _sceneName;
public override void Do()
{
SceneManager.LoadScene(_sceneName.Value);
}
}
}