修改细节

This commit is contained in:
Caiyanpeng committed 2021-07-27 18:36:49 +08:00
1 parent 164db7c013
commit ca938ab6f5
16 files changed
+1608 -51

No files matched your search

+21 -23
View File
@@ -13,12 +13,17 @@ public class RaceHomeScript : RaceScript
{
// Start is called before the first frame update
private ScrollRect scroll;
private Transform content,rightContainer,leftContainer,btnGoList,avatar;
private Transform content,rightContainer,leftContainer,btnGoList;
private float contentSize;
private int count;
private Button L, R;
//当前鼠标悬浮的卡片
async void Start()
public override void Show()
{
base.Show();
handleAvatar();
}
void Start()
{
scroll = transform.Find("LeftContainer/Swiper").GetComponent<ScrollRect>();
content = scroll.content;
@@ -43,38 +48,31 @@ public class RaceHomeScript : RaceScript
});
}
StartTime();
#if UNITY_EDITOR
if (App.CurrentUser == null) //App.CurrentUser == null
{
await Login();
}
#endif
rightContainer = transform.Find("RightContainer");
leftContainer = transform.Find("LeftContainer");
btnGoList = rightContainer.Find("Container-2/BtnGoList");
UIManager.AddEvent(btnGoList.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
{
UIManager.ShowRaceListPanel();
transform.GetComponent<CanvasGroup>().DOFade(0, 0.5f).onComplete = () =>
{
UIManager.ShowRaceListPanel();
};
});
avatar = transform.Find("Avatar");
if (avatar != null)
{
Utils.DisplayImage(avatar.GetComponent<RawImage>(), App.CurrentUser.WxHeadImg, true);
UIManager.AddEvent(avatar.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
{
UIManager.ShowUserInfoPanel();
});
}
var r = await ConfigHelper.mapCompetitionApi.GetCompetitionListV2("", 0, 7,order:0);
var activityList = await ConfigHelper.mapCompetitionApi.GetCompetitionListV2("", 0, 3, activity: 1,order:1);
DisplayMaps(r.data,activityList.data);
handleAvatar();
GetData();
}
async void GetData()
{
var r = await ConfigHelper.mapCompetitionApi.GetCompetitionListV2("", 0, 7, order: 0);
var activityList = await ConfigHelper.mapCompetitionApi.GetCompetitionListV2("", 0, 3, activity: 1, order: 1);
DisplayMaps(r.data, activityList.data);
Initial();
Utils.StartTimeUnLimit(10, () =>
Utils.StartTimeUnLimit(10, () =>
{
goRight();
});
}
private void DisplayMaps(List<MapCompetition> list, List<MapCompetition> activityList)
{
int i = 0;