Merge branch 'dev_lishuo' into dev
# Conflicts: # .gitignore # Assets/Scenes/Ride/Scripts/SelectPlayerFactory.cs
This commit is contained in:
commit
a7ea02f70a
52 files changed
+6329
-2723
No files matched your search
@@ -32,7 +32,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
InputField startValue;
|
||||
InputField endValue;
|
||||
private int pageIndex = 0;
|
||||
private int pageSize = 25;
|
||||
private int pageSize = 8;
|
||||
private int totalPages = 0;
|
||||
private string seachName = string.Empty;
|
||||
|
||||
@@ -92,6 +92,26 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//startValue.text = _startValue.ToString();
|
||||
//endValue.text = _endValue.ToString();
|
||||
}
|
||||
bool startMouse = false;
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetAxis("Mouse ScrollWheel") != 0)
|
||||
{
|
||||
if (scroll.GetComponent<ScrollRect>().verticalNormalizedPosition <= 0 ||
|
||||
scroll.GetComponent<ScrollRect>().verticalNormalizedPosition >= (pageIndex == 0 ? 1.2 : 1))
|
||||
{
|
||||
startMouse = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (startMouse)
|
||||
{
|
||||
startMouse = false;
|
||||
OnEndDrag(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void StartvalueChanged(string input)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(input))
|
||||
@@ -178,7 +198,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
private void Refresh()
|
||||
{
|
||||
var list = mapApi.GetRouteRanking(App.RouteIdParam, "1", pageIndex, pageSize, seachName);
|
||||
var list = mapApi.GetShadowList(App.RouteIdParam, seachName, pageIndex, pageSize);
|
||||
totalPages = list.data.TotalPages;
|
||||
var data = list.data.list;//.Where(c => c.WeightKg >= _startValue && c.WeightKg <= _endValue).ToList();
|
||||
if (_startValue > 0)
|
||||
@@ -201,14 +221,14 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
private void CreateGameObject(List<MapRouteRanking> list)
|
||||
{
|
||||
if (list.Count == 0)
|
||||
{
|
||||
noRecord.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
noRecord.SetActive(false);
|
||||
}
|
||||
//if (list.Count == 0)
|
||||
//{
|
||||
// noRecord.SetActive(true);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// noRecord.SetActive(false);
|
||||
//}
|
||||
var parent = transform.Find("Panel/PlayerList/Scroll View/Viewport/Content");
|
||||
int index = 0;
|
||||
foreach (var item in list)
|
||||
@@ -253,12 +273,13 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
seletedPlayerScript.Reset();
|
||||
}
|
||||
//TODO BUG
|
||||
private void OnEndDrag(BaseEventData arg0)
|
||||
{
|
||||
var scrollrect = scroll.GetComponent<ScrollRect>();
|
||||
if (scrollrect.verticalNormalizedPosition <= 0)
|
||||
{
|
||||
if (pageIndex < totalPages )
|
||||
if (pageIndex < totalPages-1 )
|
||||
{
|
||||
pageIndex++;
|
||||
Refresh();
|
||||
|
||||
Reference in new issue
Block a user