-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added SceneApi (universal version of Manager.Scene)
- Loading branch information
1 parent
562937e
commit 65e9ed8
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
namespace KKAPI | ||
{ | ||
/// <summary> | ||
/// Game-agnostic version of Manager.Scene. It allows using the same code in all games without any #if directives. | ||
/// </summary> | ||
public static class SceneApi | ||
{ | ||
/// <summary> | ||
/// Get name of the currently loaded overlay scene (eg. exit game box, config, confirmation dialogs). | ||
/// </summary> | ||
public static string GetAddSceneName() | ||
{ | ||
#if HS2 || KKS | ||
return Manager.Scene.AddSceneName; | ||
#else | ||
return Manager.Scene.Instance.AddSceneName; | ||
#endif | ||
} | ||
|
||
/// <summary> | ||
/// Get name of the currently loaded game scene (eg. maker, h, adv). | ||
/// </summary> | ||
public static string GetLoadSceneName() | ||
{ | ||
#if HS2 || KKS | ||
return Manager.Scene.LoadSceneName; | ||
#else | ||
return Manager.Scene.Instance.LoadSceneName; | ||
#endif | ||
} | ||
|
||
/// <summary> | ||
/// True if loading screen is being displayed, or if screen is currently fading in or out. | ||
/// </summary> | ||
public static bool GetIsNowLoadingFade() | ||
{ | ||
#if HS2 || KKS | ||
return Manager.Scene.IsNowLoadingFade; | ||
#else | ||
return Manager.Scene.Instance.IsNowLoadingFade; | ||
#endif | ||
} | ||
|
||
/// <summary> | ||
/// True if loading screen is being displayed. | ||
/// </summary> | ||
public static bool GetIsNowLoading() | ||
{ | ||
#if HS2 || KKS | ||
return Manager.Scene.IsNowLoading; | ||
#else | ||
return Manager.Scene.Instance.IsNowLoading; | ||
#endif | ||
} | ||
|
||
/// <summary> | ||
/// True if screen is currently fading in or out. | ||
/// </summary> | ||
public static bool GetIsFadeNow() | ||
{ | ||
#if HS2 || KKS | ||
return Manager.Scene.IsFadeNow; | ||
#else | ||
return Manager.Scene.Instance.IsFadeNow; | ||
#endif | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters