Commit 13d56782 authored by zhangzhe's avatar zhangzhe

iOS修改

parent 06541005
......@@ -84,10 +84,25 @@ public class CSJFeedUtil : MonoBehaviour
lastCallBack = callback;
Debug.Log("设备机型: " + SystemInfo.deviceModel);
#if UNITY_IOS
int ImageAcceptedWidth;
// Screen.width在iPhone8p上获取的不对
if (SystemInfo.deviceModel == "iPhone10,2" || SystemInfo.deviceModel == "iPhone10,5")
{
ImageAcceptedWidth = 1242;
}
else
{
ImageAcceptedWidth = Screen.width;
}
#endif
var adSlot = new AdSlot.Builder()
#if UNITY_IOS
.SetCodeId(entity.codeId)
.SetImageAcceptedSize(Screen.width, 0)
.SetImageAcceptedSize(ImageAcceptedWidth, 0)
#else
.SetCodeId(entity.codeId)
////期望模板广告view的size,单位dp,//高度设置为0,则高度会自适应
......@@ -125,8 +140,29 @@ public class CSJFeedUtil : MonoBehaviour
{
feedAd = feedAdCacheList.Dequeue();
#if UNITY_IOS
int width;
// Screen.width在iPhone8p上获取的不对
if (SystemInfo.deviceModel == "iPhone10,2" || SystemInfo.deviceModel == "iPhone10,5")
{
width = 1242;
}
else
{
width = Screen.width;
}
int height;
// Screen.height在iPhone8p上获取的不对
if (SystemInfo.deviceModel == "iPhone10,2" || SystemInfo.deviceModel == "iPhone10,5")
{
height = 2208;
}
else
{
height = Screen.height;
}
float x = 0;
float y = Screen.height - (Screen.width * 275.5f / 375) - (IsX ? 45 : 0);
float y = height - (width * 275.5f / 375) - (IsX ? 45 : 0);
//if (y == 0)
//{
// y = 100; // 防止Demo里刘海遮挡
......
......@@ -42,6 +42,7 @@ public class GDTFeedAdUtil
NativeExpressAd ad = new NativeExpressAd(entity.codeId, GetAdSize());
nativeExpressAd = ad;
ad.SetEnableDefaultAudioSessionSetting(false);
ad.SetListener(new FeedAdListener(entity,callback));
ad.LoadAd(1);
}
......
......@@ -39,6 +39,7 @@ public class GDTInterstitialAdUtil
//string posId = Constants.intersititialNoVideoPosId;//不带视频的插屏广告测试Id
UnifiedInterstitialAd ad = new UnifiedInterstitialAd(entity.codeId);
ad.SetEnableDefaultAudioSessionSetting(false);
ad.SetListener(new UnifiedInterstitialAdListener(entity,ad,null, callback));
ad.LoadAd();
}
......
......@@ -678,6 +678,15 @@ namespace Tencent.GDT
}
});
}
[DllImport("__Internal")]
private static extern void GDT_UnionPlatform_RewardVideoAd_SetEnableDefaultAudioSessionSetting(bool audioSessionSetting);
public void SetEnableDefaultAudioSessionSetting(bool audioSessionSetting)
{
GDT_UnionPlatform_RewardVideoAd_SetEnableDefaultAudioSessionSetting(audioSessionSetting);
}
}
#endif
}
......@@ -543,6 +543,15 @@ namespace Tencent.GDT
}
});
}
[DllImport("__Internal")]
private static extern void GDT_UnionPlatform_RewardVideoAd_SetEnableDefaultAudioSessionSetting(bool audioSessionSetting);
public void SetEnableDefaultAudioSessionSetting(bool audioSessionSetting)
{
GDT_UnionPlatform_RewardVideoAd_SetEnableDefaultAudioSessionSetting(audioSessionSetting);
}
}
#endif
}
fileFormatVersion: 2
guid: c8769dd604faf4fb9b727d8d2fe57934
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -100,6 +100,7 @@ public class Guide : MonoBehaviour
}
PlayerDataControl.Instance.IsNewUser = isUser;
PlayerPrefs.SetInt("finishedStrongGuide", isUser ? 0 : 1);
isStartShow = true;
IsNewUser = isUser;
DissmissGuide(false);
......
......@@ -511,15 +511,7 @@ public class DialogControl : MonoBehaviour
}
private void moveDiamondDialog()
{
#if UNITY_IOS
diamondcontent.GetComponent<RectTransform>().anchorMin = new Vector2(0.5f, 0.5f);
diamondcontent.GetComponent<RectTransform>().anchorMax = new Vector2(0.5f, 0.5f);
diamondcontent.GetComponent<RectTransform>().anchoredPosition = new Vector3(0, 100, 0);
diamondcontent.transform.parent.Find("CloseImage").gameObject.SetActive(false);
#else
diamondcontent.transform.localPosition += new Vector3(0, 340, 0);
#endif
}
//关闭获取钻石弹窗
public void closeDiamondDialog()
......@@ -620,15 +612,7 @@ public class DialogControl : MonoBehaviour
}
private void moveAllSpeedDialog()
{
#if UNITY_IOS
allspeedcontent.GetComponent<RectTransform>().anchorMin = new Vector2(0.5f, 0.5f);
allspeedcontent.GetComponent<RectTransform>().anchorMax = new Vector2(0.5f, 0.5f);
allspeedcontent.GetComponent<RectTransform>().anchoredPosition = new Vector3(0, 100, 0);
allspeedcontent.transform.parent.Find("CloseImage").gameObject.SetActive(false);
#else
allspeedcontent.transform.localPosition += new Vector3(0, 320, 0);
#endif
}
private void showAd()
{
......@@ -1513,7 +1497,7 @@ public class DialogControl : MonoBehaviour
/// </summary>
private void moveHarvestHongBao()
{
transform.Find("HarvestHongBao/BgImage").localPosition = new Vector3(0, 370, 0);
transform.Find("HarvestHongBao/BgImage").localPosition = new Vector3(0, 320, 0);
}
/// <summary>
......
......@@ -90,7 +90,7 @@ public class Splash : MonoBehaviour
{
Constant.Instance.shubiao = false;
}
Constant.Instance.shubiao = true;
//Constant.Instance.shubiao = true;
novelInfo();
}), new Action<string, string>((code, errMsg) =>
{
......
......@@ -19,7 +19,7 @@
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.analytics": {
"version": "3.3.5",
......@@ -28,21 +28,21 @@
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "1.2.16",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "1.1.4",
......@@ -51,14 +51,14 @@
"dependencies": {
"com.unity.test-framework": "1.1.1"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
"version": "1.2.3",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.multiplayer-hlapi": {
"version": "1.0.8",
......@@ -67,7 +67,7 @@
"dependencies": {
"nuget.mono-cecil": "0.1.6-preview"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.purchasing": {
"version": "2.2.1",
......@@ -76,7 +76,7 @@
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.20",
......@@ -87,7 +87,7 @@
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "2.1.1",
......@@ -96,14 +96,14 @@
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.2.17",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
......@@ -122,14 +122,14 @@
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.xr": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"nuget.mono-cecil": {
"version": "0.1.6-preview",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.modules.ai": {
"version": "1.0.0",
......
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