| | |
| | | Quick = 10, //quick |
| | | Hy = 15, //欢游 |
| | | Gaore = 20, // 20-高热 - 硬核渠道 |
| | | Qudong = 21, //21-趣动 - 海外渠道 |
| | | } |
| | | |
| | | //权限申请回调 |
| | |
| | | SendMessageToSDK(m_Json); |
| | | } |
| | | |
| | | //评分 |
| | | public void GoToReview() |
| | | { |
| | | m_Json.Clear(); |
| | | m_Json["code"] = CodeU2A.GoToReview; |
| | | SendMessageToSDK(m_Json); |
| | | } |
| | | #endregion |
| | | |
| | | #region 处理与SDK交互的底层方法 |
| | |
| | | |
| | | private void SendMessageToSDK(JsonData json) |
| | | { |
| | | |
| | | #if !UNITY_EDITOR |
| | | #if UNITY_ANDROID |
| | | if (VersionConfig.Get().appID == "sghy") |
| | | { |
| | | using (AndroidJavaClass H2engineSDK = new AndroidJavaClass("com.xssg.sdk.UnityMsgHandler")) |
| | | { |
| | | H2engineSDK.CallStatic("onUnityMessage", json.ToJson()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | using (AndroidJavaClass H2engineSDK = new AndroidJavaClass("com.wgyx.sdk.UnityMsgHandler")) |
| | | { |
| | | H2engineSDK.CallStatic("onUnityMessage", json.ToJson()); |
| | | } |
| | | } |
| | | #elif UNITY_IOS |
| | | AotSdkUtility.IOSUniyMessageHandle(json.ToJson()); |
| | |
| | | else if (_channelPlatform.Equals("gaore")) |
| | | { |
| | | ChannelPlatform = E_ChannelPlatform.Gaore; |
| | | } |
| | | else if (_channelPlatform.Equals("sghy")) |
| | | { |
| | | ChannelPlatform = E_ChannelPlatform.Qudong; |
| | | } |
| | | |
| | | } |
| | |
| | | public const int DownloadStart = 110; |
| | | public const int DownloadEnd = 111; |
| | | public const int ShareToFaceBook = 112; |
| | | public const int GoToPingfen = 113; //前往评分 和 GotoShop = 121; 有区别 |
| | | public const int GoToReview = 113; //前往评分 和 GotoShop = 121; 有区别 |
| | | public const int ShowAccountView = 114; |
| | | public const int RoleLoginOut = 119; //角色登出 |
| | | public const int FansHouse = 120; //粉丝屋 论坛等 |
| | | public const int GotoShop = 121; //前往商店 |
| | | // public const int FansHouse = 120; //粉丝屋 论坛等 |
| | | // public const int GotoShop = 121; //前往商店 |
| | | public const int TrackEvent = 122; //自定义事件 |
| | | public const int PlayAds = 123; //播放广告 |
| | | /** |
| | |
| | | } |
| | | } |
| | | } |
| | | //#if !(UNITY_IOS || UNITY_IPHONE) |
| | | // string storeOrderInfo = orderInfo.StoreOrderInfo; |
| | | //#else |
| | | // string storeOrderInfo = orderInfo.StoreOrderInfo2; |
| | | //#endif |
| | | #if !(UNITY_IOS || UNITY_IPHONE) |
| | | string storeOrderInfo = orderInfo.StoreOrderInfo; |
| | | #else |
| | | string storeOrderInfo = orderInfo.StoreOrderInfo2; |
| | | #endif |
| | | |
| | | #if UNITY_EDITOR |
| | | Debug.LogFormat("充值: {0}-{1}-{2}", title, money, cpInfo); |
| | |
| | | m_Json["orderId"] = DateTime.Now.ToString("yyyyMMddHHmmss") + UnityEngine.Random.Range(100000, 999999).ToString(); |
| | | m_Json["mount"] = money.ToString(); |
| | | m_Json["cpInfo"] = cpInfo; |
| | | //m_Json["storeOrderInfo"] = storeOrderInfo; |
| | | m_Json["storeOrderInfo"] = storeOrderInfo; |
| | | m_Json["title"] = title; |
| | | m_Json["roleID"] = PlayerDatas.Instance.baseData.PlayerID; |
| | | m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName; |
| | |
| | | } |
| | | |
| | | |
| | | //事件名称 由运营提供 |
| | | //必传的2个事件, |
| | | // "tutorial_complete" 完成新手引导。 |
| | | // "AchieveLevel_40" 到达40级 |
| | | void SendOverSeaTraceEvent(string eventName, string value = "") |
| | | { |
| | | //海外趣动版本,如有其他海外不同需区分 |
| | | m_Json.Clear(); |
| | | m_Json["code"] = CodeU2A.TrackEvent; |
| | | m_Json["eventName"] = eventName; |
| | | m_Json["value"] = value; |
| | | |
| | | SendMessageToSDK(m_Json); |
| | | } |
| | | |
| | | |
| | | //高热版本 |
| | | void SendGaoreEvent(int dataType, string pageType = "无", string pageName = "无", string pageItemId = "无", |
| | | int money = 0, string orderID = "") |
| | | { |
| | |
| | | public void SendTraceEvent(int dataType, string pageType = "无", string pageName = "无", string pageItemId = "无", |
| | | int money = 0, string orderID = "") |
| | | { |
| | | var appID = VersionConfig.Get().appId; |
| | | if (VersionConfig.Get().appId == "ryzj") |
| | | { |
| | | SendGaoreEvent(dataType, pageType, pageName, pageItemId, money, orderID); |
| | | return; |
| | | } |
| | | else if (appID == "sghy") |
| | | { |
| | | SendOverSeaTraceEvent("tutorial_complete"); |
| | | } |
| | | } |
| | | |
| | | public void RoleLevelUp() |
| | | { |
| | | if (VersionConfig.Get().appId == "ryzj") |
| | | var appID = VersionConfig.Get().appId; |
| | | if (appID == "ryzj") |
| | | { |
| | | SendGaoreEvent(4); |
| | | return; |
| | | } |
| | | else if (appID == "sghy" && PlayerDatas.Instance.baseData.LV == 40) |
| | | { |
| | | SendOverSeaTraceEvent("AchieveLevel_40"); |
| | | } |
| | | |
| | | |
| | | m_Json.Clear(); |