52 lines
1.3 KiB
C#
Raw Normal View History

2024-12-20 15:56:02 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using SolarEngine;
using UnityEngine;
using UnityEngine.Serialization;
public class DotData : MonoBehaviour
{
public static DotData ins;
[FormerlySerializedAs("应用的appKey")] [SerializeField]
private string appKey;
[FormerlySerializedAs("账户的userCode")] [SerializeField]
private string userId;
private void Awake()
{
if (ins!=null)
{
Destroy(gameObject);
return;
}
ins = this;
DontDestroyOnLoad(gameObject);
SESDKBridge.Instance.prevInit(appKey);
InitParams data = new InitParams();
data.userId = userId;
data.appKey = appKey;
SESDKBridge.Instance.init(data);
}
public void InitReadyCallback(SESDKBridge.InitReadyCalllBack ReadyCalllBack1)
{
SESDKBridge.Instance.addInitReadyCallback(ReadyCalllBack1);
}
public void SendEvent(string key,string v)
{
var properties = new Dictionary<string, object>();
properties[key] = v;
SESDKBridge.Instance.track(key,properties);
}
public void SendEvent(string key, object v)
{
var properties = new Dictionary<string, object>();
properties[key] = v;
SESDKBridge.Instance.track(key,properties);
}
}