Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
M
MusicBigWatermelon
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
王雪伟
MusicBigWatermelon
Commits
9ad06b2d
Commit
9ad06b2d
authored
Aug 04, 2021
by
LiLiuZhou
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.huolea.com:wangxuewei/musicbigwatermelon
parents
eceece52
c7ea95a5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
124 additions
and
115 deletions
+124
-115
CallingNativeMethods.cs
Assets/Base/UnityTool/CallingNativeMethods.cs
+1
-74
UnityPhoneUtils.cs
Assets/Base/UnityTool/UnityPhoneUtils.cs
+0
-37
AndroidManifest.xml
Assets/Plugins/Android/AndroidManifest.xml
+7
-0
MoneyRedBagPanel.prefab
Assets/Resources/UI/Panel/MoneyRedBagPanel.prefab
+13
-0
GraphicsSettings.asset
ProjectSettings/GraphicsSettings.asset
+7
-1
ProjectSettings.asset
ProjectSettings/ProjectSettings.asset
+96
-3
No files found.
Assets/Base/UnityTool/CallingNativeMethods.cs
View file @
9ad06b2d
...
...
@@ -12,6 +12,7 @@ public class CallingNativeMethods
return
singleInstance
;
}
}
#if UNITY_ANDROID
private
AndroidJavaObject
activity
;
public
AndroidJavaObject
GetActivity
()
...
...
@@ -27,16 +28,6 @@ public class CallingNativeMethods
}
#endif
#if UNITY_IOS
//判断微信是否安装
[
DllImport
(
"__Internal"
)]
private
static
extern
bool
_isWechatInstalled
();
[
DllImport
(
"__Internal"
)]
private
static
extern
void
_WechatLogin
(
string
appid
,
string
state
,
string
universalLink
);
[
DllImport
(
"__Internal"
)]
private
static
extern
void
ShowIOSWebView
(
string
urlStr
,
string
titleStr
);
#endif
/// <summary>
/// 注册初始化微信登录
/// </summary>
...
...
@@ -47,8 +38,6 @@ public class CallingNativeMethods
#elif UNITY_ANDROID
AndroidJavaObject
WxLoginUtil
=
new
AndroidJavaClass
(
"com.ym.unityandroid.UnityWxLoginUtil"
).
CallStatic
<
AndroidJavaObject
>(
"getInstance"
);
WxLoginUtil
.
Call
(
"InitWxLogin"
,
GetActivity
(),
Constant
.
Instance
.
WX_APP_ID
);
#elif UNITY_IOS
#endif
}
...
...
@@ -63,71 +52,9 @@ public class CallingNativeMethods
#elif UNITY_ANDROID
AndroidJavaObject
WxLoginUtil
=
new
AndroidJavaClass
(
"com.ym.unityandroid.UnityWxLoginUtil"
).
CallStatic
<
AndroidJavaObject
>(
"getInstance"
);
WxLoginUtil
.
Call
(
"wxLogin"
,
GetActivity
());
#elif UNITY_IOS
SendWxLogin
();
#endif
}
#if UNITY_IOS
/// <summary>
/// iOS 微信登录
/// </summary>
public
void
SendWxLogin
()
{
bool
isInstalled
=
false
;
isInstalled
=
_isWechatInstalled
();
if
(
isInstalled
)
{
_WechatLogin
(
Constant
.
Instance
.
WX_APP_ID
,
"state"
,
Constant
.
Instance
.
universalLink
);
}
else
{
ToastPlugin
.
ToastHelper
.
ShowToast
(
"请先安装微信客户端!"
);
}
}
/// <summary>
/// iOS微信登录回调
/// </summary>
/// <param name="msg"></param>
public
void
LoginCallBack
(
string
msg
)
{
Debug
.
Log
(
"微信登录的回调在这里: "
+
msg
);
}
#endif
/// <summary>
///
/// </summary>
/// <param name="url">H5 URL</param>
/// <param name="title">H5 Title</param>
public
void
OpenWebPage
(
string
url
,
string
title
)
{
#if UNITY_EDITOR
Debug
.
unityLogger
.
Log
(
"打开Web页面Url"
+
url
+
" Title"
+
title
);
#elif UNITY_ANDROID
AndroidJavaObject
WxLoginUtil
=
new
AndroidJavaClass
(
"com.ym.unityandroid.UnityWxLoginUtil"
).
CallStatic
<
AndroidJavaObject
>(
"getInstance"
);
WxLoginUtil
.
Call
(
"OpenH5Page"
,
GetActivity
(),
url
,
title
);
#elif UNITY_IOS
ShowIOSWebView
(
url
,
title
);
#endif
}
}
Assets/Base/UnityTool/UnityPhoneUtils.cs
View file @
9ad06b2d
...
...
@@ -29,9 +29,6 @@ public class UnityPhoneUtils
return
activity
;
}
private
string
device_iOS
=
""
;
private
string
idfa_iOS
=
""
;
private
AndroidJavaObject
phoneUtil
;
private
AndroidJavaObject
GetPhoneUtil
()
{
...
...
@@ -42,36 +39,6 @@ public class UnityPhoneUtils
return
phoneUtil
;
}
#if UNITY_IOS
/// <summary>
/// 声明交互方法
/// </summary>
/// <param name="resultString"></param>
[
UnmanagedFunctionPointer
(
CallingConvention
.
Cdecl
)]
public
delegate
void
ResultHandlerIDFA
(
string
resultString
);
[
UnmanagedFunctionPointer
(
CallingConvention
.
Cdecl
)]
public
delegate
void
ResultHandlerDevice
(
string
resultString
);
/// <summary>
/// 接受交互值 在iOS代码中调用 resultHandlerIDFA("传值");
/// </summary>
/// <param name="resultStr"></param>
[
MonoPInvokeCallback
(
typeof
(
ResultHandlerIDFA
))]
static
void
resultHandlerIDFA
(
string
resultStr
)
{
Instance
.
idfa_iOS
=
resultStr
;
}
[
MonoPInvokeCallback
(
typeof
(
ResultHandlerDevice
))]
static
void
resultHandlerDevice
(
string
resultStr
)
{
Instance
.
device_iOS
=
resultStr
;
}
#endif
public
string
GetDevice
()
{
if
(
null
!=
Constant
.
Instance
.
device
&&
!
Constant
.
Instance
.
device
.
Equals
(
""
))
...
...
@@ -85,10 +52,6 @@ public class UnityPhoneUtils
Constant
.
Instance
.
device
=
"debug_test_003"
;
#elif UNITY_ANDROID
Constant
.
Instance
.
device
=
GetPhoneUtil
().
Call
<
string
>(
"getDeviceId"
,
GetActivity
());
#elif UNITY_IOS
Constant
.
Instance
.
device
=
Constant
.
Instance
.
device
;
#endif
PlayerPrefs
.
SetString
(
"user_device"
,
Constant
.
Instance
.
device
);
...
...
Assets/Plugins/Android/AndroidManifest.xml
View file @
9ad06b2d
...
...
@@ -31,6 +31,13 @@
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
"com.unity3d.player.UnityPlayerActivity"
android:label=
"@string/app_name"
android:configChanges=
"fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
>
<meta-data
android:name=
"android.notch_support"
android:value=
"true"
/>
</activity>
<!-- 微信配置 -->
<activity
...
...
Assets/Resources/UI/Panel/MoneyRedBagPanel.prefab
View file @
9ad06b2d
...
...
@@ -527,6 +527,7 @@ GameObject:
-
component
:
{
fileID
:
4389441659701232193
}
-
component
:
{
fileID
:
2692063685387306858
}
-
component
:
{
fileID
:
8699067802771212516
}
-
component
:
{
fileID
:
5077160226892897627
}
m_Layer
:
5
m_Name
:
MoneyRedBagPanel
m_TagString
:
Untagged
...
...
@@ -599,6 +600,18 @@ MonoBehaviour:
m_FillOrigin
:
0
m_UseSpriteMesh
:
0
m_PixelsPerUnitMultiplier
:
1
---
!u!114
&5077160226892897627
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
8255382096179033094
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
dc4829ee7b7cf1f458c63d9bf7f9a184
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!1
&8423465539571189464
GameObject
:
m_ObjectHideFlags
:
0
...
...
ProjectSettings/GraphicsSettings.asset
View file @
9ad06b2d
...
...
@@ -3,7 +3,7 @@
---
!u!30
&1
GraphicsSettings
:
m_ObjectHideFlags
:
0
serializedVersion
:
1
2
serializedVersion
:
1
3
m_Deferred
:
m_Mode
:
1
m_Shader
:
{
fileID
:
69
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
...
...
@@ -31,6 +31,10 @@ GraphicsSettings:
m_AlwaysIncludedShaders
:
-
{
fileID
:
10753
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
10770
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
16000
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
16001
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
16003
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
17000
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_PreloadedShaders
:
[]
m_SpritesDefaultMaterial
:
{
fileID
:
10754
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
...
...
@@ -55,3 +59,5 @@ GraphicsSettings:
m_AlbedoSwatchInfos
:
[]
m_LightsUseLinearIntensity
:
0
m_LightsUseColorTemperature
:
0
m_LogWhenShaderIsCompiled
:
0
m_AllowEnlightenSupportForUpgradedProject
:
1
ProjectSettings/ProjectSettings.asset
View file @
9ad06b2d
...
...
@@ -8,7 +8,7 @@ PlayerSettings:
AndroidProfiler
:
0
AndroidFilterTouchesWhenObscured
:
0
AndroidEnableSustainedPerformanceMode
:
0
defaultScreenOrientation
:
4
defaultScreenOrientation
:
0
targetDevice
:
2
useOnDemandResources
:
0
accelerometerFrequency
:
60
...
...
@@ -272,7 +272,99 @@ PlayerSettings:
AndroidValidateAppBundleSize
:
1
AndroidAppBundleSizeToValidate
:
150
m_BuildTargetIcons
:
[]
m_BuildTargetPlatformIcons
:
[]
m_BuildTargetPlatformIcons
:
-
m_BuildTarget
:
Android
m_Icons
:
-
m_Textures
:
[]
m_Width
:
432
m_Height
:
432
m_Kind
:
2
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
324
m_Height
:
324
m_Kind
:
2
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
216
m_Height
:
216
m_Kind
:
2
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
162
m_Height
:
162
m_Kind
:
2
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
108
m_Height
:
108
m_Kind
:
2
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
81
m_Height
:
81
m_Kind
:
2
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
192
m_Height
:
192
m_Kind
:
0
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
144
m_Height
:
144
m_Kind
:
0
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
96
m_Height
:
96
m_Kind
:
0
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
72
m_Height
:
72
m_Kind
:
0
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
48
m_Height
:
48
m_Kind
:
0
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
36
m_Height
:
36
m_Kind
:
0
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
192
m_Height
:
192
m_Kind
:
1
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
144
m_Height
:
144
m_Kind
:
1
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
96
m_Height
:
96
m_Kind
:
1
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
72
m_Height
:
72
m_Kind
:
1
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
48
m_Height
:
48
m_Kind
:
1
m_SubKind
:
-
m_Textures
:
[]
m_Width
:
36
m_Height
:
36
m_Kind
:
1
m_SubKind
:
m_BuildTargetBatching
:
[]
m_BuildTargetEncrypting
:
[]
m_BuildTargetGraphicsJobs
:
...
...
@@ -556,7 +648,8 @@ PlayerSettings:
webGLWasmStreaming
:
0
scriptingDefineSymbols
:
{}
platformArchitecture
:
{}
scriptingBackend
:
{}
scriptingBackend
:
Android
:
1
il2cppCompilerConfiguration
:
{}
managedStrippingLevel
:
{}
incrementalIl2cppBuild
:
{}
...
...
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