Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to print a message about cross-platform deployment.
Unity
Debug.Log("Cross-platform deployment is [1] important for reaching more users.");
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing words that downplay importance like 'rarely' or 'never'.
✗ Incorrect
The phrase 'very important' correctly expresses the significance of cross-platform deployment.
2fill in blank
mediumComplete the code to check if the current platform is supported.
Unity
if (Application.platform == RuntimePlatform.[1]) { Debug.Log("Platform supported."); }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing editor platforms instead of player platforms.
✗ Incorrect
Android is a common target platform for cross-platform deployment in Unity.
3fill in blank
hardFix the error in the code that builds for multiple platforms.
Unity
BuildPipeline.BuildPlayer(scenes, path, BuildTarget.[1], BuildOptions.None);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing simulator or TV platforms that may not be supported for build.
✗ Incorrect
StandaloneWindows64 is a valid build target for Windows 64-bit platform in Unity.
4fill in blank
hardFill both blanks to create a dictionary mapping platforms to build paths.
Unity
var buildPaths = new Dictionary<BuildTarget, string> {
{ BuildTarget.[1], "Builds/Windows" },
{ BuildTarget.[2], "Builds/Android" }
}; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up platform names or using unsupported targets.
✗ Incorrect
StandaloneWindows64 and Android are correct build targets for Windows and Android builds respectively.
5fill in blank
hardFill all three blanks to filter scenes for a specific platform build.
Unity
var filteredScenes = scenes.Where(scene => scene.path.EndsWith(".unity") && scene.platform == BuildTarget.[1] && scene.enabled == [2]).Select(scene => scene.path).ToList(); if (filteredScenes.Count [3] 0) { Debug.Log("Scenes ready for build."); }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using false instead of true for enabled scenes.
Using less than or equal instead of greater than for count check.
✗ Incorrect
The code filters scenes for Windows platform, enabled scenes (true), and checks if count is greater than zero.