PWAAT - DoubleQuotationAdjustment

Back to Home

The DoubleQuotationAdjustment class is a subclass of the BaseMessageTextEffect class. It is used to adjust the position of double quotation marks in a text message, depending on the language and alignment of the text.

Here is the class declaration:


  public class DoubleQuotationAdjustment : BaseMessageTextEffect
      

The main method in this class is MessageModifyMesh. It modifies the vertices of the text mesh to adjust the position of the double quotation marks. Here is the method signature:


  public override void MessageModifyMesh(ref List<UIVertex> stream)
      

The method CountChar is a helper method that counts the number of occurrences of a specific character in a string. Here is the method signature:


  private int CountChar(string s, char c)
      

The class also contains several private fields that store the adjustment values for different scenarios. Here are the field declarations:


  [SerializeField]
  private float alignment_upperleft_quotation_diff_ = 34f;

  [SerializeField]
  private float alignment_upperleft_quotation_diff_china_s_ = 32f;

  [SerializeField]
  private float alignment_uppercenter_quotation_diff_ = 25f;

  [SerializeField]
  private float alignment_uppercenter_quotation_diff_china_s_ = 24f;

  [SerializeField]
  private float diaeresis_i_diff_ = 2.8f;
      

And finally, the class contains several constant character fields that represent the characters to be adjusted. Here are the field declarations:


  private const char BEGIN_QUOTATION = '“';
  private const char END_QUOTATION = '”';
  private const char DIAERESIS_I = 'ï';