using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Runtime.InteropServices; using System.Threading.Tasks; public class OSDKHelper : MonoBehaviour { // jslib 声明 [DllImport("__Internal")] public static extern void SetConfig(string config); [DllImport("__Internal")] public static extern void TrackEvent(string eventName, string eventData); [DllImport("__Internal")] public static extern void ReportError(string eventName, string eventData); [DllImport("__Internal")] public static extern void OnRegister(string eventData); [DllImport("__Internal")] public static extern void OnPayment(string eventData); [DllImport("__Internal")] public static extern void OnShare(string eventData); [DllImport("__Internal")] public static extern void OnTutorialFinish(string eventData); [DllImport("__Internal")] public static extern string GetAttributionParams(); // osdk版本^2.2.6 [DllImport("__Internal")] public static extern void Login(string gameObjectName, string methodName); // [DllImport("__Internal")] public static extern void GetIpLocation(string gameObjectName, string methodName); [DllImport("__Internal")] public static extern void InitCloud(string config); [DllImport("__Internal")] public static extern void SetKv(string gameObjectName, string methodName, string key, string value); [DllImport("__Internal")] public static extern void GetKv(string gameObjectName, string methodName, string key); // 实验 [DllImport("__Internal")] public static extern void InitExperiment(string gameObjectName, string methodName, string config); // 获取实验组信息 [DllImport("__Internal")] public static extern string GetVariation(string experimentId); // 手动曝光实验 [DllImport("__Internal")] public static extern void TrackExposure(string experimentId); }