保存图片压缩;记录列表清缓存;ms延迟3s;比赛列表样式问题

This commit is contained in:
Caiyanpeng committed 2021-11-19 10:54:14 +08:00
1 parent 5ba176725f
commit 3083224ee6
8 files changed
+63 -24

No files matched your search

+5
View File
@@ -148,8 +148,13 @@ namespace Assets.Scripts.UI.Control
UIManager.AddEvent(this.gameObject, EventTriggerType.PointerExit, new UnityAction<BaseEventData>(e =>
{
if (!this.isActiveAndEnabled) return;
#if !(UNITY_ANDROID || UNITY_IOS)
if (!string.IsNullOrWhiteSpace(Tooltips))
{
#else
if (!string.IsNullOrWhiteSpace(Tooltips) && showTooltip)
{
#endif
tooltips.SetActive(false);
}
//Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
+25 -3
View File
@@ -1,4 +1,5 @@
using Assets.Scripts.UI.Control;
using DG.Tweening;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -10,6 +11,7 @@ public class MainNav : MonoBehaviour
{
private GameObject exit;
private GameObject home;
float delayTime = 0;
private void Awake()
{
//var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
@@ -33,8 +35,15 @@ public class MainNav : MonoBehaviour
exit = this.transform.Find("Exit").gameObject;
exit.SetActive(false);
transform.Find("Delay").GetComponent<PfUIButton>().showTooltip = true;
#if UNITY_ANDROID || UNITY_IOS
UIManager.AddEvent(transform.Find("Delay").gameObject, EventTriggerType.PointerClick, b =>
{
delayTime = 3;
transform.Find("Delay/Tooltips").gameObject.SetActive(true);
transform.Find("Delay/Tooltips").GetComponent<CanvasGroup>().DOFade(1, 0.5f);
});
#endif
//transform.Find("Delay").GetComponent<PfUIButton>().showTooltip = true;
UIManager.AddEvent(exit, EventTriggerType.PointerClick, (e) =>
{
UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", ()=> {
@@ -77,7 +86,20 @@ public class MainNav : MonoBehaviour
// Update is called once per frame
void Update()
{
if (delayTime < 0)
{
Debug.Log("小时");
delayTime = 0;
transform.Find("Delay/Tooltips").GetComponent<CanvasGroup>().DOFade(0, 0.5f).onComplete = ()=>
{
transform.Find("Delay/Tooltips").gameObject.SetActive(false);
};
}
else if(delayTime > 0)
{
Debug.Log(delayTime);
delayTime -= Time.deltaTime;
}
}
public void ShowExit()
@@ -37,6 +37,7 @@ public class ResultListController : PFUIPanel
{
//ApiBase.SetCookie("73385F5F719B610D132C1ECF3E9143272BF15214D57ED91CD7A9DFD832407471535112AAEB8E9271F75D54FBBF2D99F18FA313C1EEA5676F5D722D7FBB07C926BEC5905591BF9AFDDC6336552DF273112C2DA1794E6FA2F465B11FECD2E82E52");
localRouteItem = Resources.Load<Transform>("UI/Prefab/ResultList/LocalRouteItem");
caches = new Dictionary<string, Texture>();
#if UNITY_ANDROID || UNITY_IOS
routeResult = Resources.Load<Transform>("UI/Prefab/ResultList/RouteItem-Mobile");
localRouteItem = Resources.Load<Transform>("UI/Prefab/ResultList/LocalRouteItem-Mobile");
@@ -231,6 +232,8 @@ public class ResultListController : PFUIPanel
Utils.showToast(gameObject, r.errMsg);
}
}
[HideInInspector]
public Dictionary<string, Texture> caches = null;
void DisplayRouteResult(List<JObject> list,Transform content,int index)
{
if (routeResult != null)
@@ -353,4 +356,11 @@ public class ResultListController : PFUIPanel
//}
}
protected override void OnDestroy()
{
caches = null;
Resources.UnloadUnusedAssets();
GC.Collect();
Debug.Log("list empty");
}
}
@@ -130,8 +130,9 @@ public class RouteItem : MonoBehaviour
public void Initial(RouteResult result,int index,Transform parent = null)
{
routeResult = result;
Utils.DisplayImage(transform.Find("BigLeft/CoverImage").GetComponent<RawImage>(), result.RouteImage, true);
Utils.DisplayImageTempDict(transform.Find("BigLeft/CoverImage").GetComponent<RawImage>(), result.RouteImage,
parent.GetComponent<ResultListController>().caches);
//Utils.DisplayImage(transform.Find("BigLeft/CoverImage").GetComponent<RawImage>(), result.RouteImage, true);
left.Find("Main").Find("Name").GetComponent<Text>().text = result.RouteName;
left.Find("Main").Find("Time").GetComponent<Text>().text = result.CreateTime.ToString("HH:mm:ss dd-MM-yyyy");