JieKouRiZhiItem.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using LitJson;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class JieKouRiZhiItem : MonoBehaviour
  7. {
  8. public Text call_name;
  9. public Text call_date;
  10. public Text source;
  11. public Text input;
  12. public Text output;
  13. public Text result;
  14. public Text receive_date;
  15. public void init(JsonData data)
  16. {
  17. call_name.text = data["call_name"].ToString();
  18. call_date.text = data["call_date"].ToString();
  19. source.text = data["source"].ToString();
  20. input.text = data["input"].ToString();
  21. output.text = data["output"].ToString();
  22. result.text = data["result"].ToString();
  23. receive_date.text = data["receive_date"].ToString();
  24. call_name.GetComponent<ContentSizeFitter>().SetLayoutVertical();
  25. call_name.transform.parent.GetComponent<ContentSizeFitter>().SetLayoutVertical();
  26. input.GetComponent<ContentSizeFitter>().SetLayoutVertical();
  27. input.transform.parent.GetComponent<ContentSizeFitter>().SetLayoutVertical();
  28. output.GetComponent<ContentSizeFitter>().SetLayoutVertical();
  29. output.transform.parent.GetComponent<ContentSizeFitter>().SetLayoutVertical();
  30. }
  31. }