Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
W
wdlc_mjb_unity
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
wdlc_mjb_unity
Commits
3e0233d7
Commit
3e0233d7
authored
Jun 25, 2021
by
zhangzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
广告修改
parent
f5b25075
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
15 deletions
+56
-15
GDTAdViewManager.mm
...se/AdSDK/AD/GDT/UnionDemo/Scripts/iOS/GDTAdViewManager.mm
+43
-2
packages-lock.json
Packages/packages-lock.json
+13
-13
No files found.
Assets/Base/AdSDK/AD/GDT/UnionDemo/Scripts/iOS/GDTAdViewManager.mm
View file @
3e0233d7
...
@@ -6,9 +6,48 @@
...
@@ -6,9 +6,48 @@
//
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#import "GDTUnifiedBannerView.h"
#import "UnityAppController.h"
#import "UnityAppController.h"
// MARK: - 判断机型
//判断是否是ipad
#define isPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
//判断iPhoneX
#define IS_IPHONE_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPHoneXr/iPhone11
#define IS_IPHONE_Xr ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPhoneXs/iPhone11 Pro
#define IS_IPHONE_Xs ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPhoneXs Max/iPhone11 Pro Max
#define IS_IPHONE_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPhone12 mini
#define IS_IPHONE_1080_2340 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1080, 2340), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPhone12/12 Pro
#define IS_IPHONE_1170_2532 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1170, 2532), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPhone12 Pro Max
#define IS_IPHONE_1284_2778 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1284, 2778), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPad Pro3rd
#define IS_IPAD_PRO_3RD ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(2048, 2732), [[UIScreen mainScreen] currentMode].size) && isPad : NO)
// 没有Home键的机型
#define NO_HOME_IPHONE (IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES || IS_IPHONE_1080_2340== YES || IS_IPHONE_1170_2532== YES || IS_IPHONE_1284_2778== YES || IS_IPAD_PRO_3RD)
// MARK: - 适配
// 屏幕宽
#define kscreenWidth [UIScreen mainScreen].bounds.size.width
// 屏幕高(无刘海的机型在打电话等情况下状态栏会变高, 这里处理了这种情况)
#define kscreenheight (NO_HOME_IPHONE ? [UIScreen mainScreen].bounds.size.height : ([UIScreen mainScreen].bounds.size.height - ([[UIApplication sharedApplication] statusBarFrame].size.height == 40 ? 20 : 0)))
// 有navigationBar没有tabbar的页面的高度
#define kscreenheightNoNANoTab kscreenheight - SafeAreaTopHeight
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
// 安全距离
#define SafeAreaTopHeight (NO_HOME_IPHONE ? (IS_IPAD_PRO_3RD ? 74 : 88) : 64) //iPhone X上NavigationBar高度不一样
#define SafeAreaBottomHeight (NO_HOME_IPHONE ? (IS_IPAD_PRO_3RD ? 20 : 34) : 0) //iPhone X上底部有一段距离
#if defined (__cplusplus)
#if defined (__cplusplus)
extern "C" {
extern "C" {
#endif
#endif
...
@@ -21,6 +60,7 @@ void GDT_UnionPlatform_Ad_ShowAdView(UIView *adView) {
...
@@ -21,6 +60,7 @@ void GDT_UnionPlatform_Ad_ShowAdView(UIView *adView) {
if (_timer)
if (_timer)
{
{
NSLog(@"大图走没走这里");
dispatch_source_cancel(_timer);
dispatch_source_cancel(_timer);
_timer = nil;
_timer = nil;
}
}
...
@@ -36,11 +76,12 @@ void GDT_UnionPlatform_Ad_ShowAdView(UIView *adView) {
...
@@ -36,11 +76,12 @@ void GDT_UnionPlatform_Ad_ShowAdView(UIView *adView) {
CGFloat width = adView.frame.size.width;
CGFloat width = adView.frame.size.width;
CGFloat height = adView.frame.size.height;
CGFloat height = adView.frame.size.height;
CGFloat x = (GetAppController().rootViewController.view.frame.size.width - width) / 2.0f;
CGFloat x = (GetAppController().rootViewController.view.frame.size.width - width) / 2.0f;
CGFloat y = GetAppController().rootViewController.view.frame.size.height - height;
CGFloat y = GetAppController().rootViewController.view.frame.size.height - height
- SafeAreaBottomHeight
;
if (adView.frame.origin.x != x || adView.frame.origin.y != y || adView.frame.size.width != width || adView.frame.size.height != height)
if (adView.frame.origin.x != x || adView.frame.origin.y != y || adView.frame.size.width != width || adView.frame.size.height != height)
{
{
adView.frame = CGRectMake(x, y, width, height);
adView.frame = CGRectMake(x, y, width, height);
NSLog(@"大图改变frame");
}
}
});
});
});
});
...
...
Packages/packages-lock.json
View file @
3e0233d7
...
@@ -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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"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.c
n
"
"url"
:
"https://packages.unity.c
om
"
},
},
"com.unity.modules.ai"
:
{
"com.unity.modules.ai"
:
{
"version"
:
"1.0.0"
,
"version"
:
"1.0.0"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment