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
41b91a5a
Commit
41b91a5a
authored
Aug 03, 2021
by
LiLiuZhou
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.huolea.com:wangxuewei/musicbigwatermelon
parents
89b51fae
b72fbad5
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
150 additions
and
14 deletions
+150
-14
MainPanel.prefab
Assets/Resources/UI/Panel/MainPanel.prefab
+1
-1
MoneyRedBagPanel.prefab
Assets/Resources/UI/Panel/MoneyRedBagPanel.prefab
+1
-1
Game.unity
Assets/Scenes/Game.unity
+1
-1
RewarBean.cs
Assets/Scripts/Model/RewarBean.cs
+23
-0
RewarBean.cs.meta
Assets/Scripts/Model/RewarBean.cs.meta
+11
-0
MainPanel.cs
Assets/Scripts/Panel/MainPanel.cs
+8
-7
MoneyRedBagPanel.cs
Assets/Scripts/Panel/MoneyRedBagPanel.cs
+60
-0
MoneyRedBagPanel.cs.meta
Assets/Scripts/Panel/MoneyRedBagPanel.cs.meta
+11
-0
MusicRedBagPanel.cs
Assets/Scripts/Panel/MusicRedBagPanel.cs
+34
-4
No files found.
Assets/Resources/UI/Panel/MainPanel.prefab
View file @
41b91a5a
...
...
@@ -731,7 +731,7 @@ GameObject:
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
m_IsActive
:
0
---
!u!224
&6808044342231135425
RectTransform
:
m_ObjectHideFlags
:
0
...
...
Assets/Resources/UI/Panel/MoneyRedBagPanel.prefab
View file @
41b91a5a
...
...
@@ -155,7 +155,7 @@ MonoBehaviour:
m_HorizontalOverflow
:
0
m_VerticalOverflow
:
0
m_LineSpacing
:
1
m_Text
:
"
\u518D\u8D5A\u53D6
11111111111111"
m_Text
:
---
!u!1
&4471334563280762286
GameObject
:
m_ObjectHideFlags
:
0
...
...
Assets/Scenes/Game.unity
View file @
41b91a5a
...
...
@@ -2151,7 +2151,7 @@ GameObject:
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
m_IsActive
:
0
---
!u!114
&6808044342704349404
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
Assets/Scripts/Model/RewarBean.cs
0 → 100644
View file @
41b91a5a
using
System
;
using
System.Collections.Generic
;
[Serializable]
public
class
RewarBean
{
/// <summary>
/// 奖励数(单位为分)
/// </summary>
public
int
reward
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
bool
@double
{
get
;
set
;
}
/// <summary>
/// 当前余额(单位为分)
/// </summary>
public
int
available
{
get
;
set
;
}
/// <summary>
/// 距离提现还差多少 单位为分)
/// </summary>
public
int
disparity
{
get
;
set
;
}
}
Assets/Scripts/Model/RewarBean.cs.meta
0 → 100644
View file @
41b91a5a
fileFormatVersion: 2
guid: 9aa1e2c0a2073b1469d1e352b58b59f4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Panel/MainPanel.cs
View file @
41b91a5a
...
...
@@ -6,6 +6,8 @@ using UnityEngine.UI;
public
class
MainPanel
:
BasePanel
{
public
int
GetCurrentSongId
{
get
{
return
int
.
Parse
(
currentSongId
);
}
}
protected
override
void
Awake
()
{
base
.
Awake
();
...
...
@@ -27,7 +29,7 @@ public class MainPanel : BasePanel
{
EventCenter
.
Getinstance
().
AddUpdateListener
(
"FlyNote"
,
AddSongProgress
);
GetHomeInfo
();
GetNextNoteList
(
nextSongId
);
GetNextNoteList
();
}
public
override
void
OnRefresh
(
object
data
=
null
)
...
...
@@ -38,8 +40,8 @@ public class MainPanel : BasePanel
{
HttpTool
.
Instance
.
_Get
(
"app/v1/watermelon/info"
,
null
,
new
Action
<
WatermelonInfoBean
>((
result
)
=>
{
GetControl
<
Text
>(
"CashNumTv"
).
text
=
"¥"
+
result
.
available
;
GetControl
<
Text
>(
"FruitNumTv"
).
text
=
result
.
count
+
"个"
;
GetControl
<
Text
>(
"CashNumTv"
).
text
=
"¥"
+
(
result
.
available
/
100f
).
ToString
(
"0.00"
)
;
//
GetControl<Text>("FruitNumTv").text = result.count + "个";
GetControl
<
Button
>(
"MyMusic"
).
onClick
.
AddListener
(()
=>
{
UIMgr
.
Getinstance
().
ShowPanel
<
MusicPanel
>(
E_Layer
.
lower_top
);
});
}),
new
Action
<
string
,
string
>((
code
,
msg
)
=>
{
...
...
@@ -67,7 +69,7 @@ public class MainPanel : BasePanel
GetNoteCompleted
();
IsSuccess
=
true
;
Debug
.
unityLogger
.
Log
(
"合成音符红包"
);
//
UIMgr.Getinstance().ShowPanel<MusicRedBagPanel>(E_Layer.mid);
UIMgr
.
Getinstance
().
ShowPanel
<
MusicRedBagPanel
>(
E_Layer
.
mid
);
}
GetControl
<
Text
>(
"ProgressTv"
).
text
=
playNoteIndex
+
"/"
+
notesList
.
Count
;
...
...
@@ -80,10 +82,10 @@ public class MainPanel : BasePanel
/// <summary>
/// 获取接下来将要掉落的音符组及所属歌曲
/// </summary>
public
void
GetNextNoteList
(
int
song_id
)
public
void
GetNextNoteList
()
{
Dictionary
<
string
,
object
>
paras
=
new
Dictionary
<
string
,
object
>();
paras
.
Add
(
"song_id"
,
song_i
d
);
paras
.
Add
(
"song_id"
,
nextSongI
d
);
HttpTool
.
Instance
.
_Get2
(
"app/v1/watermelon/notes"
,
paras
,
new
Action
<
Response
<
List
<
string
>>>((
result
)
=>
{
currentSongId
=
result
.
result
.
song_id
;
...
...
@@ -93,7 +95,6 @@ public class MainPanel : BasePanel
notesList
=
result
.
result
.
data
;
GetControl
<
Text
>(
"ProgressTv"
).
text
=
"0/"
+
result
.
result
.
data
.
Count
;
GetControl
<
Image
>(
"ProgressBar"
).
fillAmount
=
0
/
(
float
)
result
.
result
.
data
.
Count
;
Debug
.
unityLogger
.
Log
(
""
);
}),
new
Action
<
string
,
string
>((
code
,
msg
)
=>
{
Debug
.
unityLogger
.
Log
(
"获取下一组生成的球 "
+
code
+
" msg "
+
msg
);
...
...
Assets/Scripts/Panel/MoneyRedBagPanel.cs
0 → 100644
View file @
41b91a5a
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.UI
;
public
class
MoneyRedBagPanel
:
BasePanel
{
public
override
void
OnHide
(
object
data
=
null
)
{
UIMgr
.
Getinstance
().
GetPanel
<
MainPanel
>().
GetHomeInfo
();
}
public
override
void
OnInit
(
object
data
=
null
)
{
GetReward
();
GetControl
<
Button
>(
"btnCashOut"
).
onClick
.
AddListener
(()
=>
{
UIMgr
.
Getinstance
().
HidePanel
<
MoneyRedBagPanel
>();
UIMgr
.
Getinstance
().
GetPanel
<
MainPanel
>().
GetNextNoteList
();
ToastPlugin
.
ToastHelper
.
ShowToast
(
"立即提现"
);
});
GetControl
<
Button
>(
"btnClose"
).
onClick
.
AddListener
(()
=>
{
UIMgr
.
Getinstance
().
GetPanel
<
MainPanel
>().
GetNextNoteList
();
UIMgr
.
Getinstance
().
HidePanel
<
MoneyRedBagPanel
>();
});
GetControl
<
Button
>(
"btnContinue"
).
onClick
.
AddListener
(()
=>
{
UIMgr
.
Getinstance
().
GetPanel
<
MainPanel
>().
GetNextNoteList
();
UIMgr
.
Getinstance
().
HidePanel
<
MoneyRedBagPanel
>();
});
}
public
override
void
OnRefresh
(
object
data
=
null
)
{
}
/// <summary>
/// 获取合成奖励
/// </summary>
/// <param name="song_id"></param>
public
void
GetReward
()
{
Dictionary
<
string
,
object
>
paras
=
new
Dictionary
<
string
,
object
>();
paras
.
Add
(
"type"
,
1
);
HttpTool
.
Instance
.
_Get
(
"app/v1/watermelon/reward"
,
paras
,
new
Action
<
RewarBean
>((
result
)
=>
{
GetControl
<
Text
>(
"txtTopMoney"
).
text
=
(
result
.
reward
/
100f
).
ToString
(
"0.00"
)
+
"元"
;
GetControl
<
Text
>(
"txtMoney"
).
text
=
(
result
.
available
/
100f
).
ToString
(
"0.00"
)
+
"元"
;
GetControl
<
Text
>(
"txtDiscribe"
).
text
=
"再赚取"
+
(
result
.
disparity
/
100f
).
ToString
(
"0.00"
)
+
"元可以提现"
;
}),
new
Action
<
string
,
string
>((
code
,
msg
)
=>
{
Debug
.
unityLogger
.
Log
(
"获取合成奖励 "
+
code
+
" msg "
+
msg
);
}));
}
}
Assets/Scripts/Panel/MoneyRedBagPanel.cs.meta
0 → 100644
View file @
41b91a5a
fileFormatVersion: 2
guid: dc4829ee7b7cf1f458c63d9bf7f9a184
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Panel/MusicRedBagPanel.cs
View file @
41b91a5a
using
System.Collections
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.UI
;
public
class
MusicRedBagPanel
:
BasePanel
{
public
override
void
OnHide
(
object
data
=
null
)
{
//throw new System.NotImplementedException();
}
public
override
void
OnInit
(
object
data
=
null
)
{
//throw new System.NotImplementedException();
GetControl
<
Button
>(
"btnOpen"
).
onClick
.
AddListener
(()
=>
{
UIMgr
.
Getinstance
().
HidePanel
<
MusicRedBagPanel
>();
UIMgr
.
Getinstance
().
ShowPanel
<
MoneyRedBagPanel
>(
E_Layer
.
mid
);
});
GetControl
<
Button
>(
"btnClose"
).
onClick
.
AddListener
(()
=>
{
UIMgr
.
Getinstance
().
GetPanel
<
MainPanel
>().
GetNextNoteList
();
UIMgr
.
Getinstance
().
HidePanel
<
MusicRedBagPanel
>();
});
Dictionary
<
string
,
object
>
paras
=
new
Dictionary
<
string
,
object
>();
paras
.
Add
(
"song_id"
,
UIMgr
.
Getinstance
().
GetPanel
<
MainPanel
>().
GetCurrentSongId
);
HttpTool
.
Instance
.
_Get
(
"app/v1/watermelon/songs_list"
,
paras
,
new
Action
<
SongBean
>((
result
)
=>
{
for
(
int
i
=
0
;
i
<
result
.
list
.
Count
;
i
++)
{
if
(
UIMgr
.
Getinstance
().
GetPanel
<
MainPanel
>().
GetCurrentSongId
==
result
.
list
[
i
].
song_id
)
{
GetControl
<
Text
>(
"txtMusicName"
).
text
=
"你合成了歌曲“"
+
result
.
list
[
i
].
song_name
+
"”"
;
break
;
}
}
}),
new
Action
<
string
,
string
>((
code
,
msg
)
=>
{
Debug
.
unityLogger
.
Log
(
"获取歌曲列表 "
+
code
+
" msg "
+
msg
);
}));
}
public
override
void
OnRefresh
(
object
data
=
null
)
{
//throw new System.NotImplementedException();
}
}
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