| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class B08_TaskListItem : MonoBehaviour
- {
- public Text typeText;
- public Text titleText;
- public Text stateText;
- public Text dateText;
- public Text ctrlText;
- public GameObject more;
-
-
- public Button moreButton;
- public bool moreMessage = false;
- public RectTransform rect;
- public void Init()
- {
- rect = this.GetComponent<RectTransform>();
- typeText = this.transform.Find("typeText").GetComponent<Text>();
- titleText = this.transform.Find("titleText").GetComponent<Text>();
- stateText = this.transform.Find("stateText").GetComponent<Text>();
- dateText = this.transform.Find("dateText").GetComponent<Text>();
- ctrlText = this.transform.Find("ctrlText").GetComponent<Text>();
- more = this.transform.Find("more").gameObject;
-
- more.SetActive(false);
-
- moreButton = ctrlText.GetComponent<Button>();
- moreButton.onClick.AddListener(ChangeMoreMessage);
- }
- public void ChangeMoreMessage()
- {
- if (moreMessage)
- {
- ctrlText.text = "详情";
- rect.sizeDelta = new Vector2(360,38);
- more.SetActive(false);
- }
- else
- {
- ctrlText.text = "收起";
- rect.sizeDelta = new Vector2(360,254);
- more.SetActive(true);
- }
- moreMessage = !moreMessage;
- }
- }
|