docs.unity.cn
    Show / Hide Table of Contents

    Class CustomPluralRuleProvider

    Use this class to provide custom plural rules to Smart.Format

    Inheritance
    Object
    CustomPluralRuleProvider
    Namespace: UnityEngine.Localization.SmartFormat.Extensions
    Syntax
    public class CustomPluralRuleProvider : IFormatProvider

    Constructors

    CustomPluralRuleProvider(PluralRules.PluralRuleDelegate)

    Creates a new instance of the plural rule provider.

    Declaration
    public CustomPluralRuleProvider(PluralRules.PluralRuleDelegate pluralRule)
    Parameters
    Type Name Description
    UnityEngine.Localization.SmartFormat.Utilities.PluralRules.PluralRuleDelegate pluralRule

    The plural rule to use for this provider.

    Methods

    GetFormat(Type)

    Returns the formatter when formatType is CustomPluralRuleProvider, otherwise returns null.

    Declaration
    public object GetFormat(Type formatType)
    Parameters
    Type Name Description
    Type formatType
    Returns
    Type Description
    Object

    GetPluralRule()

    Returns the custom plural rule delegate.

    Declaration
    public PluralRules.PluralRuleDelegate GetPluralRule()
    Returns
    Type Description
    UnityEngine.Localization.SmartFormat.Utilities.PluralRules.PluralRuleDelegate
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Thursday, June 9, 2022
    Terms of use