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
1c9e3705
Commit
1c9e3705
authored
Aug 03, 2021
by
LiLiuZhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
d2be866f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
514 additions
and
214 deletions
+514
-214
MusicCell.prefab
Assets/Resources/Cells/MusicCell.prefab
+87
-202
MusicPanel.prefab
Assets/Resources/UI/Panel/MusicPanel.prefab
+1
-0
Game.unity
Assets/Scenes/Game.unity
+389
-3
MusicCell.cs
Assets/Scripts/Cell/MusicCell.cs
+27
-7
MusicPanel.cs
Assets/Scripts/Panel/MusicPanel.cs
+10
-2
No files found.
Assets/Resources/Cells/MusicCell.prefab
View file @
1c9e3705
This diff is collapsed.
Click to expand it.
Assets/Resources/UI/Panel/MusicPanel.prefab
View file @
1c9e3705
...
@@ -585,3 +585,4 @@ MonoBehaviour:
...
@@ -585,3 +585,4 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
ed82f0e40e7586f479aaa574bfe84b67
,
type
:
3
}
m_Script
:
{
fileID
:
11500000
,
guid
:
ed82f0e40e7586f479aaa574bfe84b67
,
type
:
3
}
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
PlayingCell
:
{
fileID
:
0
}
Assets/Scenes/Game.unity
View file @
1c9e3705
This diff is collapsed.
Click to expand it.
Assets/Scripts/Cell/MusicCell.cs
View file @
1c9e3705
...
@@ -5,6 +5,7 @@ using UnityEngine.UI;
...
@@ -5,6 +5,7 @@ using UnityEngine.UI;
public
class
MusicCell
:
BasePanel
public
class
MusicCell
:
BasePanel
{
{
public
SongItemBean
bean
;
public
override
void
OnHide
(
object
data
=
null
)
public
override
void
OnHide
(
object
data
=
null
)
{
{
...
@@ -12,20 +13,39 @@ public class MusicCell : BasePanel
...
@@ -12,20 +13,39 @@ public class MusicCell : BasePanel
public
override
void
OnInit
(
object
data
=
null
)
public
override
void
OnInit
(
object
data
=
null
)
{
{
MusicPanel
panel
=
UIMgr
.
Getinstance
().
GetPanel
<
MusicPanel
>()
;
SongItemBean
bean
=
data
as
SongItemBean
;
GetControl
<
Toggle
>(
"togPlay"
).
group
=
panel
.
GetControl
<
ToggleGroup
>(
"Content"
)
;
this
.
bean
=
bean
;
GetControl
<
Toggle
>(
"togPlay"
).
onValueChanged
.
AddListener
(
value
=>
GetControl
<
Button
>(
"btnPlayMusic"
).
onClick
.
AddListener
(()
=>
{
{
GetControl
<
Image
>(
"imgTogBK"
).
enabled
=
value
;
MusicPanel
panel
=
UIMgr
.
Getinstance
().
GetPanel
<
MusicPanel
>();
GetControl
<
Image
>(
"imgTogCheckMark"
).
enabled
=
value
;
panel
.
ChangeMusic
(
this
);
});
});
GetControl
<
Text
>(
"txtNum"
).
text
=
bean
.
song_id
.
ToString
();
GetControl
<
Text
>(
"txtNum"
).
color
=
bean
.
song_id
<=
3
?
Color
.
red
:
Color
.
black
;
GetControl
<
Text
>(
"txtMusicName"
).
text
=
bean
.
song_name
;
}
}
public
override
void
OnRefresh
(
object
data
=
null
)
public
override
void
OnRefresh
(
object
data
=
null
)
{
{
throw
new
System
.
NotImplementedException
();
}
}
public
void
OnStartMusic
()
{
if
(
bean
==
null
)
{
throw
new
System
.
Exception
(
"cell数据为空"
);
}
}
public
void
OnStopMusic
()
{
if
(
bean
==
null
)
{
throw
new
System
.
Exception
(
"cell数据为空"
);
}
}
}
}
Assets/Scripts/Panel/MusicPanel.cs
View file @
1c9e3705
...
@@ -6,6 +6,8 @@ using UnityEngine.UI;
...
@@ -6,6 +6,8 @@ using UnityEngine.UI;
public
class
MusicPanel
:
BasePanel
public
class
MusicPanel
:
BasePanel
{
{
//当前正在播放的格子
public
MusicCell
PlayingCell
;
public
override
void
OnHide
(
object
data
=
null
)
public
override
void
OnHide
(
object
data
=
null
)
{
{
...
@@ -21,11 +23,13 @@ public class MusicPanel : BasePanel
...
@@ -21,11 +23,13 @@ public class MusicPanel : BasePanel
paras
.
Add
(
"song_id"
,
1
);
paras
.
Add
(
"song_id"
,
1
);
HttpTool
.
Instance
.
_Get
(
"app/v1/watermelon/songs_list"
,
paras
,
new
Action
<
SongBean
>((
result
)
=>
HttpTool
.
Instance
.
_Get
(
"app/v1/watermelon/songs_list"
,
paras
,
new
Action
<
SongBean
>((
result
)
=>
{
{
print
(
result
);
for
(
int
i
=
0
;
i
<
result
.
list
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
result
.
list
.
Count
;
i
++)
{
{
GameObject
obj
=
ResMgr
.
Getinstance
().
Load
<
GameObject
>(
"Cells/MusicCell"
);
GameObject
obj
=
ResMgr
.
Getinstance
().
Load
<
GameObject
>(
"Cells/MusicCell"
);
obj
.
transform
.
SetParent
(
GetControl
<
ScrollRect
>(
"svMusic"
).
content
.
transform
);
obj
.
transform
.
SetParent
(
GetControl
<
ScrollRect
>(
"svMusic"
).
content
.
transform
);
obj
.
transform
.
ReSet
();
obj
.
GetComponent
<
MusicCell
>().
OnInit
(
result
.
list
[
i
]);
}
}
}),
new
Action
<
string
,
string
>((
code
,
msg
)
=>
}),
new
Action
<
string
,
string
>((
code
,
msg
)
=>
...
@@ -40,5 +44,9 @@ public class MusicPanel : BasePanel
...
@@ -40,5 +44,9 @@ public class MusicPanel : BasePanel
//UIMgr.GetInstance().HidePanel<MusicPanel>();
//UIMgr.GetInstance().HidePanel<MusicPanel>();
}
}
public
void
ChangeMusic
(
MusicCell
cell
)
{
}
}
}
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