docs.unity3d.com
    目次を表示する/隠す

    Class TemplateFormatter

    Template Formatter allows for registering reusable templates, and use them by name.

    Inheritance
    Object
    FormatterBase
    TemplateFormatter
    Inherited Members
    FormatterBase.Names
    Namespace: UnityEngine.Localization.SmartFormat.Extensions
    Syntax
    [Serializable]
    public class TemplateFormatter : FormatterBase, IFormatter, ISerializationCallbackReceiver

    Constructors

    TemplateFormatter()

    Creates a new instance of the formatter.

    Declaration
    public TemplateFormatter()

    Properties

    DefaultNames

    Default names to use when Names is null.

    Declaration
    public override string[] DefaultNames { get; }
    Property Value
    Type Description
    String[]
    Overrides
    FormatterBase.DefaultNames

    Formatter

    The SmartFormatter that the formatter is part of.

    Declaration
    public SmartFormatter Formatter { get; set; }
    Property Value
    Type Description
    SmartFormatter

    Methods

    Clear()

    Remove all templates.

    Declaration
    public void Clear()

    Register(String, String)

    Register a new template.

    Declaration
    public void Register(string templateName, string template)
    Parameters
    Type Name Description
    String templateName

    A name for the template, which is not already registered.

    String template

    The string to be used as a template.

    Remove(String)

    Remove a template by its name.

    Declaration
    public bool Remove(string templateName)
    Parameters
    Type Name Description
    String templateName
    Returns
    Type Description
    Boolean

    TryEvaluateFormat(IFormattingInfo)

    This method is called by the SmartFormatter to obtain the formatting result of this extension.

    Declaration
    public override bool TryEvaluateFormat(IFormattingInfo formattingInfo)
    Parameters
    Type Name Description
    IFormattingInfo formattingInfo
    Returns
    Type Description
    Boolean

    Returns true if successful, else false.

    Overrides
    FormatterBase.TryEvaluateFormat(IFormattingInfo)
    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)