Commit a8c07a3c authored by LiLiuZhou's avatar LiLiuZhou

Merge branch 'master' of gitlab.huolea.com:wangxuewei/musicbigwatermelon

parents 1c9e3705 956a91c2
...@@ -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);
}));
}
} }
...@@ -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) =>
{ {
......
...@@ -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();
} }
......
...@@ -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) =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment