public OnClickEvent OnClick = new OnClickEvent(); // 点击了此结点 void OnEnable() { if (d_symbolText == null) { d_symbolText = GetComponent <SymbolText>(); } }
public override void OnInspectorGUI() { serializedObject.Update(); OnGUIFontData(); //AppearanceControlsGUI(); RaycastControlsGUI(); EditorGUILayout.PropertyField(m_LineAlignment); // 元素分割类型 { List <string> alles = new List <string>(); alles.Add("Empty"); alles.AddRange(ESFactory.GetAllName()); int current = alles.IndexOf(m_ElementSegment.stringValue); if (current == -1) { current = 0; } int[] optionValues = new int[alles.Count]; for (int i = 0; i < optionValues.Length; ++i) { optionValues[i] = i; } current = EditorGUILayout.IntPopup("Element Segment", current, alles.ToArray(), optionValues); if (current <= 0) { m_ElementSegment.stringValue = null; } else { m_ElementSegment.stringValue = alles[current]; } } // 最小行高 EditorGUILayout.PropertyField(m_MinLineHeight); // 是否开启字体高度修正 EditorGUILayout.PropertyField(m_isCheckFontY); OnGUIOther(); if (serializedObject.ApplyModifiedProperties()) { SymbolText st = target as SymbolText; st.SetAllDirty(); } }