Beispiel #1
0
        protected virtual void PlaceholderGUI()
        {
            isPlaceholder = EditorGUILayout.Foldout(isPlaceholder, "__Is Use Placeholder");
            if (isPlaceholder != BaseOwner.IsPlaceholder)
            {
                BaseOwner.IsPlaceholderChange(isPlaceholder);
            }
            using (new EditorGUI.IndentLevelScope())
            {
                if (isPlaceholder)
                {
                    bool isChanged = false;
                    placeholder = EditorGUILayout.DelayedTextField("Placeholder", placeholder);
                    if (placeholder != BaseOwner.Placeholder?.text)
                    {
                        BaseOwner.PlaceholderValueChange(placeholder);
                        isChanged = true;
                    }

                    placeholderColor = EditorGUILayout.ColorField("Color", placeholderColor);
                    if (placeholderColor != BaseOwner.PlaceholderColor)
                    {
                        BaseOwner.PlaceholderColorChange(placeholderColor);
                        isChanged = true;
                    }

                    fontSize = EditorGUILayout.DelayedFloatField("Font Size", fontSize);
                    if (!Mathf.Approximately(fontSize, BaseOwner.FontSize))
                    {
                        BaseOwner.FontSizeChange(fontSize);
                        isChanged = true;
                    }
                    if (isChanged)
                    {
                        EditorUtility.SetDirty(BaseOwner.Placeholder);
                    }
                }
            }
        }