UnityEngine.TextGenerator.ValidatedSettings C# (CSharp) Method

ValidatedSettings() private method

private ValidatedSettings ( TextGenerationSettings settings ) : TextGenerationSettings
settings TextGenerationSettings
return TextGenerationSettings
        private TextGenerationSettings ValidatedSettings(TextGenerationSettings settings)
        {
            if ((settings.font == null) || !settings.font.dynamic)
            {
                if ((settings.fontSize != 0) || (settings.fontStyle != FontStyle.Normal))
                {
                    if (settings.font != null)
                    {
                        object[] args = new object[] { settings.font.name };
                        Debug.LogWarningFormat(settings.font, "Font size and style overrides are only supported for dynamic fonts. Font '{0}' is not dynamic.", args);
                    }
                    settings.fontSize = 0;
                    settings.fontStyle = FontStyle.Normal;
                }
                if (settings.resizeTextForBestFit)
                {
                    if (settings.font != null)
                    {
                        object[] objArray2 = new object[] { settings.font.name };
                        Debug.LogWarningFormat(settings.font, "BestFit is only supported for dynamic fonts. Font '{0}' is not dynamic.", objArray2);
                    }
                    settings.resizeTextForBestFit = false;
                }
            }
            return settings;
        }