Example #1
0
        private void AddColorGradientPreset_Internal(int hashCode, TextGradientPreset spriteAsset)
        {
            bool flag = this.m_ColorGradientReferenceLookup.ContainsKey(hashCode);

            if (!flag)
            {
                this.m_ColorGradientReferenceLookup.Add(hashCode, spriteAsset);
            }
        }
        /// <summary>
        /// Internal method to add a new Color Gradient Preset to the dictionary.
        /// </summary>
        /// <param name="hashCode"></param>
        /// <param name="spriteAsset"></param>
        void AddColorGradientPreset_Internal(int hashCode, TextGradientPreset spriteAsset)
        {
            if (m_ColorGradientReferenceLookup.ContainsKey(hashCode))
            {
                return;
            }

            // Add reference to Color Gradient Preset Asset.
            m_ColorGradientReferenceLookup.Add(hashCode, spriteAsset);
        }
Example #3
0
        /// <summary>
        /// Internal function returning the Color Gradient Preset corresponding to the provided hash code.
        /// </summary>
        /// <param name="hashCode"></param>
        /// <param name="gradientPreset"></param>
        /// <returns></returns>
        bool TryGetColorGradientPresetInternal(int hashCode, out TextGradientPreset gradientPreset)
        {
            gradientPreset = null;

            if (m_ColorGradientReferenceLookup.TryGetValue(hashCode, out gradientPreset))
            {
                return(true);
            }

            return(false);
        }
        public void Copy(TextGenerationSettings other)
        {
            bool flag = other == null;

            if (!flag)
            {
                this.text                   = other.text;
                this.screenRect             = other.screenRect;
                this.margins                = other.margins;
                this.scale                  = other.scale;
                this.fontAsset              = other.fontAsset;
                this.material               = other.material;
                this.spriteAsset            = other.spriteAsset;
                this.fontStyle              = other.fontStyle;
                this.textAlignment          = other.textAlignment;
                this.overflowMode           = other.overflowMode;
                this.wordWrap               = other.wordWrap;
                this.wordWrappingRatio      = other.wordWrappingRatio;
                this.color                  = other.color;
                this.fontColorGradient      = other.fontColorGradient;
                this.tintSprites            = other.tintSprites;
                this.overrideRichTextColors = other.overrideRichTextColors;
                this.fontSize               = other.fontSize;
                this.autoSize               = other.autoSize;
                this.fontSizeMin            = other.fontSizeMin;
                this.fontSizeMax            = other.fontSizeMax;
                this.enableKerning          = other.enableKerning;
                this.richText               = other.richText;
                this.isRightToLeft          = other.isRightToLeft;
                this.extraPadding           = other.extraPadding;
                this.parseControlCharacters = other.parseControlCharacters;
                this.characterSpacing       = other.characterSpacing;
                this.wordSpacing            = other.wordSpacing;
                this.lineSpacing            = other.lineSpacing;
                this.paragraphSpacing       = other.paragraphSpacing;
                this.lineSpacingMax         = other.lineSpacingMax;
                this.maxVisibleCharacters   = other.maxVisibleCharacters;
                this.maxVisibleWords        = other.maxVisibleWords;
                this.maxVisibleLines        = other.maxVisibleLines;
                this.firstVisibleCharacter  = other.firstVisibleCharacter;
                this.useMaxVisibleDescender = other.useMaxVisibleDescender;
                this.fontWeight             = other.fontWeight;
                this.pageToDisplay          = other.pageToDisplay;
                this.horizontalMapping      = other.horizontalMapping;
                this.verticalMapping        = other.verticalMapping;
                this.uvLineOffset           = other.uvLineOffset;
                this.geometrySortingOrder   = other.geometrySortingOrder;
                this.inverseYAxis           = other.inverseYAxis;
                this.charWidthMaxAdj        = other.charWidthMaxAdj;
            }
        }
 /// <summary>
 /// Function returning the Color Gradient Preset corresponding to the provided hash code.
 /// </summary>
 /// <param name="hashCode"></param>
 /// <param name="gradientPreset"></param>
 /// <returns></returns>
 public static bool TryGetColorGradientPreset(int hashCode, out TextGradientPreset gradientPreset)
 {
     return(instance.TryGetColorGradientPresetInternal(hashCode, out gradientPreset));
 }
 /// <summary>
 /// Add new Color Gradient Preset to dictionary.
 /// </summary>
 /// <param name="hashCode"></param>
 /// <param name="spriteAsset"></param>
 public static void AddColorGradientPreset(int hashCode, TextGradientPreset spriteAsset)
 {
     instance.AddColorGradientPreset_Internal(hashCode, spriteAsset);
 }
Example #7
0
 public static void AddColorGradientPreset(int hashCode, TextGradientPreset spriteAsset)
 {
     MaterialReferenceManager.instance.AddColorGradientPreset_Internal(hashCode, spriteAsset);
 }
Example #8
0
 private bool TryGetColorGradientPresetInternal(int hashCode, out TextGradientPreset gradientPreset)
 {
     gradientPreset = null;
     return(this.m_ColorGradientReferenceLookup.TryGetValue(hashCode, out gradientPreset));
 }
Example #9
0
 public static bool TryGetColorGradientPreset(int hashCode, out TextGradientPreset gradientPreset)
 {
     return(MaterialReferenceManager.instance.TryGetColorGradientPresetInternal(hashCode, out gradientPreset));
 }