细节调整

This commit is contained in:
lishuo committed 2021-07-26 14:09:21 +08:00
1 parent ac59808915
commit 1f3485846f
14 files changed
+2617 -2537

No files matched your search

+1 -9
View File
@@ -100,14 +100,6 @@ namespace Assets.Scripts.Apis
};
return Post<JsonResult>($"/MapCompetition/CancelMapCompetition", param);
}
//取消报名比赛
public async Task<JsonResult> CancelMapCompetition(int id)
{
var param = new
{
id = id,
};
return await PostAsync<JsonResult>($"/MapCompetition/CancelMapCompetition", param);
}
}
}
+8 -8
View File
@@ -69,13 +69,13 @@ public static class App
static App()
{
#if !UNITY_EDITOR
// Host = "http://pf.juze.pro/";
// UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
// TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21001);
Host = "https://wx.powerfun.com.cn/";
UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11000);
TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11001);
#endif
//#if !UNITY_EDITOR
//// Host = "http://pf.juze.pro/";
//// UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
//// TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21001);
// Host = "https://wx.powerfun.com.cn/";
// UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11000);
// TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11001);
//#endif
}
}
@@ -94,7 +94,7 @@ namespace Assets.Scenes.Ride.Scripts
}
//显示观众
var watchList = mainController.GetWatcherList();
watchPanel.SetActive(watchList.Count >= 5);
watchPanel.SetActive(watchList.Count > 0);
#endregion
}
@@ -35,14 +35,16 @@ namespace Assets.Scenes.Ride.Scripts
}
}
private const int MAX_COUNT = 7;
private void CreateList()
{
var watchList = cyclingController.GetWatcherList();
var count = watchList.Count();
head.SetActive(count >= 5);
head.SetActive(count>= MAX_COUNT);
watchNum.text = count.ToString();//绑定观看人数
var list = watchList.Take(5);
var list = watchList.Take(MAX_COUNT);
Utils.DestroyChildren(content);
foreach (var item in list)
{
@@ -37,7 +37,19 @@ namespace Assets.Scenes.Ride.Scripts
var current = i * targetPoints;
if (current >= max)
{
return current - targetPoints > 0? current - targetPoints : 0;
current = current - targetPoints > 0? current - targetPoints : 0;
}
var ss = mData.Count - targetPoints;
var interval = currentIndex - current;
int mid = (int)(graph.DataSource.HorizontalViewSize / 2);
//是否到达中间及以后的位置
var isReachMid = interval >= mid;
//海拔图是否已经全部加载
var isReachEnd = currentIndex >= mData.Count - targetPoints && currentIndex <= mData.Count;
if (isReachMid && !isReachEnd)
{
current = current + interval- mid;
}
return current;
}
@@ -75,8 +75,7 @@ public class HomeController : PFUIPanel
UIManager.AddEvent(userInfo.Find("BtnMore").gameObject, EventTriggerType.PointerClick, x =>
{
// UIManager.ShowUserInfoPanel();
UIManager.ShowRaceAlertPanel();
UIManager.ShowUserInfoPanel();
//UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", null);
});
//GetSummary();
@@ -33,13 +33,10 @@ public class RaceButtonGroupScript : MonoBehaviour
if (!map.HasJoin)
{
parent.GetComponent<RaceItemScript>().Join();
}else
{
App.RouteIdParam = map.RouteId;
App.CompetionId = map.Id;
SceneManager.LoadScene("Ride");
}
Debug.Log(map);
App.RouteIdParam = map.RouteId;
App.CompetionId = map.Id;
SceneManager.LoadScene("Ride");
}
void GoCancel()
{
@@ -6,6 +6,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class RaceHomeScript : RaceScript
@@ -114,7 +115,9 @@ public class RaceHomeScript : RaceScript
}
void OnBannerClick(MapCompetition map)
{
Debug.Log("banner點擊");
App.RouteIdParam = map.RouteId;
App.CompetionId = map.Id;
SceneManager.LoadScene("Ride");
}
private async Task Login()
{
@@ -212,9 +212,9 @@ public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterH
base.StartRide(baseEvent);
}
*/
async public void Join()
public void Join()
{
var res = await ConfigHelper.mapCompetitionApi.ApplyMapCompetition(mapCompetition.Id);
var res = ConfigHelper.mapCompetitionApi.ApplyMapCompetition(mapCompetition.Id);
if (res.result)
{
mapCompetition.HasJoin = true;
@@ -225,9 +225,9 @@ public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterH
Utils.showToast(null, "Successful application!", type: 1);
}
}
async public void CancelJoin()
public void CancelJoin()
{
var res = await ConfigHelper.mapCompetitionApi.CancelMapCompetition(mapCompetition.Id);
var res = ConfigHelper.mapCompetitionApi.CancelMapCompetition(mapCompetition.Id);
if (res.result)
{
mapCompetition.HasJoin = false;