两个列表进骑行释放内存

This commit is contained in:
Caiyanpeng committed 2021-11-16 18:41:18 +08:00
1 parent 3295314b7e
commit 6a4390f1b9
7 files changed
+88 -32

No files matched your search

+14 -2
View File
@@ -1,5 +1,6 @@
using Assets.Scripts;
using DG.Tweening;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -10,6 +11,8 @@ public class RaceScript : PFUIPanel
// Start is called before the first frame update
protected Transform currentItem { get; set; }
IEnumerator _timer { get; set; }
public Dictionary<string, Texture> caches { get; set; }
public override void Show()
{
base.Show();
@@ -71,7 +74,6 @@ public class RaceScript : PFUIPanel
while (true)
{
yield return new WaitForSeconds(1.0f); //
Debug.Log(123);
HandleTime();
//time = UIManager.Now.GetDateTime().AddSeconds(1);
}
@@ -138,8 +140,10 @@ public class RaceScript : PFUIPanel
}
}
void Awake()
protected override void Awake()
{
base.Awake();
caches = new Dictionary<string, Texture>();
if (_timer == null)
{
_timer = Timer();
@@ -151,4 +155,12 @@ public class RaceScript : PFUIPanel
{
}
protected override void OnDestroy()
{
caches = null;
Resources.UnloadUnusedAssets();
GC.Collect();
Debug.Log("list empty");
}
}