1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections.Generic;
- public class TestScript : MonoBehaviour
- {
- #region Config
- //StartMark-Used by LabelUtility-Do not remove
- private Text Title;
- private Text Content;
- private Button Button;
- private Button NewButton;
- private Transform Panel;
- //EndMark-Used by LabelUtility-Do not remove
- #endregion
- private void Regist()
- {
- //RegistStartMark-Used by LabelUtility-Do not remove
- Dictionary<string, Transform> childDictionary = new Dictionary<string, Transform>();
- Auxiliary.CompileDic(transform, childDictionary);
- Title = childDictionary[TestLabel.Title].GetComponent<Text>();
- Content = childDictionary[TestLabel.Content].GetComponent<Text>();
- Button = childDictionary[TestLabel.Button].GetComponent<Button>();
- NewButton = childDictionary[TestLabel.NewButton].GetComponent<Button>();
- Panel = childDictionary[TestLabel.Panel].GetComponent<Transform>();
- //RegistEndMark-Used by LabelUtility-Do not remove
- //RegistEventStartMark-Used by LabelUtility-Do not remove
- Button.onClick.AddListener(OnButtonClick);
- NewButton.onClick.AddListener(OnNewButtonClick);
- //RegistEventEndMark-Used by LabelUtility-Do not remove
- }
- //EventStartMark-Used by LabelUtility-Do not remove
- private void OnButtonClick()
- {
- Debug.Log(1);
- }
-
- private void OnNewButtonClick()
- {
- }
- //EventEndMark-Used by LabelUtility-Do not remove
- }
|