Complete the code to check if the current platform is Android.
if (Application.platform == [1]) { Debug.Log("Running on Android"); }
Use RuntimePlatform.Android to check if the app runs on Android.
Complete the code to execute platform-specific code for iOS.
#if [1] Debug.Log("Running on iOS"); #endif
UNITY_ANDROID instead of UNITY_IOS.The preprocessor directive UNITY_IOS is used for iOS platform-specific compilation.
Fix the error in the code to correctly detect if the platform is Windows standalone.
if (Application.platform == [1]) { Debug.Log("Running on Windows Standalone"); }
RuntimePlatform.WindowsPlayer is the correct enum for Windows standalone builds.
Fill both blanks to create a dictionary with platform names as keys and their build symbols as values.
var platformSymbols = new Dictionary<string, string> {
{"Android", "[1]"},
{"iOS", "[2]"}
};Use UNITY_ANDROID for Android and UNITY_IOS for iOS build symbols.
Fill all three blanks to create a platform check that logs a message for Android, iOS, or Windows.
switch (Application.platform) {
case [1]:
Debug.Log("Android platform");
break;
case [2]:
Debug.Log("iOS platform");
break;
case [3]:
Debug.Log("Windows platform");
break;
}Use RuntimePlatform.Android, RuntimePlatform.IPhonePlayer, and RuntimePlatform.WindowsPlayer for platform checks.