比赛;编辑页面

This commit is contained in:
Caiyanpeng committed 2021-08-31 17:11:43 +08:00
1 parent 85130ce6c3
commit 3ec6fd0569
56 files changed
+16371 -2749

No files matched your search

@@ -71,7 +71,11 @@ public class RaceHomeScript : RaceScript
StartTime();
rightContainer = transform.Find("RightContainer");
leftContainer = transform.Find("LeftContainer");
#if !(UNITY_ANDROID || UNITY_IOS)
btnGoList = rightContainer.Find("Container-2/BtnGoList");
#else
btnGoList = rightContainer.Find("BtnGoList");
#endif
if (btnGoList != null)
{
UIManager.AddEvent(btnGoList.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
@@ -92,7 +96,11 @@ public class RaceHomeScript : RaceScript
async void GetData()
{
#if !(UNITY_ANDROID || UNITY_IOS)
var r = await ConfigHelper.mapCompetitionApi.GetCompetitionListV2("", 0, 7, order: 0);
#else
var r = await ConfigHelper.mapCompetitionApi.GetCompetitionListV2("", 0, 4, order: 0);
#endif
var activityList = await ConfigHelper.mapCompetitionApi.GetCompetitionListV2("", 0, 3, activity: 1, order: 2);
DisplayMaps(r.data, activityList.data);
Initial();
@@ -112,6 +120,10 @@ public class RaceHomeScript : RaceScript
smallGame = Resources.Load<GameObject>("UI/Prefab/Race/ItemSmall"),
bannerItem = Resources.Load<GameObject>("UI/Prefab/Race/Banner/BannerItem"),
dotItem = Resources.Load<GameObject>("UI/Prefab/Race/Banner/DotItem");
#if UNITY_ANDROID || UNITY_ANDROID
bannerItem = Resources.Load<GameObject>("UI/Prefab/Race/Banner/BannerItem-Mobile");
smallGame = Resources.Load<GameObject>("UI/Prefab/Race/Mobile/ItemSmall-Mobile");
#endif
//for (i = 0; i < 2; i++)
//{
// var game = Instantiate<GameObject>(bigGame);
@@ -166,9 +178,11 @@ public class RaceHomeScript : RaceScript
dot.transform.localScale = Vector3.one;
//scroll.content
}
#if !(UNITY_ANDROID || UNITY_IOS)
rightContainer.Find("Container-2/BtnGoList").SetAsLastSibling();
rightContainer.Find("Container-2/BtnGoList").GetComponent<RaceMaskScript>().localY =
list.Count < 4 ? -167.5f :-492.5f;
#endif
}
void OnBannerClick(MapCompetition map)
{
@@ -192,7 +206,14 @@ public class RaceHomeScript : RaceScript
//{
// contentSize = 0;
//}
contentSize = 1f / (content.childCount - 1);
if (content.childCount > 1)
{
contentSize = 1f / (content.childCount - 1);
}
else
{
contentSize = 0;
}
scroll.horizontalNormalizedPosition = 0;
}
void goLeft()
@@ -211,7 +232,7 @@ public class RaceHomeScript : RaceScript
void goMove(int i = 1)
{
//doAni();
if (startMoveEnd) return;
if (startMoveEnd || contentSize == 0) return;
if (!start) startPosition = scroll.horizontalNormalizedPosition;
start = true;
scrollValue = i * contentSize / 20;