完善Task的UI数据传递和刷新。
This commit is contained in:
@@ -7,7 +7,7 @@ using UnityEngine.UI;
|
||||
|
||||
namespace TcgEngine.UI
|
||||
{
|
||||
public class TaskItem : MonoBehaviour
|
||||
public class TaskItem : UIPanel
|
||||
{
|
||||
public string taskID;
|
||||
|
||||
@@ -18,10 +18,20 @@ namespace TcgEngine.UI
|
||||
|
||||
public Button reward_button;
|
||||
public Image reward_icon;
|
||||
|
||||
public Image taskEnd_img;
|
||||
|
||||
private PlayerTask playerTask;
|
||||
private TaskData taskConfig;
|
||||
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
Show();
|
||||
taskEnd_img.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void SetTask(TaskData config, PlayerTask task)
|
||||
{
|
||||
taskID = config.id;
|
||||
@@ -41,6 +51,11 @@ namespace TcgEngine.UI
|
||||
reward_button.onClick.RemoveAllListeners();
|
||||
reward_button.onClick.AddListener(OnClickReward);
|
||||
|
||||
if (task.status == TaskStatus.Expired || task.status == TaskStatus.Claimed)
|
||||
{
|
||||
taskEnd_img.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
RefreshStatus();
|
||||
|
||||
}
|
||||
@@ -59,9 +74,7 @@ namespace TcgEngine.UI
|
||||
progressBar_slider.value = playerTask.progress;
|
||||
progressBar_text.text = playerTask.progress + "/" + taskConfig.value1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void RewardColl(Sprite icon)
|
||||
{
|
||||
if (reward_icon != null)
|
||||
|
||||
Reference in New Issue
Block a user