Adam Ramberg c3bc59259f More WIP
2020-03-02 02:26:06 +01:00

30 lines
709 B
C#

using UnityEngine;
using UnityEngine.SceneManagement;
using UnityAtoms.BaseAtoms;
namespace UnityAtoms.SceneMgmt
{
/// <summary>
/// Action to change scene.
/// </summary>
[EditorIcon("atom-icon-purple")]
[CreateAssetMenu(menuName = "Unity Atoms/Actions/Scene Management/Change Scene")]
public sealed class ChangeScene : VoidAction
{
/// <summary>
/// Scene to change to.
/// </summary>
[SerializeField]
private StringReference _sceneName = null;
/// <summary>
/// Change the scene.
/// </summary>
public override void Do()
{
SceneManager.LoadScene(_sceneName.Value);
}
}
}