TargetPlatformUtilityΒΆ
-
class
TargetPlatformUtility: System.Object - A static utility class which returns the platform that
code is currently executing under.
This method allows you to access platform information at runtime. To change what code is built at compile-time based on the platform, use one of the following constants:
PLATFORM_ANDROIDPLATFORM_IOSPLATFORM_LINUXPLATFORM_MACOSPLATFORM_OUYAPLATFORM_PSMOBILEPLATFORM_WINDOWSPLATFORM_WINDOWS8PLATFORM_WINDOWSGLPLATFORM_WINDOWSPHONEPLATFORM_WEB
You can use these constants with the
#ifconstruct in C#. For example:
public void MyMethod() { #if PLATFORM_WINDOWS SomeWindowsSpecificCall() #elif PLATFORM_LINUX SomeLinuxSpecificCall() #endif }
-
public TargetPlatform
GetExecutingPlatform() Returns the platform that the game is currently executing on.
Returns: The T:Protogame.TargetPlatform value representing the platform that the game is currently executing on.