unity-atoms/Packages/SceneMgmt/Runtime/Actions/ChangeScene.cs
2019-10-02 17:49:06 +02:00

22 lines
527 B
C#

using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
namespace UnityAtoms.SceneMgmt
{
[UseIcon("atom-icon-purple")]
[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);
}
}
}