Exemplo n.º 1
0
        public OnClickEvent OnClick = new OnClickEvent(); // 点击了此结点

        void OnEnable()
        {
            if (d_symbolText == null)
            {
                d_symbolText = GetComponent <SymbolText>();
            }
        }
Exemplo n.º 2
0
        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(wordSpacing);
            if (wordSpacing.intValue < 0)
            {
                wordSpacing.intValue = 0;
            }

            // 最小行高
            EditorGUILayout.PropertyField(m_MinLineHeight);

            // 是否开启字体高度修正
            EditorGUILayout.PropertyField(m_isCheckFontY);

            OnGUIOther();

            if (serializedObject.ApplyModifiedProperties())
            {
                SymbolText st = target as SymbolText;
                st.SetAllDirty();
            }
        }
Exemplo n.º 3
0
        protected virtual void OnGUIOther()
        {
            SymbolText st = target as SymbolText;

            // modify by Johance 此处需要检测值是否修改了。 主要是内部isArabic没有做数值变化的检测。
            if (EditorGUILayout.Toggle("Arabic Mode", st.isArabic) != st.isArabic)
            {
                st.isArabic = !st.isArabic;
            }
        }
Exemplo n.º 4
0
        static public void AddSymbolText(MenuCommand menuCommand)
        {
            GameObject go = DefaultControls.CreateText(GetStandardResources());

            Object.DestroyImmediate(go.GetComponent <Text>());
            SymbolText st = go.AddComponent <SymbolText>();

            st.raycastTarget       = false;
            st.rectTransform.pivot = Vector2.zero;

            PlaceUIElementRoot(go, menuCommand);
        }
Exemplo n.º 5
0
        protected override void OnGUIOther()
        {
            SymbolText st = target as SymbolText;

            // modify by Johance 此处需要检测值是否修改了。 主要是内部isArabic没有做数值变化的检测。
            if (EditorGUILayout.Toggle("Arabic Mode", st.isArabic) != st.isArabic)
            {
                st.isArabic = !st.isArabic;
            }

            if (m_MaxElement == null)
            {
                m_MaxElement = serializedObject.FindProperty("m_MaxElement");
            }

            EditorGUILayout.PropertyField(m_MaxElement);
        }