﻿namespace AsmodeeDigital.Common.Plugin.Manager.Scene
{
    /// <summary>
    /// Unity implementation of scene manager
    /// </summary>
    public class SceneManagerUnity: ISceneManager
    {
        /// <summary>
        /// Load the scene. The new scene replace the old one
        /// </summary>
        /// <param name="sceneName">Scene name</param>
        public void LoadScene(string sceneName)
        {
            UnityEngine.SceneManagement.SceneManager.LoadScene(sceneName);
        }

        /// <summary>
        /// Check if the current scene has the same name as the one in parameter
        /// </summary>
        /// <param name="sceneName">Scene name</param>
        /// <returns></returns>
        public bool IsCurrentScene(string sceneName)
        {
            return UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == sceneName;
        }
    }
}
