Page 1 of 1

[HOWTO] How To: Integrate Arabic Support for Unity

Posted: Sun Apr 24, 2022 8:11 pm
by Tony Li
A user contributed the script below to integrate the free Arabic Support for Unity asset. Add it to the Dialogue Manager GameObject.

FixToArabic.cs

Code: Select all

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ArabicSupport;
using PixelCrushers.DialogueSystem;
 
public class FixToArabic : MonoBehaviour
{
   
   void OnConversationLine(Subtitle subtitle)
    {
        subtitle.formattedText.text = ArabicFixer.Fix(subtitle.formattedText.text, false, false);
    }
 
    void OnConversationResponseMenu(Response[] responses)
    {
        for (int i = 0; i < responses.Length; i++)
        {
            responses[i].formattedText.text = ArabicFixer.Fix(responses[i].formattedText.text, false, false);
        }
        
    }
}