Compare commits
No commits in common. "83353b4aebcfbfb931c97aaf38db9a715fecdfaf" and "93501dd2b0f60a84c55b7dc7a1c19ab45f384663" have entirely different histories.
83353b4aeb
...
93501dd2b0
@ -4,7 +4,6 @@ using System.Collections.Generic;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
public class TaskPanel : Base
|
public class TaskPanel : Base
|
||||||
{
|
{
|
||||||
@ -34,9 +33,8 @@ public class TaskPanel : Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async void InitTask()
|
public void InitTask()
|
||||||
{
|
{
|
||||||
await DestroyTaskAsync();
|
|
||||||
for(int i = 0; i < taskId.Count;i++)
|
for(int i = 0; i < taskId.Count;i++)
|
||||||
{
|
{
|
||||||
GameObject go = GameObject.Instantiate(taskPrefab, contentTrans);
|
GameObject go = GameObject.Instantiate(taskPrefab, contentTrans);
|
||||||
@ -46,24 +44,9 @@ public class TaskPanel : Base
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task DestroyTaskAsync()
|
|
||||||
{
|
|
||||||
DeleteAllChildObjects();
|
|
||||||
await Task.Delay(10);
|
|
||||||
}
|
|
||||||
public void DeleteAllChildObjects()
|
|
||||||
{
|
|
||||||
// 遍历所有子物体并删除
|
|
||||||
foreach (Transform child in contentTrans)
|
|
||||||
{
|
|
||||||
Destroy(child.gameObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetInfo(int id)
|
public void SetInfo(int id)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
taskId.Add(id);
|
taskId.Add(id);
|
||||||
InitTask();
|
InitTask();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user