Commit 269f2a58 authored by 王雪伟's avatar 王雪伟

修复设置actionName为null 和 上报加入公共参数

parent cd52f889
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using System; using System;
using Tencent.GDT; using Tencent.GDT;
using System.Runtime.InteropServices;
public class AdManager public class AdManager
{ {
...@@ -40,7 +41,8 @@ public class AdManager ...@@ -40,7 +41,8 @@ public class AdManager
return activity; return activity;
} }
[DllImport("__Internal")]
public static extern void InitCSJSDK(string appId); // ios初始化穿山甲SDK
private bool IsInitAd = false; private bool IsInitAd = false;
...@@ -55,16 +57,20 @@ public class AdManager ...@@ -55,16 +57,20 @@ public class AdManager
//paras.Clear(); //paras.Clear();
//paras.Add("pkg", "com.ym.xynt"); //paras.Add("pkg", "com.ym.xynt");
//获取广告配置 //获取广告配置
Dictionary<string, object> paras = new Dictionary<string, object>(); HttpTool.Instance._GetAD(AdConfigUrl, null, new Action<List<AdIdConfig>>((AdConfigList) =>
HttpTool.Instance._GetAD(AdConfigUrl, paras, new Action<List<AdIdConfig>>((AdConfigList) =>
{ {
foreach (AdIdConfig id in AdConfigList) foreach (AdIdConfig id in AdConfigList)
{ {
switch (id.adPlatform) switch (id.adPlatform)
{ {
//初始化穿山甲广告ID
case ZXADConfig.PLANTFORM_AD_TT: case ZXADConfig.PLANTFORM_AD_TT:
#if UNITY_ANDROID
AndroidJavaClass jc = new AndroidJavaClass("com.unity.adcommon.unity.TTADManager"); AndroidJavaClass jc = new AndroidJavaClass("com.unity.adcommon.unity.TTADManager");
jc.CallStatic("init", id.codeAppId); jc.CallStatic("init", id.codeAppId);
#elif UNITY_IOS
InitCSJSDK(id.codeAppId);
#endif
break; break;
case ZXADConfig.PLANTFORM_AD_GDT: case ZXADConfig.PLANTFORM_AD_GDT:
if (id.codeAppId != null && id.codeAppId != "") if (id.codeAppId != null && id.codeAppId != "")
...@@ -170,8 +176,14 @@ public class AdManager ...@@ -170,8 +176,14 @@ public class AdManager
switch (entity.adPlatform) switch (entity.adPlatform)
{ {
case ZXADConfig.PLANTFORM_AD_TT: case ZXADConfig.PLANTFORM_AD_TT:
#if UNITY_ANDROID
//加载穿山甲开屏广告 //加载穿山甲开屏广告
CSJSplshADUtils.Instance.LoadSplshAd(entity, GetActivity(), GetSplashAdManager(), listener, callback); CSJSplshADUtils.Instance.LoadSplshAd(entity, GetActivity(), GetSplashAdManager(), listener, callback);
#elif UNITY_IOS
//加载穿山甲开屏广告
CSJSplshADUtils.Instance.LoadSplshAd(entity,null, null, listener, callback);
#endif
break; break;
case ZXADConfig.PLANTFORM_AD_GDT: case ZXADConfig.PLANTFORM_AD_GDT:
//广点通开屏广告 //广点通开屏广告
...@@ -275,9 +287,9 @@ public class AdManager ...@@ -275,9 +287,9 @@ public class AdManager
public void ShowCacheBannerAd(string slotName,string actionName) public void ShowCacheBannerAd(string slotName,string actionName)
{ {
AdEntity entity = ZXADConfig.Instance.GetAdCache(slotName, ""); AdEntity entity = ZXADConfig.Instance.GetAdCache(slotName, "");
entity.actionName = actionName;
if (entity != null) if (entity != null)
{ {
entity.actionName = actionName;
ZXADConfig.Instance.RemoveAdCache(slotName, ""); ZXADConfig.Instance.RemoveAdCache(slotName, "");
mShowCacheBannerAdPlatform(entity, new Action<bool>((bl) => mShowCacheBannerAdPlatform(entity, new Action<bool>((bl) =>
{ {
...@@ -293,6 +305,7 @@ public class AdManager ...@@ -293,6 +305,7 @@ public class AdManager
} }
else else
{ {
LoadCacheBannerAd(slotName);
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "展示Banner失败 缓存的信息为null"); Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "展示Banner失败 缓存的信息为null");
} }
} }
...@@ -350,7 +363,7 @@ public class AdManager ...@@ -350,7 +363,7 @@ public class AdManager
/// <summary> /// <summary>
/// 根据广告List开始加载插屏缓存 /// 根据广告List开始加载大图缓存
/// </summary> /// </summary>
private Action<bool> FeedAdCallBack; private Action<bool> FeedAdCallBack;
private void mLoadFeedCacheAd(string sloatName, List<AdEntity> adList) private void mLoadFeedCacheAd(string sloatName, List<AdEntity> adList)
...@@ -409,9 +422,9 @@ public class AdManager ...@@ -409,9 +422,9 @@ public class AdManager
public void ShowCacheFeedAd(string slotName,string actionName) public void ShowCacheFeedAd(string slotName,string actionName)
{ {
AdEntity entity = ZXADConfig.Instance.GetAdCache(slotName, ""); AdEntity entity = ZXADConfig.Instance.GetAdCache(slotName, "");
entity.actionName = actionName;
if (entity != null) if (entity != null)
{ {
entity.actionName = actionName;
ZXADConfig.Instance.RemoveAdCache(slotName, ""); ZXADConfig.Instance.RemoveAdCache(slotName, "");
mShowCacheFeedAdPlatform(entity, new Action<bool>((bl) => mShowCacheFeedAdPlatform(entity, new Action<bool>((bl) =>
{ {
...@@ -427,6 +440,7 @@ public class AdManager ...@@ -427,6 +440,7 @@ public class AdManager
} }
else else
{ {
LoadCacheFeedAd(slotName);
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "展示大图失败 缓存的信息为null"); Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "展示大图失败 缓存的信息为null");
} }
} }
...@@ -543,25 +557,26 @@ public class AdManager ...@@ -543,25 +557,26 @@ public class AdManager
public void PlayCacheInterstitialAd(string slotName,string actionName) public void PlayCacheInterstitialAd(string slotName,string actionName)
{ {
AdEntity entity = ZXADConfig.Instance.GetAdCache(slotName,""); AdEntity entity = ZXADConfig.Instance.GetAdCache(slotName,"");
entity.actionName = actionName;
if (entity != null) if (entity != null)
{ {
entity.actionName = actionName;
ZXADConfig.Instance.RemoveAdCache(slotName, ""); ZXADConfig.Instance.RemoveAdCache(slotName, "");
mPlayCacheInterstitialAdPlatform(entity, new Action<bool>((bl) => mPlayCacheInterstitialAdPlatform(entity, new Action<bool>((bl) =>
{ {
if (bl) if (bl)
{ {
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "播放屏视频成功 " + entity.adPlatform + " CodeId" + entity.codeId); Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "播放屏视频成功 " + entity.adPlatform + " CodeId" + entity.codeId);
} }
else else
{ {
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "播放屏视频失败 " + entity.adPlatform + " CodeId" + entity.codeId); Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "播放屏视频失败 " + entity.adPlatform + " CodeId" + entity.codeId);
} }
})); }));
} }
else else
{ {
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "播放全屏视频失败 缓存的信息为null"); LoadCacheInterstitialAd(slotName);
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "播放插屏视频失败 缓存的信息为null");
} }
} }
...@@ -789,9 +804,9 @@ public class AdManager ...@@ -789,9 +804,9 @@ public class AdManager
entity = entityB; entity = entityB;
ZXADConfig.Instance.RemoveAdCache(slotName, "B"); ZXADConfig.Instance.RemoveAdCache(slotName, "B");
} }
entity.actionName = actionName;
if (entity != null) if (entity != null)
{ {
entity.actionName = actionName;
mPlayCacheFSVodeoAdPlatform(entity, listener, new Action<bool>((bl) => mPlayCacheFSVodeoAdPlatform(entity, listener, new Action<bool>((bl) =>
{ {
if (bl) if (bl)
...@@ -806,6 +821,8 @@ public class AdManager ...@@ -806,6 +821,8 @@ public class AdManager
} }
else else
{ {
LoadCacheFSVideoAd(slotName);
listener.onError("播放全屏视频失败 缓存的信息为null");
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "播放全屏视频失败 缓存的信息为null"); Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "播放全屏视频失败 缓存的信息为null");
} }
} }
...@@ -897,14 +914,12 @@ public class AdManager ...@@ -897,14 +914,12 @@ public class AdManager
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "激励视频A组没有数据"); Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "激励视频A组没有数据");
return; return;
} }
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "正序的第一个广告ID" + adList[0].codeId);
if (IsFirstLoadRewardAd) if (IsFirstLoadRewardAd)
{ {
//第一次预加载 A组进行逆序加载 //第一次预加载 A组进行逆序加载
IsFirstLoadRewardAd = false; IsFirstLoadRewardAd = false;
adList.Reverse(); adList.Reverse();
} }
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "反序的第一个广告ID" + adList[0].codeId);
List<AdEntity> totalEntityList = adList; List<AdEntity> totalEntityList = adList;
AdEntity entity = totalEntityList[0]; AdEntity entity = totalEntityList[0];
...@@ -1046,9 +1061,9 @@ public class AdManager ...@@ -1046,9 +1061,9 @@ public class AdManager
ZXADConfig.Instance.RemoveAdCache(slotName, "B"); ZXADConfig.Instance.RemoveAdCache(slotName, "B");
} }
entity.actionName = actionName;
if (entity != null) if (entity != null)
{ {
entity.actionName = actionName;
mPlayCacheRewardVodeoAdPlatform(entity, listener, new Action<bool>((bl) => mPlayCacheRewardVodeoAdPlatform(entity, listener, new Action<bool>((bl) =>
{ {
...@@ -1059,14 +1074,15 @@ public class AdManager ...@@ -1059,14 +1074,15 @@ public class AdManager
else else
{ {
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, entity.codeGroup + "播放激励视频失败 " + entity.adPlatform + " CodeId" + entity.codeId); Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, entity.codeGroup + "播放激励视频失败 " + entity.adPlatform + " CodeId" + entity.codeId);
//listener.onError(entity.codeGroup + "播放激励视频失败 " + entity.adPlatform + " CodeId" + entity.codeId);
} }
})); }));
} }
else else
{ {
LoadCacheRewardVideoAd(slotName);
listener.onError("播放激励视频失败 缓存的信息为null");
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "播放激励视频失败 缓存的信息为null"); Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "播放激励视频失败 缓存的信息为null");
} }
} }
......
...@@ -135,21 +135,25 @@ public class CSJBannerUtil ...@@ -135,21 +135,25 @@ public class CSJBannerUtil
public void OnExpressAdLoad(List<ExpressAd> ads) public void OnExpressAdLoad(List<ExpressAd> ads)
{ {
#if UNITY_ANDROID
EventUtils.onEventPullSuccess(entity); EventUtils.onEventPullSuccess(entity);
IEnumerator<ExpressAd> enumerator = ads.GetEnumerator(); IEnumerator<ExpressAd> enumerator = ads.GetEnumerator();
if (enumerator.MoveNext()) if (enumerator.MoveNext())
{ {
callback(true);
bannerAdCacheListAndroid.Enqueue(enumerator.Current); bannerAdCacheListAndroid.Enqueue(enumerator.Current);
callback(true);
} }
#endif
} }
#if UNITY_IOS #if UNITY_IOS
public void OnExpressBannerAdLoad(ExpressBannerAd ad) public void OnExpressBannerAdLoad(ExpressBannerAd ad)
{ {
EventUtils.onEventPullSuccess(entity); EventUtils.onEventPullSuccess(entity);
callback(true);
Debug.Log("OnExpressBannerAdLoad"); Debug.Log("OnExpressBannerAdLoad");
bannerAdCacheListIOS.Enqueue(ad); bannerAdCacheListIOS.Enqueue(ad);
callback(true);
} }
public void OnExpressInterstitialAdLoad(ExpressInterstitialAd ad) public void OnExpressInterstitialAdLoad(ExpressInterstitialAd ad)
...@@ -186,16 +190,17 @@ public class CSJBannerUtil ...@@ -186,16 +190,17 @@ public class CSJBannerUtil
public void OnAdShow(ExpressAd ad) public void OnAdShow(ExpressAd ad)
{ {
Debug.Log("express OnAdShow,type:" + type);
EventUtils.onEventShowSuccess(entity); EventUtils.onEventShowSuccess(entity);
callback(true); callback(true);
Debug.Log("express OnAdShow,type:" + type);
} }
public void OnAdViewRenderError(ExpressAd ad, int code, string message) public void OnAdViewRenderError(ExpressAd ad, int code, string message)
{ {
Debug.Log("express OnAdViewRenderError,type:" + type);
EventUtils.onEventShowFail(entity); EventUtils.onEventShowFail(entity);
callback(false); callback(false);
Debug.Log("express OnAdViewRenderError,type:" + type);
} }
public void OnAdViewRenderSucc(ExpressAd ad, float width, float height) public void OnAdViewRenderSucc(ExpressAd ad, float width, float height)
......
...@@ -125,8 +125,8 @@ public class CSJFeedUtil : MonoBehaviour ...@@ -125,8 +125,8 @@ public class CSJFeedUtil : MonoBehaviour
IEnumerator<ExpressAd> enumerator = ads.GetEnumerator(); IEnumerator<ExpressAd> enumerator = ads.GetEnumerator();
if (enumerator.MoveNext()) if (enumerator.MoveNext())
{ {
callback(true);
feedAdCacheList.Enqueue(enumerator.Current); feedAdCacheList.Enqueue(enumerator.Current);
callback(true);
} }
} }
#if UNITY_IOS #if UNITY_IOS
...@@ -168,16 +168,18 @@ public class CSJFeedUtil : MonoBehaviour ...@@ -168,16 +168,18 @@ public class CSJFeedUtil : MonoBehaviour
public void OnAdShow(ExpressAd ad) public void OnAdShow(ExpressAd ad)
{ {
Debug.Log("express OnAdShow,type:" + type);
EventUtils.onEventShowSuccess(entity); EventUtils.onEventShowSuccess(entity);
callback(true); callback(true);
Debug.Log("express OnAdShow,type:" + type);
} }
public void OnAdViewRenderError(ExpressAd ad, int code, string message) public void OnAdViewRenderError(ExpressAd ad, int code, string message)
{ {
Debug.Log("express OnAdViewRenderError,type:" + type);
EventUtils.onEventShowFail(entity); EventUtils.onEventShowFail(entity);
callback(false); callback(false);
Debug.Log("express OnAdViewRenderError,type:" + type);
} }
public void OnAdViewRenderSucc(ExpressAd ad, float width, float height) public void OnAdViewRenderSucc(ExpressAd ad, float width, float height)
...@@ -186,8 +188,9 @@ public class CSJFeedUtil : MonoBehaviour ...@@ -186,8 +188,9 @@ public class CSJFeedUtil : MonoBehaviour
} }
public void OnAdClose(ExpressAd ad) public void OnAdClose(ExpressAd ad)
{ {
EventUtils.onEventAdComplete(entity);
Debug.Log("express OnAdClose,type:" + type); Debug.Log("express OnAdClose,type:" + type);
EventUtils.onEventAdComplete(entity);
} }
} }
......
...@@ -59,7 +59,7 @@ public class CSJFullScreenUtil : MonoBehaviour ...@@ -59,7 +59,7 @@ public class CSJFullScreenUtil : MonoBehaviour
.SetOrientation(AdOrientation.Horizontal) .SetOrientation(AdOrientation.Horizontal)
.Build(); .Build();
#if UNITY_IOS #if UNITY_IOS
this.AdNative.LoadExpressFullScreenVideoAd(adSlot, new FullScreenVideoAdListener(this, callback)); this.AdNative.LoadExpressFullScreenVideoAd(adSlot, new FullScreenVideoAdListener(this,entity, callback));
#else #else
this.AdNative.LoadFullScreenVideoAd(adSlot, new FullScreenVideoAdListener(this, entity, callback)); this.AdNative.LoadFullScreenVideoAd(adSlot, new FullScreenVideoAdListener(this, entity, callback));
#endif #endif
...@@ -71,7 +71,7 @@ public class CSJFullScreenUtil : MonoBehaviour ...@@ -71,7 +71,7 @@ public class CSJFullScreenUtil : MonoBehaviour
ExpressFullScreenVideoAd fsAd = GetFSVideoAdForIOS(entity.codeGroup+entity.codeId); ExpressFullScreenVideoAd fsAd = GetFSVideoAdForIOS(entity.codeGroup+entity.codeId);
if (fsAd!=null) if (fsAd!=null)
{ {
fsAd.SetFullScreenVideoAdInteractionListener(new FullScreenAdInteractionListener(listener, callback)); fsAd.SetFullScreenVideoAdInteractionListener(new FullScreenAdInteractionListener(entity,listener, callback));
fsAd.ShowFullScreenVideoAd(); fsAd.ShowFullScreenVideoAd();
} }
else else
...@@ -163,8 +163,8 @@ public class CSJFullScreenUtil : MonoBehaviour ...@@ -163,8 +163,8 @@ public class CSJFullScreenUtil : MonoBehaviour
public void OnAdShow() public void OnAdShow()
{ {
EventUtils.onEventShowSuccess(entity); EventUtils.onEventShowSuccess(entity);
callback(true);
listener.onAdShow(); listener.onAdShow();
callback(true);
} }
public void OnAdVideoBarClick() public void OnAdVideoBarClick()
...@@ -187,8 +187,9 @@ public class CSJFullScreenUtil : MonoBehaviour ...@@ -187,8 +187,9 @@ public class CSJFullScreenUtil : MonoBehaviour
public void OnVideoError() public void OnVideoError()
{ {
EventUtils.onEventShowFail(entity); EventUtils.onEventShowFail(entity);
callback(false);
listener.onError("CSJ 全屏视频播放错误"); listener.onError("CSJ 全屏视频播放错误");
callback(false);
} }
} }
......
...@@ -105,8 +105,9 @@ public class CSJInterstitialUtil ...@@ -105,8 +105,9 @@ public class CSJInterstitialUtil
} }
else else
{ {
callback(false);
Debug.Log("CSJ 插屏广告没有缓存数据了"); Debug.Log("CSJ 插屏广告没有缓存数据了");
callback(false);
} }
#endif #endif
} }
...@@ -130,13 +131,20 @@ public class CSJInterstitialUtil ...@@ -130,13 +131,20 @@ public class CSJInterstitialUtil
public void OnExpressAdLoad(List<ExpressAd> ads) public void OnExpressAdLoad(List<ExpressAd> ads)
{ {
#if UNITY_ANDROID
EventUtils.onEventPullSuccess(entity); EventUtils.onEventPullSuccess(entity);
IEnumerator<ExpressAd> enumerator = ads.GetEnumerator(); IEnumerator<ExpressAd> enumerator = ads.GetEnumerator();
if (enumerator.MoveNext()) if (enumerator.MoveNext())
{ {
callback(true);
interstitialAdCacheListAndroid.Enqueue(enumerator.Current); interstitialAdCacheListAndroid.Enqueue(enumerator.Current);
callback(true);
} }
#endif
} }
#if UNITY_IOS #if UNITY_IOS
public void OnExpressBannerAdLoad(ExpressBannerAd ad) public void OnExpressBannerAdLoad(ExpressBannerAd ad)
...@@ -147,8 +155,9 @@ public class CSJInterstitialUtil ...@@ -147,8 +155,9 @@ public class CSJInterstitialUtil
public void OnExpressInterstitialAdLoad(ExpressInterstitialAd ad) public void OnExpressInterstitialAdLoad(ExpressInterstitialAd ad)
{ {
EventUtils.onEventPullSuccess(entity); EventUtils.onEventPullSuccess(entity);
callback(true);
interstitialAdCacheListIOS.Enqueue(ad); interstitialAdCacheListIOS.Enqueue(ad);
callback(true);
} }
#else #else
#endif #endif
......
...@@ -121,8 +121,8 @@ public class CSJRewardUtil ...@@ -121,8 +121,8 @@ public class CSJRewardUtil
public void OnError(int code, string message) public void OnError(int code, string message)
{ {
EventUtils.onEventPullFail(entity, code.ToString(),message); EventUtils.onEventPullFail(entity, code.ToString(),message);
callback(false);
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, entity.adPlatform + " 激励视频 Error Group" + entity.codeGroup + " Code " + code + " msg" + message); Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, entity.adPlatform + " 激励视频 Error Group" + entity.codeGroup + " Code " + code + " msg" + message);
callback(false);
} }
public void OnRewardVideoAdLoad(RewardVideoAd ad) public void OnRewardVideoAdLoad(RewardVideoAd ad)
...@@ -181,9 +181,10 @@ public class CSJRewardUtil ...@@ -181,9 +181,10 @@ public class CSJRewardUtil
{ {
EventUtils.onEventShowSuccess(entity); EventUtils.onEventShowSuccess(entity);
Debug.Log("rewardVideoAd show"); Debug.Log("rewardVideoAd show");
listener.onAdShow();
callback(true); callback(true);
//this.cjsAd.rewardAd = null; //this.cjsAd.rewardAd = null;
listener.onAdShow();
} }
public void OnAdVideoBarClick() public void OnAdVideoBarClick()
...@@ -214,8 +215,9 @@ public class CSJRewardUtil ...@@ -214,8 +215,9 @@ public class CSJRewardUtil
{ {
EventUtils.onEventShowFail(entity); EventUtils.onEventShowFail(entity);
Debug.Log("rewardVideoAd error"); Debug.Log("rewardVideoAd error");
callback(false);
listener.onError("CSJ RewardAd Error"); listener.onError("CSJ RewardAd Error");
callback(false);
} }
public void OnRewardVerify(bool rewardVerify, int rewardAmount, string rewardName) public void OnRewardVerify(bool rewardVerify, int rewardAmount, string rewardName)
......
...@@ -39,12 +39,12 @@ public class AdDemo : MonoBehaviour ...@@ -39,12 +39,12 @@ public class AdDemo : MonoBehaviour
public void onAdClose() public void onAdClose()
{ {
this.demo.RewardAdResult.text = "Reward onAdClose"; this.demo.RewardAdResult.text = "Reward onAdClose";
//AdManager.Instance.LoadCacheRewardVideoAd("video");
} }
public void onAdShow() public void onAdShow()
{ {
this.demo.RewardAdResult.text = "Reward onAdShow"; this.demo.RewardAdResult.text = "Reward onAdShow";
AdManager.Instance.LoadCacheRewardVideoAd("video");
} }
public void onAdVideoBarClick() public void onAdVideoBarClick()
......
...@@ -59,12 +59,12 @@ public class Splash : MonoBehaviour ...@@ -59,12 +59,12 @@ public class Splash : MonoBehaviour
public void onAdSkip() public void onAdSkip()
{ {
SceneManager.LoadScene("AdDemo"); SceneManager.LoadSceneAsync("AdDemo");
} }
public void onError(string errorMsg) public void onError(string errorMsg)
{ {
SceneManager.LoadScene("AdDemo"); SceneManager.LoadSceneAsync("AdDemo");
} }
} }
......
...@@ -528,5 +528,6 @@ PrefabInstance: ...@@ -528,5 +528,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 5984542369482327738, guid: 1053be02c113a7a45adf322c929b0cb6, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: 1053be02c113a7a45adf322c929b0cb6, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 1053be02c113a7a45adf322c929b0cb6, type: 3}
using UnityEngine;
using System.Collections;
using System;
using System.Security.Cryptography;
using System.Text;
/// <summary>
/// AES加密算法
/// </summary>
public class AESEncryption : MonoBehaviour
{
/// <summary>
/// aes加密key
/// </summary>
private static string aesKey = "c20505927997d952";
/// <summary>
/// aes加密偏移量
/// </summary>
private static string aeslv = "e2e7d664d72f710b";
/// <summary>
/// AES加密
/// </summary>
/// <param name="content">被加密的明文</param>
/// <param name="key">密钥</param>
/// <param name="vector">向量</param>
/// <returns>密文</returns>
public static string AESEncrypt(string content)
{
string key = aesKey;
string vector = aeslv;
if (string.IsNullOrEmpty(content)) return null;
byte[] toEncryptArray = Encoding.UTF8.GetBytes(content);
RijndaelManaged rm = new RijndaelManaged
{
Key = Encoding.UTF8.GetBytes(key),
IV = Encoding.UTF8.GetBytes(vector),
Mode = CipherMode.CBC,
Padding = PaddingMode.PKCS7
};
ICryptoTransform cTransform = rm.CreateEncryptor();
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
return Convert.ToBase64String(resultArray, 0, resultArray.Length);
}
/// <summary>
/// AES解密方法
/// </summary
/// <param name="content">要解密的内容</param>
/// <param name="key">解密key</param>
/// <param name="vector">向量</param>
/// <returns></returns>
public static string AESDecipher(string content)
{
string key = aesKey;
string vector = aeslv;
if (string.IsNullOrEmpty(content)) return null;
byte[] toEncryptArray = Convert.FromBase64String(content);
RijndaelManaged rm = new RijndaelManaged
{
Key = Encoding.UTF8.GetBytes(key),
IV = Encoding.UTF8.GetBytes(vector),
Mode = CipherMode.CBC,
Padding = PaddingMode.PKCS7
};
ICryptoTransform cTransform = rm.CreateDecryptor();
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
return Encoding.UTF8.GetString(resultArray);
}
}
\ No newline at end of file
fileFormatVersion: 2 fileFormatVersion: 2
guid: 3f3bf7630836b7043bfb3b3328ed8fdc guid: 1617db6d6711f8442a0a168a8c4b909d
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 4402898c05ead0348ae9c35f0ba35328 guid: 08abcf21e7d2d224596f1ce2fd2178d4
PluginImporter: PluginImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
......
...@@ -19,23 +19,8 @@ public class GameConfig : MonoBehaviour ...@@ -19,23 +19,8 @@ public class GameConfig : MonoBehaviour
private void Awake() private void Awake()
{ {
GameConfig._instacne = this; GameConfig._instacne = this;
//是否显示Log
Debug.unityLogger.logEnabled = IsShowLog;
} }
public bool IsShowLog = false;
//private string
......
...@@ -10,7 +10,6 @@ GameObject: ...@@ -10,7 +10,6 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 2853166085728200635} - component: {fileID: 2853166085728200635}
- component: {fileID: 2853166085728200634} - component: {fileID: 2853166085728200634}
- component: {fileID: 5984542369482327738}
- component: {fileID: -2993611056400550530} - component: {fileID: -2993611056400550530}
m_Layer: 0 m_Layer: 0
m_Name: HTTP m_Name: HTTP
...@@ -46,21 +45,10 @@ MonoBehaviour: ...@@ -46,21 +45,10 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
IS_TEST: 1 IS_TEST: 1
pkg: IS_TGYZ: 0
IsShowLog: 1
appLs: appLs:
--- !u!114 &5984542369482327738 appkey: faba1d018f76086
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2853166085728200632}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3f3bf7630836b7043bfb3b3328ed8fdc, type: 3}
m_Name:
m_EditorClassIdentifier:
URL_GAME_HOME_INFO: app/v1/game/xynt/home_info
--- !u!114 &-2993611056400550530 --- !u!114 &-2993611056400550530
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
This diff is collapsed.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NetConfig : MonoBehaviour
{
private static NetConfig _instacne = null;
public static NetConfig Instance
{
get
{
if (_instacne == null)
{
Debug.LogError("NetConfig Awake error");
}
return _instacne;
}
}
private void Awake()
{
NetConfig._instacne = this;
}
public string URL_GAME_HOME_INFO = "app/v1/game/xynt/home_info";
}
...@@ -270,7 +270,7 @@ PlayerSettings: ...@@ -270,7 +270,7 @@ PlayerSettings:
AndroidEnableTango: 0 AndroidEnableTango: 0
androidEnableBanner: 1 androidEnableBanner: 1
androidUseLowAccuracyLocation: 0 androidUseLowAccuracyLocation: 0
androidUseCustomKeystore: 0 androidUseCustomKeystore: 1
m_AndroidBanners: m_AndroidBanners:
- width: 320 - width: 320
height: 180 height: 180
......
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