docs.unity3d.com
    Show / Hide Table of Contents

    Struct Expander.ExpansionRule

    A rule used to determine how much the string length should be increased by.

    Namespace: UnityEngine.Localization.Pseudo
    Syntax
    public struct ExpansionRule : IComparable<Expander.ExpansionRule>

    Constructors

    ExpansionRule(Int32, Int32, Single)

    Create a new Expansion Rule instance.

    Declaration
    public ExpansionRule(int minCharacters, int maxCharacters, float expansion)
    Parameters
    Type Name Description
    Int32 minCharacters
    Int32 maxCharacters
    Single expansion

    Properties

    ExpansionAmount

    The amount to increase the string length by as a ratio where 0 is no expansion and 1.0 is 100%(double length). It varies per language but 0.3 is a good value when using English as the source language.

    Declaration
    public float ExpansionAmount { get; set; }
    Property Value
    Type Description
    Single

    MaxCharacters

    The maximum characters. The evaluated string length must be less than this value.

    Declaration
    public int MaxCharacters { get; set; }
    Property Value
    Type Description
    Int32

    MinCharacters

    The minimum characters. The evaluated string length must be equal or greater than this value.

    Declaration
    public int MinCharacters { get; set; }
    Property Value
    Type Description
    Int32

    Methods

    CompareTo(Expander.ExpansionRule)

    Used for sorting the expansion rules. Rules are sorted by the MinCharacters value.

    Declaration
    public int CompareTo(Expander.ExpansionRule other)
    Parameters
    Type Name Description
    Expander.ExpansionRule other
    Returns
    Type Description
    Int32
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023