Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
Z
ZxAd_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
王雪伟
ZxAd_Unity
Commits
6ec1837a
Commit
6ec1837a
authored
May 26, 2021
by
张广义
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除iOSHander
parent
a9b9ed11
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
61 deletions
+30
-61
AppConfig.cs
Assets/UnityTool/AppConfig.cs
+1
-1
UnityPhoneUtils.cs
Assets/UnityTool/UnityPhoneUtils.cs
+29
-1
iOSHander.cs
Assets/UnityTool/iOSHander.cs
+0
-48
iOSHander.cs.meta
Assets/UnityTool/iOSHander.cs.meta
+0
-11
No files found.
Assets/UnityTool/AppConfig.cs
View file @
6ec1837a
...
...
@@ -26,7 +26,7 @@ public class AppConfig
{
// 初始化iOS交互
#if !UNITY_EDITOR && UNITY_IOS
iOSHander
.
Instance
.
Handler
();
UnityPhoneUtils
.
Instance
.
Handler
();
#endif
Constant
.
Instance
.
IsTestNet
=
isTest
;
...
...
Assets/UnityTool/UnityPhoneUtils.cs
View file @
6ec1837a
using
System.Collections
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Runtime.InteropServices
;
using
AOT
;
...
...
@@ -39,6 +40,33 @@ public class UnityPhoneUtils
return
phoneUtil
;
}
[
UnmanagedFunctionPointer
(
CallingConvention
.
Cdecl
)]
public
delegate
void
ResultHandler
(
string
device
,
string
IDFA
);
[
MonoPInvokeCallback
(
typeof
(
ResultHandler
))]
static
void
resultHandler
(
string
deviceStr
,
string
IDFAStr
)
{
Debug
.
Log
(
"resultHandler : deviceStr = "
+
deviceStr
+
"IDFAStr = "
+
IDFAStr
);
Constant
.
Instance
.
device
=
deviceStr
;
Constant
.
Instance
.
idfa
=
IDFAStr
;
}
[
DllImport
(
"__Internal"
)]
static
extern
void
BridageDeviceAndIDFA
(
IntPtr
resultHandler
);
public
void
Handler
()
{
ResultHandler
handler
=
new
ResultHandler
(
resultHandler
);
IntPtr
fp
=
Marshal
.
GetFunctionPointerForDelegate
(
handler
);
BridageDeviceAndIDFA
(
fp
);
}
public
string
GetImsi
()
{
string
imsi
=
""
;
...
...
Assets/UnityTool/iOSHander.cs
deleted
100644 → 0
View file @
a9b9ed11
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Runtime.InteropServices
;
using
AOT
;
using
UnityEngine
;
public
class
iOSHander
{
private
iOSHander
()
{
}
private
static
readonly
iOSHander
singleInstance
=
new
iOSHander
();
public
static
iOSHander
Instance
{
get
{
return
singleInstance
;
}
}
[
UnmanagedFunctionPointer
(
CallingConvention
.
Cdecl
)]
public
delegate
void
ResultHandler
(
string
device
,
string
IDFA
);
[
MonoPInvokeCallback
(
typeof
(
ResultHandler
))]
static
void
resultHandler
(
string
deviceStr
,
string
IDFAStr
)
{
Debug
.
Log
(
"resultHandler : deviceStr = "
+
deviceStr
+
"IDFAStr = "
+
IDFAStr
);
Constant
.
Instance
.
device
=
deviceStr
;
Constant
.
Instance
.
idfa
=
IDFAStr
;
}
[
DllImport
(
"__Internal"
)]
static
extern
void
BridageDeviceAndIDFA
(
IntPtr
resultHandler
);
public
void
Handler
()
{
ResultHandler
handler
=
new
ResultHandler
(
resultHandler
);
IntPtr
fp
=
Marshal
.
GetFunctionPointerForDelegate
(
handler
);
BridageDeviceAndIDFA
(
fp
);
}
}
Assets/UnityTool/iOSHander.cs.meta
deleted
100644 → 0
View file @
a9b9ed11
fileFormatVersion: 2
guid: 3046b42bbeae947ffb400d0fc7a48d24
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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