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 |