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
a8c07a3c
Commit
a8c07a3c
authored
Aug 03, 2021
by
LiLiuZhou
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.huolea.com:wangxuewei/musicbigwatermelon
parents
1c9e3705
956a91c2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
16 deletions
+36
-16
GameController.cs
Assets/Scripts/Controllers/GameController.cs
+18
-0
Fruit.cs
Assets/Scripts/Game/Fruit.cs
+15
-2
HomeInfoControl.cs
Assets/Scripts/Main/HomeInfoControl.cs
+3
-0
MainPanel.cs
Assets/Scripts/Panel/MainPanel.cs
+0
-14
No files found.
Assets/Scripts/Controllers/GameController.cs
View file @
a8c07a3c
...
@@ -79,5 +79,23 @@ public class GameController : MonoBehaviour
...
@@ -79,5 +79,23 @@ public class GameController : MonoBehaviour
}
}
/// <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
<
EmptyBean
>((
result
)
=>
{
}),
new
Action
<
string
,
string
>((
code
,
msg
)
=>
{
Debug
.
unityLogger
.
Log
(
"获取合成奖励 "
+
code
+
" msg "
+
msg
);
}));
}
}
}
Assets/Scripts/Game/Fruit.cs
View file @
a8c07a3c
...
@@ -27,6 +27,11 @@ public class Fruit : MonoBehaviour
...
@@ -27,6 +27,11 @@ public class Fruit : MonoBehaviour
//如果两个水果名字一样
//如果两个水果名字一样
if
(
gameObject
.
name
==
collision
.
gameObject
.
name
)
if
(
gameObject
.
name
==
collision
.
gameObject
.
name
)
{
{
if
(
int
.
Parse
(
gameObject
.
name
)
>=
11
)
{
return
;
}
//如果另一边的水果已经触发 碰撞函数 则直接返回
//如果另一边的水果已经触发 碰撞函数 则直接返回
if
(
GameController
.
GetInstance
().
TempList
.
Contains
(
gameObject
))
if
(
GameController
.
GetInstance
().
TempList
.
Contains
(
gameObject
))
{
{
...
@@ -40,7 +45,11 @@ public class Fruit : MonoBehaviour
...
@@ -40,7 +45,11 @@ public class Fruit : MonoBehaviour
//两个水果的中间位置
//两个水果的中间位置
Vector3
MidPos
=
(
transform
.
position
+
collision
.
transform
.
position
)
/
2
;
Vector3
MidPos
=
(
transform
.
position
+
collision
.
transform
.
position
)
/
2
;
//生成一个新的
//生成一个新的
string
NewObjName
=
(
int
.
Parse
(
gameObject
.
name
)
+
1
).
ToString
();
int
fruitNum
=
int
.
Parse
(
gameObject
.
name
)
+
1
;
string
NewObjName
=
fruitNum
.
ToString
();
GameObject
Obj
=
Instantiate
(
Resources
.
Load
<
GameObject
>(
"Fruits/"
+
NewObjName
),
MidPos
,
Quaternion
.
identity
);
GameObject
Obj
=
Instantiate
(
Resources
.
Load
<
GameObject
>(
"Fruits/"
+
NewObjName
),
MidPos
,
Quaternion
.
identity
);
Obj
.
transform
.
localScale
=
new
Vector3
(
0.3f
,
0.3f
,
1
);
Obj
.
transform
.
localScale
=
new
Vector3
(
0.3f
,
0.3f
,
1
);
Obj
.
name
=
NewObjName
;
Obj
.
name
=
NewObjName
;
...
@@ -55,9 +64,13 @@ public class Fruit : MonoBehaviour
...
@@ -55,9 +64,13 @@ public class Fruit : MonoBehaviour
#
region
上报水果合成
#
region
上报水果合成
Dictionary
<
string
,
object
>
paras
=
new
Dictionary
<
string
,
object
>();
Dictionary
<
string
,
object
>
paras
=
new
Dictionary
<
string
,
object
>();
paras
.
Add
(
"type"
,
int
.
Parse
(
gameObject
.
name
)
);
paras
.
Add
(
"type"
,
fruitNum
);
HttpTool
.
Instance
.
_Get
(
"app/v1/watermelon/synthetic"
,
paras
,
new
Action
<
List
<
int
>>((
result
)
=>
HttpTool
.
Instance
.
_Get
(
"app/v1/watermelon/synthetic"
,
paras
,
new
Action
<
List
<
int
>>((
result
)
=>
{
{
if
(
fruitNum
==
11
)
{
UIMgr
.
Getinstance
().
GetPanel
<
MainPanel
>().
GetHomeInfo
();
}
}),
new
Action
<
string
,
string
>((
code
,
msg
)
=>
}),
new
Action
<
string
,
string
>((
code
,
msg
)
=>
{
{
...
...
Assets/Scripts/Main/HomeInfoControl.cs
View file @
a8c07a3c
...
@@ -29,6 +29,9 @@ public class HomeInfoControl : MonoBehaviour
...
@@ -29,6 +29,9 @@ public class HomeInfoControl : MonoBehaviour
EventCenter
.
Getinstance
().
EventTrigger
(
"RegisterPanel"
);
EventCenter
.
Getinstance
().
EventTrigger
(
"RegisterPanel"
);
GameController
.
GetInstance
().
GetWithdrawList
(
1
);
GameController
.
GetInstance
().
GetWithdrawList
(
1
);
GameController
.
GetInstance
().
GetReward
();
}
}
...
...
Assets/Scripts/Panel/MainPanel.cs
View file @
a8c07a3c
...
@@ -82,20 +82,6 @@ public class MainPanel : BasePanel
...
@@ -82,20 +82,6 @@ public class MainPanel : BasePanel
/// </summary>
/// </summary>
public
void
GetNextNoteList
(
int
song_id
)
public
void
GetNextNoteList
(
int
song_id
)
{
{
//Dictionary<string, object> paras = new Dictionary<string, object>();
//paras.Add("song_id", song_id);
//HttpTool.Instance._Get("app/v1/watermelon/notes", paras, new Action<List<string>>((result) =>
//{
// IsSuccess = false;
// playNoteIndex = 0;
// notesList = result;
// GetControl<Text>("ProgressTv").text = "0/" + result.Count;
// GetControl<Image>("ProgressBar").fillAmount = 0 / (float)result.Count;
// Debug.unityLogger.Log("");
//}), new Action<string, string>((code, msg) =>
//{
// Debug.unityLogger.Log("获取下一组生成的球 " + code + " msg " + msg);
//}));
Dictionary
<
string
,
object
>
paras
=
new
Dictionary
<
string
,
object
>();
Dictionary
<
string
,
object
>
paras
=
new
Dictionary
<
string
,
object
>();
paras
.
Add
(
"song_id"
,
song_id
);
paras
.
Add
(
"song_id"
,
song_id
);
HttpTool
.
Instance
.
_Get2
(
"app/v1/watermelon/notes"
,
paras
,
new
Action
<
Response
<
List
<
string
>>>((
result
)
=>
HttpTool
.
Instance
.
_Get2
(
"app/v1/watermelon/notes"
,
paras
,
new
Action
<
Response
<
List
<
string
>>>((
result
)
=>
...
...
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