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
4ea2e21d
Commit
4ea2e21d
authored
May 08, 2021
by
王雪伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改HttpTool 请求未实现的情况
parent
3df60f0d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
9 deletions
+36
-9
InitProject.cs
Assets/AdSDK/InitProject/Scripts/InitProject.cs
+7
-0
HttpTool.cs
Assets/AdSDK/NetWork/HTTP/HttpTool.cs
+12
-7
Splash.cs
Assets/AdSDK/SplashDemo/Splash.cs
+5
-0
Splash.unity
Assets/AdSDK/SplashDemo/Splash.unity
+10
-0
EditorBuildSettings.asset
ProjectSettings/EditorBuildSettings.asset
+2
-2
No files found.
Assets/AdSDK/InitProject/Scripts/InitProject.cs
View file @
4ea2e21d
using
LitJson
;
using
LitJson
;
using
System
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.Android
;
using
UnityEngine.Android
;
using
UnityEngine.SceneManagement
;
using
UnityEngine.SceneManagement
;
using
ZXHC
;
public
class
InitProject
:
MonoBehaviour
public
class
InitProject
:
MonoBehaviour
{
{
...
@@ -33,7 +35,12 @@ public class InitProject : MonoBehaviour
...
@@ -33,7 +35,12 @@ public class InitProject : MonoBehaviour
#endif
#endif
if
(
IsOk
())
if
(
IsOk
())
{
{
OaidUtil
.
GetOaid
(
new
Action
<
string
>((
oaid
)
=>
{
ZXHCUtils
.
SetDeviceOaid
(
oaid
);
EventUtils
.
OnEvent
(
"app_active"
);
}));
Gettd
();
Gettd
();
}
}
else
else
{
{
...
...
Assets/AdSDK/NetWork/HTTP/HttpTool.cs
View file @
4ea2e21d
...
@@ -6,10 +6,6 @@ using System;
...
@@ -6,10 +6,6 @@ using System;
using
System.Text
;
using
System.Text
;
using
System.Linq
;
using
System.Linq
;
using
LitJson
;
using
LitJson
;
using
System.Net.Http
;
using
System.Net
;
using
System.Net.Http.Headers
;
using
System.Threading.Tasks
;
using
ZXHC
;
using
ZXHC
;
public
class
HttpTool
:
MonoBehaviour
public
class
HttpTool
:
MonoBehaviour
...
@@ -45,7 +41,13 @@ public class HttpTool : MonoBehaviour
...
@@ -45,7 +41,13 @@ public class HttpTool : MonoBehaviour
{
{
if
(
_instacne
==
null
)
if
(
_instacne
==
null
)
{
{
Debug
.
unityLogger
.
LogError
(
HttpLogTag
,
"HTTP Awake error"
);
_instacne
=
FindObjectOfType
(
typeof
(
HttpTool
))
as
HttpTool
;
}
if
(
_instacne
==
null
)
{
GameObject
obj
=
new
GameObject
();
_instacne
=
obj
.
AddComponent
<
HttpTool
>();
obj
.
name
=
"HTTP"
;
}
}
return
_instacne
;
return
_instacne
;
}
}
...
@@ -53,6 +55,10 @@ public class HttpTool : MonoBehaviour
...
@@ -53,6 +55,10 @@ public class HttpTool : MonoBehaviour
void
Awake
()
void
Awake
()
{
{
if
(
FindObjectsOfType
(
typeof
(
HttpTool
)).
Length
>
1
)
{
Destroy
(
transform
.
gameObject
);
}
Debug
.
unityLogger
.
logEnabled
=
IsShowLog
;
Debug
.
unityLogger
.
logEnabled
=
IsShowLog
;
if
(
IS_TEST
)
if
(
IS_TEST
)
{
{
...
@@ -66,10 +72,9 @@ public class HttpTool : MonoBehaviour
...
@@ -66,10 +72,9 @@ public class HttpTool : MonoBehaviour
BaseAdUrl
=
PRODUCT_BASE_AD_URL
;
BaseAdUrl
=
PRODUCT_BASE_AD_URL
;
BaseEventUrl
=
PRODUCT_BASE_EVENT_URL
;
BaseEventUrl
=
PRODUCT_BASE_EVENT_URL
;
}
}
HttpTool
.
_instacne
=
gameObject
.
GetComponent
<
HttpTool
>();
HttpTool
.
_instacne
=
gameObject
.
GetComponent
<
HttpTool
>();
DontDestroyOnLoad
(
gameObject
);
DontDestroyOnLoad
(
gameObject
);
//unityhttp header 的内容
//unityhttp header 的内容
requestHeader
.
Add
(
"Content-Type"
,
"application/json"
);
requestHeader
.
Add
(
"Content-Type"
,
"application/json"
);
}
}
...
...
Assets/AdSDK/SplashDemo/Splash.cs
View file @
4ea2e21d
...
@@ -5,6 +5,7 @@ using Umeng;
...
@@ -5,6 +5,7 @@ using Umeng;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.Android
;
using
UnityEngine.Android
;
using
UnityEngine.SceneManagement
;
using
UnityEngine.SceneManagement
;
using
ZXHC
;
public
class
Splash
:
MonoBehaviour
public
class
Splash
:
MonoBehaviour
{
{
...
@@ -18,6 +19,10 @@ public class Splash : MonoBehaviour
...
@@ -18,6 +19,10 @@ public class Splash : MonoBehaviour
{
{
//EventUtils.OnEvent("app_start", "广告SDK");
//EventUtils.OnEvent("app_start", "广告SDK");
Debug
.
unityLogger
.
Log
(
"初始化权限"
);
Debug
.
unityLogger
.
Log
(
"初始化权限"
);
OaidUtil
.
GetOaid
(
new
Action
<
string
>((
oaid
)
=>
{
//ZXHCUtils.SetDeviceOaid(oaid);
EventUtils
.
OnEvent
(
"app_active"
);
}));
}
}
/// <summary>
/// <summary>
...
...
Assets/AdSDK/SplashDemo/Splash.unity
View file @
4ea2e21d
...
@@ -473,6 +473,16 @@ PrefabInstance:
...
@@ -473,6 +473,16 @@ PrefabInstance:
propertyPath
:
m_Name
propertyPath
:
m_Name
value
:
HTTP
value
:
HTTP
objectReference
:
{
fileID
:
0
}
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
2853166085728200632
,
guid
:
1053be02c113a7a45adf322c929b0cb6
,
type
:
3
}
propertyPath
:
m_IsActive
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
2853166085728200634
,
guid
:
1053be02c113a7a45adf322c929b0cb6
,
type
:
3
}
propertyPath
:
IS_TGYZ
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
2853166085728200635
,
guid
:
1053be02c113a7a45adf322c929b0cb6
,
-
target
:
{
fileID
:
2853166085728200635
,
guid
:
1053be02c113a7a45adf322c929b0cb6
,
type
:
3
}
type
:
3
}
propertyPath
:
m_RootOrder
propertyPath
:
m_RootOrder
...
...
ProjectSettings/EditorBuildSettings.asset
View file @
4ea2e21d
...
@@ -8,13 +8,13 @@ EditorBuildSettings:
...
@@ -8,13 +8,13 @@ EditorBuildSettings:
-
enabled
:
0
-
enabled
:
0
path
:
Assets/AdSDK/AD/CSJ/Example/Example.unity
path
:
Assets/AdSDK/AD/CSJ/Example/Example.unity
guid
:
1e4f8457b1266154e80399e42b932ceb
guid
:
1e4f8457b1266154e80399e42b932ceb
-
enabled
:
0
-
enabled
:
1
path
:
Assets/AdSDK/InitProject/InitScene.unity
path
:
Assets/AdSDK/InitProject/InitScene.unity
guid
:
b0fdeff412c9a1f4e82faa8ef0aeb063
guid
:
b0fdeff412c9a1f4e82faa8ef0aeb063
-
enabled
:
0
-
enabled
:
0
path
:
Assets/AdSDK/AD/GDT/UnionDemo/UnionExample.unity
path
:
Assets/AdSDK/AD/GDT/UnionDemo/UnionExample.unity
guid
:
6c963ae210fa3c3438c2f6770ee81fc9
guid
:
6c963ae210fa3c3438c2f6770ee81fc9
-
enabled
:
0
-
enabled
:
1
path
:
Assets/AdSDK/SplashDemo/Splash.unity
path
:
Assets/AdSDK/SplashDemo/Splash.unity
guid
:
37af8cf3fb373478ab04e3ee2f3b700a
guid
:
37af8cf3fb373478ab04e3ee2f3b700a
-
enabled
:
1
-
enabled
:
1
...
...
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