| | |
| | | using UnityEngine; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class GA_SDK_Manager : MonoBehaviour |
| | | { |
| | |
| | | public void SDKInit(string channelId) |
| | | { |
| | | Debug.Log("Unity SDK init begin channelId:" + channelId); |
| | | TalkingDataGA.BackgroundSessionEnabled(); |
| | | TalkingDataGA.OnStart("B220F5C737384030947B202F19E32086", channelId);//appID是定死的 |
| | | Debug.Log("Unity SDK init completed "); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 使用自定义事件 |
| | | /// </summary> |
| | | /// <param name="actionId">事件名称</param> |
| | | /// <param name="dic">需要传递的值</param> |
| | | public void OnEvent(string actionId, Dictionary<string, object> dic) |
| | | { |
| | | //示例: |
| | | // Dictionary<string, object> dic = new Dictionary<string, object> |
| | | // { |
| | | // { "StringValue", "Pi" }, |
| | | // { "NumberValue", 3.14 } |
| | | // }; |
| | | // TalkingDataGA.OnEvent("action_id", dic); |
| | | |
| | | TalkingDataGA.OnEvent(actionId, dic); |
| | | } |
| | | |
| | | private void OnDestroy() |
| | | { |
| | | Debug.Log("onDestroy"); |