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
922a634d
Commit
922a634d
authored
Aug 03, 2021
by
王雪伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
填充红包面板数据
parent
a8c07a3c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
146 additions
and
10 deletions
+146
-10
MoneyRedBagPanel.prefab
Assets/Resources/UI/Panel/MoneyRedBagPanel.prefab
+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
+6
-5
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/MoneyRedBagPanel.prefab
View file @
922a634d
...
...
@@ -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/Scripts/Model/RewarBean.cs
0 → 100644
View file @
922a634d
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 @
922a634d
fileFormatVersion: 2
guid: 9aa1e2c0a2073b1469d1e352b58b59f4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Panel/MainPanel.cs
View file @
922a634d
...
...
@@ -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
)
...
...
@@ -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 @
922a634d
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 @
922a634d
fileFormatVersion: 2
guid: dc4829ee7b7cf1f458c63d9bf7f9a184
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Panel/MusicRedBagPanel.cs
View file @
922a634d
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