TestScript.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections.Generic;
  4. public class TestScript : MonoBehaviour
  5. {
  6. #region Config
  7. //StartMark-Used by LabelUtility-Do not remove
  8. private Text Title;
  9. private Text Content;
  10. private Button Button;
  11. private Button NewButton;
  12. private Transform Panel;
  13. //EndMark-Used by LabelUtility-Do not remove
  14. #endregion
  15. private void Regist()
  16. {
  17. //RegistStartMark-Used by LabelUtility-Do not remove
  18. Dictionary<string, Transform> childDictionary = new Dictionary<string, Transform>();
  19. Auxiliary.CompileDic(transform, childDictionary);
  20. Title = childDictionary[TestLabel.Title].GetComponent<Text>();
  21. Content = childDictionary[TestLabel.Content].GetComponent<Text>();
  22. Button = childDictionary[TestLabel.Button].GetComponent<Button>();
  23. NewButton = childDictionary[TestLabel.NewButton].GetComponent<Button>();
  24. Panel = childDictionary[TestLabel.Panel].GetComponent<Transform>();
  25. //RegistEndMark-Used by LabelUtility-Do not remove
  26. //RegistEventStartMark-Used by LabelUtility-Do not remove
  27. Button.onClick.AddListener(OnButtonClick);
  28. NewButton.onClick.AddListener(OnNewButtonClick);
  29. //RegistEventEndMark-Used by LabelUtility-Do not remove
  30. }
  31. //EventStartMark-Used by LabelUtility-Do not remove
  32. private void OnButtonClick()
  33. {
  34. Debug.Log(1);
  35. }
  36. private void OnNewButtonClick()
  37. {
  38. }
  39. //EventEndMark-Used by LabelUtility-Do not remove
  40. }