长通知和切换场景保留消息

This commit is contained in:
Caiyanpeng committed 2022-01-24 15:41:04 +08:00
1 parent 7bb5bafbd2
commit cd162f3325
17 files changed
+1341 -99

No files matched your search

@@ -364,8 +364,7 @@ public class HomeController : PFUIPanel
var txt = m.transform.Find("TextContainer/Content").GetComponent<RectTransform>();
txt.GetComponent<Text>().text = e.Message;
LayoutRebuilder.ForceRebuildLayoutImmediate(txt);
m.GetComponent<HomeMessageController>().Initial();
m.GetComponent<HomeMessageController>().textWidth = txt.sizeDelta.x;
m.GetComponent<HomeMessageController>().Initial(txt.sizeDelta.x);
}
public override void Show()
@@ -373,6 +372,26 @@ public class HomeController : PFUIPanel
base.Show();
transform.MyDOFade();
GetSummary();
GetNotify();
//transform.Find("Panel (1)").GetComponent<test>().startPage();
}
private async Task GetNotify()
{
var r = await ConfigHelper.userApi.GetNotify();
if (r.result)
{
var lm = transform.Find("LongMessage");
if (r.data.Value<int>("Id") != 0)
{
lm.gameObject.SetActive(true);
lm.GetComponent<LongMessageScript>().Initial(r.data["Content"].ToString().Replace("\r\n"," "));
}
else
{
lm.gameObject.SetActive(false);
}
}
}
}
@@ -8,6 +8,7 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using System.Threading.Tasks;
public class NewRouteDetailController : PFUIPanel
{
@@ -131,7 +132,7 @@ public class NewRouteDetailController : PFUIPanel
//}
}
MapRouteAreaDetail area;
int pageIndex = 0, pageSize = 10;
int pageIndex = 0, pageSize = 12;
bool isEnd = false, startMouse = false;
public async void Initial(int areaId)
{
@@ -152,7 +153,7 @@ public class NewRouteDetailController : PFUIPanel
.text = string.Empty;
GetData(areaId);
await GetData(areaId);
GetList();
}
@@ -205,7 +206,7 @@ public class NewRouteDetailController : PFUIPanel
GetList();
}
}
private async void GetData(int areaId)
private async Task GetData(int areaId)
{
var res = await ConfigHelper.mapApi.GetMapRouteAreaDetail(areaId);
if (res.result)