Platform Utils
Introduction
A Blueprint Function Library class used for platform detection
API Reference
Functions
Name | Description | Params | Return |
---|---|---|---|
GetPlatform | Get the current platform | EPlatform The current platform |
|
IsInEditor | Is the build running inside the editor? | bool A boolean value indicating if the build is running inside the editor |
|
IsDesktop | Is the build running on a desktop platform? | bool A boolean value indicating if the build is running on a desktop platform |
|
IsWindows | Is the build running on Windows? | bool A boolean value indicating if the build is running on Windows |
|
IsMacOS | Is the build running on MacOS? | bool A boolean value indicating if the build is running on MacOS |
|
IsMacOSx86 | Is the build running on MacOS (x86)? | bool A boolean value indicating if the build is running on MacOS (x86) |
|
IsMacOSArm | Is the build running on MacOS (ARM)? | bool A boolean value indicating if the build is running on MacOS (ARM) |
|
IsLinux | Is the build running on Linux? | bool A boolean value indicating if the build is running on Linux |
|
IsConsole | Is the build running on a console platform? | bool A boolean value indicating if the build is running on a console platform |
|
IsConsoleMx | Is the build running on Console MX? | bool A boolean value indicating if the build is running on Console MX |
|
IsConsoleSp | Is the build running on Console SP? | bool A boolean value indicating if the build is running on Console SP |
|
IsConsoleNs | Is the build running on Console NS? | bool A boolean value indicating if the build is running on Console NS |
|
IsMobile | Is the build running on a mobile platform? | bool A boolean value indicating if the build is running on a mobile platform |
|
IsAndroid | Is the build running on Android? | bool A boolean value indicating if the build is running on Android |
|
IsAndroidx86 | Is the build running on Android (x86)? | bool A boolean value indicating if the build is running on Android (x86) |
|
IsAndroidx64 | Is the build running on Android (x64)? | bool A boolean value indicating if the build is running on Android (x64) |
|
IsAndroidArm | Is the build running on Android (ARM)? | bool A boolean value indicating if the build is running on Android (ARM) |
|
IsAndroidArm64 | Is the build running on Android (ARM64)? | bool A boolean value indicating if the build is running on Android (ARM64) |
|
IsIOS | Is the build running on iOS? | bool A boolean value indicating if the build is running on iOS |
Blueprint Usage
You can use the PlatformUtils
using Blueprints by adding one of the following nodes:
- Ultimate Starter Kit > Utils > Platform > Get Platform
- Ultimate Starter Kit > Utils > Platform > Is In Editor
- Ultimate Starter Kit > Utils > Platform > Is Desktop
- Ultimate Starter Kit > Utils > Platform > Is Windows
- Ultimate Starter Kit > Utils > Platform > Is MacOS
- Ultimate Starter Kit > Utils > Platform > Is MacOS (x86)
- Ultimate Starter Kit > Utils > Platform > Is MacOS (ARM)
- Ultimate Starter Kit > Utils > Platform > Is Linux
- Ultimate Starter Kit > Utils > Platform > Is Console
- Ultimate Starter Kit > Utils > Platform > Is Console MX
- Ultimate Starter Kit > Utils > Platform > Is Console SP
- Ultimate Starter Kit > Utils > Platform > Is Console NS
- Ultimate Starter Kit > Utils > Platform > Is Mobile
- Ultimate Starter Kit > Utils > Platform > Is Android
- Ultimate Starter Kit > Utils > Platform > Is Android (x86)
- Ultimate Starter Kit > Utils > Platform > Is Android (x64)
- Ultimate Starter Kit > Utils > Platform > Is Android (ARM)
- Ultimate Starter Kit > Utils > Platform > Is Android (ARM64)
- Ultimate Starter Kit > Utils > Platform > Is iOS
C++ Usage
Before you can use the plugin, you first need to enable the plugin in your Build.cs
file:
PublicDependencyModuleNames.Add("USK");
The PlatformUtils
can now be used in any of your C++ files:
#include "USK/Utils/PlatformUtils.h"
void ATestActor::Test()
{
EPlatform Platform = UPlatformUtils::GetPlatform();
bool IsInEditorValue = UPlatformUtils::IsInEditor();
bool IsDesktopValue = UPlatformUtils::IsDesktop();
bool IsWindowsValue = UPlatformUtils::IsWindows();
bool IsMacOSValue = UPlatformUtils::IsMacOS();
bool IsMacOSx86Value = UPlatformUtils::IsMacOSx86();
bool IsMacOSArmValue = UPlatformUtils::IsMacOSArm();
bool IsLinuxValue = UPlatformUtils::IsLinux();
bool IsConsoleValue = UPlatformUtils::IsConsole();
bool IsConsoleMxValue = UPlatformUtils::IsConsoleMx();
bool IsConsoleSpValue = UPlatformUtils::IsConsoleSp();
bool IsConsoleNsValue = UPlatformUtils::IsConsoleNs();
bool IsMobileValue = UPlatformUtils::IsMobile();
bool IsAndroidValue = UPlatformUtils::IsAndroid();
bool IsAndroidx86Value = UPlatformUtils::IsAndroidx86();
bool IsAndroidx64Value = UPlatformUtils::IsAndroidx64();
bool IsAndroidArmValue = UPlatformUtils::IsAndroidArm();
bool IsAndroidArm64Value = UPlatformUtils::IsAndroidArm64();
bool IsIOSValue = UPlatformUtils::IsIOS();
}