Skip to content

Commit

Permalink
feat: PrometeApp#LoadScene(Type)
Browse files Browse the repository at this point in the history
  • Loading branch information
EbiseLutica committed Jan 31, 2024
1 parent b1d39f5 commit c4d080d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Promete/PrometeApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,19 @@ public void LoadScene<TScene>() where TScene : Scene
currentScene.OnStart();
}

/// <summary>
/// シーンを読み込みます。現在読み込まれているシーンがある場合、そのシーンは破棄されます。
/// </summary>
/// <param name="typeScene">読み込むシーン。</param>
/// <exception cref="ArgumentException">指定したシーンが存在しない。</exception>
public void LoadScene(Type typeScene)
{
currentScene?.OnDestroy();

currentScene = provider.GetService(typeScene) as Scene ?? throw new ArgumentException($"The scene \"{typeScene}\" is not registered.");
currentScene.OnStart();
}

/// <summary>
/// 指定した Element を描画します。
/// </summary>
Expand Down

0 comments on commit c4d080d

Please sign in to comment.