docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ConditionalFormatter

    Provides conditional formatting on any placeholder that contains a "|" (pipe character) after the ":". For example: {0:cond:>10?Greater Than 10|=10?Equals to 10|Less than 10}

    Inheritance
    object
    FormatterBase
    ConditionalFormatter
    Implements
    IFormatter
    ISerializationCallbackReceiver
    IFormatterLiteralExtractor
    Inherited Members
    FormatterBase.Names
    Namespace: UnityEngine.Localization.SmartFormat.Extensions
    Assembly: Unity.Localization.dll
    Syntax
    [Serializable]
    public class ConditionalFormatter : FormatterBase, IFormatter, ISerializationCallbackReceiver, IFormatterLiteralExtractor

    Constructors

    Name Description
    ConditionalFormatter()

    Creates a new instance of the formatter.

    Properties

    Name Description
    DefaultNames

    Default names to use when Names is null.

    Methods

    Name Description
    TryEvaluateFormat(IFormattingInfo)

    Writes the current value to the output, using the specified format. IF this extension cannot write the value, returns false, otherwise true.

    WriteAllLiterals(IFormattingInfo)

    Ignores the format arguments and writes every possible literal value. This is used to extract all possible values so that we can determine the distinct characters for font generation etc.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)