Legacy Documentation: Version 5.2
Create Game Script
Play To Validate

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.

Create Game Script
Play To Validate
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961