Commit a4f3577a authored by 王雪伟's avatar 王雪伟

修改

parent c1818644
......@@ -12,13 +12,10 @@ public class AdHttpUtil : MonoBehaviour
private static AdHttpUtil _instacne = null;
private string TEST_BASE_GAEM_URL = "http://feedapitest.zhangxinhulian.com/";//测试游戏域名
private string TEST_BASE_AD_URL = "https://bstest.zhangxinhulian.com/";//测试广告域名
private string PRODUCT_BASE_GAEM_URL = "https://feedapi.zhangxinhulian.com/";//正式游戏域名
private string PRODUCT_BASE_AD_URL = "https://bs.zhangxinhulian.com/";//正式广告域名
private string BaseGameUrl;
private string BaseAdUrl;
private int timeOut = 10;//超时时间
......@@ -64,12 +61,6 @@ public class AdHttpUtil : MonoBehaviour
StartCoroutine(GetRequest(BaseAdUrl, methodName, getParas, success, failed));
}
public void _Get<T>(string methodName, Dictionary<string, object> getParas, Action<T> success, Action<string, string> failed)
{
StartCoroutine(GetRequest(BaseGameUrl, methodName, getParas, success, failed));
}
private IEnumerator GetRequest<T>(string BaseURL, string methodName, Dictionary<string, object> getParas, Action<T> success, Action<string, string> failed)
{
string url = BaseURL + methodName + "?" + HttpUtil.addParams(getParas);
......
......@@ -2732,7 +2732,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 3}
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 40
m_FontStyle: 0
m_BestFit: 0
......
......@@ -25,6 +25,8 @@ public class AppConfig
public void InitProgect(bool isTest,bool IsShowLog,string appls)
{
Constant.Instance.IsTestNet = isTest;
//log日志
Debug.unityLogger.logEnabled = IsShowLog;
CallingNativeMethods.Instance.InitWxLogin();
Constant.Instance.ZXAD_VC = ZXADConfig.ZXAD_VC+"";
Constant.Instance.ZXAD_VN = ZXADConfig.ZXAD_VN;
......
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using AOT;
using UnityEngine;
public class UnityPhoneUtils
......@@ -27,6 +29,9 @@ public class UnityPhoneUtils
return activity;
}
private string device_iOS = "";
private string idfa_iOS = "";
private AndroidJavaObject phoneUtil;
private AndroidJavaObject GetPhoneUtil()
{
......@@ -164,6 +169,10 @@ public class UnityPhoneUtils
return carrier;
}
/// <summary>
/// 张哲注意了 实时改
/// </summary>
/// <returns></returns>
public string GetVC()
{
string vc = "";
......@@ -173,7 +182,8 @@ public class UnityPhoneUtils
#elif UNITY_ANDROID
vc = GetPhoneUtil().Call<int>("getAppVersionCode", GetActivity())+"";
#elif UNITY_IOS
vc = "";
vc = "1";
#endif
Debug.unityLogger.Log("GetVC " + vc);
return vc;
......@@ -213,6 +223,35 @@ public class UnityPhoneUtils
return aid;
}
#if UNITY_IOS
/// <summary>
/// 声明交互方法
/// </summary>
/// <param name="resultString"></param>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void ResultHandlerIDFA(string resultString);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void ResultHandlerDevice(string resultString);
/// <summary>
/// 接受交互值 在iOS代码中调用 resultHandlerIDFA("传值");
/// </summary>
/// <param name="resultStr"></param>
[MonoPInvokeCallback(typeof(ResultHandlerIDFA))]
static void resultHandlerIDFA(string resultStr)
{
Instance.idfa_iOS = resultStr;
}
[MonoPInvokeCallback(typeof(ResultHandlerDevice))]
static void resultHandlerDevice(string resultStr)
{
Instance.device_iOS = resultStr;
}
#endif
public string GetDevice()
{
string device = PlayerPrefs.GetString("user_device", "");
......@@ -224,7 +263,10 @@ public class UnityPhoneUtils
device = GetPhoneUtil().Call<string>("getAndroidID", GetActivity());
#elif UNITY_IOS
device = device_iOS;
#endif
PlayerPrefs.SetString("user_device", device);
}
Debug.unityLogger.Log("GetDevice " + device);
......@@ -273,15 +315,16 @@ public class UnityPhoneUtils
/// <returns></returns>
public string GetIDFA()
{
string idfa = "";
string idfaStr = "";
#if UNITY_EDITOR
Debug.unityLogger.Log("GetIDFA");
#elif UNITY_ANDROID
idfa ="";
idfaStr ="";
#elif UNITY_IOS
idfa = "";
idfaStr = idfa_iOS;
#endif
Debug.unityLogger.Log("GetIDFA " + idfa);
return idfa;
Debug.unityLogger.Log("GetIDFA " + idfaStr);
return idfaStr;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment