private void OnEnable() { dropdown = serializedObject.targetObject as KGUI_Dropdown; if (buttonType == null) { buttonType = new KGUIButtonTypeEditor(); } if (buttonAudio == null) { buttonAudio = new KGUIButtonAudioEditor(); } buttonType.OnInstantiation(serializedObject); buttonAudio.OnInstantiation(serializedObject); Names = serializedObject.FindProperty("Names"); ScrollView = serializedObject.FindProperty("scrollView"); Template = serializedObject.FindProperty("Template"); textName = serializedObject.FindProperty("textName"); gridLayout = serializedObject.FindProperty("gridLayout"); dropdownItem = serializedObject.FindProperty("dropdownItem"); }
/// <summary> /// 初始化 /// </summary> public void OnInitialized(KGUI_Dropdown dropdown, string name) { buttonGroup = dropdown.buttonGroup; IsButtonGroup = true; if (text == null) { text = gameObject.GetComponentInChildren <Text>(); } text.text = name; Name = name; this.dropdown = dropdown; }