Commit 459fe133 authored by 王雪伟's avatar 王雪伟

修改菜市场模拟器 ios平台报错

parent d0cf92d2
......@@ -103,8 +103,10 @@ public class AdManager
#endif
break;
case ZXADConfig.PLANTFORM_AD_FS:
#if UNITY_ANDROID
AndroidJavaClass jc3 = new AndroidJavaClass("com.ym.admodule.fs.FunShionManager");
jc3.CallStatic("init");
#endif
break;
default:
......@@ -131,6 +133,7 @@ public class AdManager
if (!IsInitAd)
{
listener.onError("没有初始化");
listener.onLastError();
return;
}
Debug.unityLogger.Log("huangjunhui"," 开屏,请求接口" + ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000).ToString());
......@@ -1146,6 +1149,7 @@ public class AdManager
//广点通激励视频广告加载
GDTRewardAdUtil.Instance.LoadCacheRewardAd(entity, callback);
break;
#if UNITY_ANDROID
case ZXADConfig.PLANTFORM_AD_YLB:
//优良宝激励视频广告加载
YLBRewardAdUtil.Instance.LoadCacheRewardAd(entity, callback);
......@@ -1154,6 +1158,8 @@ public class AdManager
case ZXADConfig.PLANTFORM_AD_FS:
FSRewardUtils.Instance.LoadCacheRewardAd(entity, callback);
break;
#endif
default:
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "不支持加载" + entity.adPlatform + "的激励视频广告");
callback(null);
......@@ -1257,6 +1263,7 @@ public class AdManager
//广点通激励视频广告播放
GDTRewardAdUtil.Instance.playCacheRewardAd(entity, listener, callback);
break;
#if UNITY_ANDROID
case ZXADConfig.PLANTFORM_AD_YLB:
//优良宝激励视频广告播放
YLBRewardAdUtil.Instance.playCacheRewardAd(entity, listener, callback);
......@@ -1265,6 +1272,7 @@ public class AdManager
case ZXADConfig.PLANTFORM_AD_FS:
FSRewardUtils.Instance.playCacheRewardAd(entity, listener, callback);
break;
#endif
default:
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "不支持Show" + entity.adPlatform + "的激励视频广告");
callback(false);
......
......@@ -145,7 +145,7 @@ public class CSJRewardUtil
#if UNITY_IOS
EventUtils.onEventPullSuccess(entity);
this.csjAD.SetRewardVideoAdForIOS(entity.codeGroup + entity.slotName, ad);
callback(true);
callback(entity);
#endif
}
......
......@@ -2,7 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_ANDROID
public class FSRewardUtils
{
private FSRewardUtils() { }
......@@ -198,3 +198,4 @@ public class FSRewardUtils
}
}
#endif
\ No newline at end of file
......@@ -35,7 +35,7 @@ public class YLBRewardAdUtil
rewardVideoAd.SetLoadListener(new RewardVideoAdLoadListener(this,entity,rewardVideoAd,callback));
rewardVideoAd.LoadAd(entity.codeId, entity.codeGroup);
#elif UNITY_IOS
callback(false);
callback(null);
#endif
}
......
......@@ -80,10 +80,10 @@ public class ZXHCSplashUtil
// Android 要求开屏 container 必须是 c# 的 AndroidJavaObject 类型,必须是 Java(Android)上的 ViewGroup 类型
container = ZXHCUtils.NewAdContainer();
ZXHCUtils.ShowView(container, false);
this.hcAdUtils.hcSplshad.Show(container);
#elif UNITY_IOS
#endif
this.hcAdUtils.hcSplshad.Show(container);
}
public void OnAdShow()
......
......@@ -37,13 +37,15 @@ namespace ZXHC
public static void SetDeviceOaid(string oaid)
{
#if UNITY_ANDROID && !UNITY_EDITOR
AndroidJavaObject phoneUtil = new AndroidJavaClass("com.ym.zxhcsdk.PhoneUtils").CallStatic<AndroidJavaObject>("getInstance");
phoneUtil.Call("setOaid", oaid);
#endif
}
public static string GetDeviceOaid()
{
#if UNITY_ANDROID&&!UNITY_EDITOR
#if UNITY_ANDROID && !UNITY_EDITOR
AndroidJavaObject phoneUtil = new AndroidJavaClass("com.ym.zxhcsdk.PhoneUtils").CallStatic<AndroidJavaObject>("getInstance");
return phoneUtil.Call<string>("getoaid");
#endif
......
......@@ -24,6 +24,9 @@ public class InitProject : MonoBehaviour
{
ZXHCUtils.SetDeviceOaid(oaid);
}));
#elif UNITY_IOS
////加载游戏场景
SceneManager.LoadSceneAsync(1);
#endif
}
......@@ -102,7 +105,7 @@ public class InitProject : MonoBehaviour
Debug.unityLogger.Log("huangjunhui load ", "5 加载splash场景 " + ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000).ToString());
}));
#else
callback("不支持");
//callback("不支持");
#endif
}
......
......@@ -445,6 +445,30 @@ namespace EncryptHelper
return temp;
}
/// <summary>
/// MD5加密
/// </summary>
/// <param name="value">需要加密字符串</param>
/// <returns>返回32位大写字符</returns>
public static string MD5Encrypt(string value)
{
//将输入字符串转换成字节数组 ANSI代码页编码
var buffer = Encoding.Default.GetBytes(value);
//接着,创建Md5对象进行散列计算
var data = MD5.Create().ComputeHash(buffer);
//创建一个新的Stringbuilder收集字节
var sb = new StringBuilder();
//遍历每个字节的散列数据
foreach (var t in data)
{
//转换大写十六进制字符串
// X2 大写
// x2 小写
sb.Append(t.ToString("x2"));
}
//返回十六进制字符串
return sb.ToString();
}
}
......
......@@ -109,7 +109,7 @@ public class Splash : MonoBehaviour
Debug.unityLogger.Log("huangjunhui load ", "5 加载splash场景 " + ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000).ToString());
}));
#else
callback("不支持");
//callback("不支持");
#endif
}
......
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