リポジトリ
使用例
using Kogane;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Example : MonoBehaviour
{
private SceneLoadHistory m_history;
private void Awake()
{
var historyCount = 5;
m_history = new SceneLoadHistory( historyCount );
}
private void OnDestroy()
{
m_history.Dispose();
}
private void Update()
{
if ( Input.GetKeyDown( KeyCode.Alpha1 ) )
{
SceneManager.LoadScene( "Example1", LoadSceneMode.Additive );
}
if ( Input.GetKeyDown( KeyCode.Alpha2 ) )
{
SceneManager.LoadScene( "Example2", LoadSceneMode.Additive );
}
if ( Input.GetKeyDown( KeyCode.Alpha3 ) )
{
SceneManager.LoadScene( "Example3", LoadSceneMode.Additive );
}
}
private void OnGUI()
{
foreach ( var x in m_history )
{
GUILayout.Label( $"{x.Path},{x.LoadSceneMode}" );
}
}
}