Commit 13d56782 authored by zhangzhe's avatar zhangzhe

iOS修改

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