B08_TaskPointItem.cs 758 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class B08_TaskPointItem : MonoBehaviour
  7. {
  8. public int itemIndex;
  9. public Text posAndtimeText;
  10. public Text messageText;
  11. public Button imgButton;
  12. private GCYWLayer gcywLayer;
  13. private void Awake()
  14. {
  15. imgButton.onClick.AddListener(() =>
  16. {
  17. gcywLayer.OpenTaskImgPanel();
  18. });
  19. }
  20. public void SetData(GCYWLayer baseLayer,B08_TaskItems data,int index,string time)
  21. {
  22. gcywLayer = baseLayer;
  23. itemIndex = index;
  24. posAndtimeText.text = $"{(index==0?"起点":"")} <color=#A5BFE2>{time}</color>";
  25. messageText.text = $"{data.item_name}";
  26. }
  27. }