Legacy Documentation: Version 2018.1 (Go to current version)
Create Game Script
Play To Validate
Other Versions

Attach Game Script

The UnityAnalyticsIntegration script can be attached to any GameObject in any Scene in your game to initialize the Unity Analytics SDK. We recommend you attach the script to a GameObject in the first Scene of your game to ensure you begin capturing as much user engagement data as possible.

In this example, we will attach the script to MainCamera. First, locate and select “Main Camera” in the Hierarchy tab on the left hand side of the Editor.

Drag your script from the Projects tab and drop it on the Main Camera GameObject. In the Inspector window, with Main Camera selected, you should see that the script was assigned to the Main Camera as a Component.

Note: You can also add a script to a GameObject by selecting the GameObject in your Hierarchy and adding the desired script Component to it in the Inspector.

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答