File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ public static class GameManagerExtension
2525 /// </summary>
2626 public class RunGameFromGameManagerContext
2727 {
28+ // Fields
29+ private bool ? _canUseGameLaunchApi ;
30+
2831 /// <summary>
2932 /// The game manager instance which handles the game launch.
3033 /// </summary>
@@ -49,6 +52,16 @@ public class RunGameFromGameManagerContext
4952 /// A delegate which is pointed to a callback to print game log while the game is running.
5053 /// </summary>
5154 public required PrintGameLog PrintGameLogCallback { get ; init ; }
55+
56+ /// <summary>
57+ /// Indicates whether the Game Launch API is supported on the plugin.
58+ /// </summary>
59+ public bool CanUseGameLaunchApi => _canUseGameLaunchApi ??= this . IsGameRunning ( out _ , out _ ) ;
60+
61+ /// <summary>
62+ /// Indicates whether the game is currently running.
63+ /// </summary>
64+ public bool IsGameRunning => CanUseGameLaunchApi && this . IsGameRunning ( out bool running , out _ ) && running ;
5265 }
5366
5467 /// <summary>
You can’t perform that action at this time.
0 commit comments