58 lines
1.4 KiB
C#
58 lines
1.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UI.Dates;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
/// <summary>
|
|
/// 任务清单中单一任务
|
|
/// </summary>
|
|
public class TaskItem : MonoBehaviour
|
|
{
|
|
public DatePicker datePicker;
|
|
public Button doingRoles;
|
|
public InputField reason;
|
|
public Button editButton;
|
|
public Button saveButton;
|
|
|
|
public RectTransform logItem;
|
|
public RectTransform logParent;
|
|
|
|
public void Awake()
|
|
{
|
|
saveButton.interactable = false;
|
|
editButton.interactable = true;
|
|
doingRoles.interactable = false;
|
|
reason.interactable = false;
|
|
reason.text = "";
|
|
editButton.onClick.AddListener(OnEdit);
|
|
saveButton.onClick.AddListener(OnSave);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 编辑按钮事件
|
|
/// </summary>
|
|
private void OnEdit()
|
|
{
|
|
saveButton.interactable = true;
|
|
editButton.interactable = false;
|
|
doingRoles.interactable = true;
|
|
reason.interactable = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存按钮事件
|
|
/// </summary>
|
|
private void OnSave()
|
|
{
|
|
saveButton.interactable = false;
|
|
editButton.interactable = true;
|
|
doingRoles.interactable = false;
|
|
reason.interactable = false;
|
|
|
|
|
|
UIUtils.Instance.AddItemToScrollView(logItem, logParent);
|
|
|
|
logParent.GetChild(logParent.childCount - 1).GetComponent<LogItem>().SetDesc("");
|
|
}
|
|
} |