diff --git a/Assets/Scenes/Demo.unity b/Assets/Scenes/Demo.unity index 6d324f5..eed7979 100644 --- a/Assets/Scenes/Demo.unity +++ b/Assets/Scenes/Demo.unity @@ -3735,6 +3735,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: Mismatched Sender forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &48612848 PrefabInstance: m_ObjectHideFlags: 0 @@ -11667,6 +11669,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: compose forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &152581993 stripped Transform: m_CorrespondingSourceObject: {fileID: 4837329652793204, guid: 88498815dea432045b6eaa9875ec268a, type: 3} @@ -17472,6 +17476,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: mail forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &232780965 stripped Transform: m_CorrespondingSourceObject: {fileID: 4245025388696848, guid: d6ede9f320f63de4f8bd9626df44ed6f, type: 3} @@ -31803,6 +31809,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: start forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &426522969 stripped Transform: m_CorrespondingSourceObject: {fileID: 4527185568398708, guid: 66924574c80a24a44bdf782e3e7635d0, type: 3} @@ -36334,6 +36342,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: All of the above forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &489090763 PrefabInstance: m_ObjectHideFlags: 0 @@ -36774,6 +36784,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: newEmail forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &490893920 PrefabInstance: m_ObjectHideFlags: 0 @@ -38459,6 +38471,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: WHY ITS DANGEROUS! forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &520169784 PrefabInstance: m_ObjectHideFlags: 0 @@ -40612,6 +40626,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: Mini Quiz forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &552026572 stripped Transform: m_CorrespondingSourceObject: {fileID: 4270791331071568, guid: f0bfb58546547264682d6066f7947e72, type: 3} @@ -49672,6 +49688,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: Typos in the subject forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &662615422 PrefabInstance: m_ObjectHideFlags: 0 @@ -50833,6 +50851,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: draft forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &681179751 PrefabInstance: m_ObjectHideFlags: 0 @@ -54681,6 +54701,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: hacked forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1 &737073898 GameObject: m_ObjectHideFlags: 0 @@ -64717,6 +64739,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: whyphishing forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &876342790 PrefabInstance: m_ObjectHideFlags: 0 @@ -70394,6 +70418,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: poweredby forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &936568817 PrefabInstance: m_ObjectHideFlags: 0 @@ -73321,6 +73347,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: How to be safe? forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &972988250 PrefabInstance: m_ObjectHideFlags: 0 @@ -77488,6 +77516,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: more forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &1030425952 stripped Transform: m_CorrespondingSourceObject: {fileID: 4270791331071568, guid: f0bfb58546547264682d6066f7947e72, type: 3} @@ -78879,6 +78909,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: starred forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &1053586557 stripped Transform: m_CorrespondingSourceObject: {fileID: 4560637100612226, guid: 5d6857de3de39ce469a62ba9dc765d25, type: 3} @@ -79121,6 +79153,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: What Were The Clues? forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &1059813799 stripped Transform: m_CorrespondingSourceObject: {fileID: 4742576163013064, guid: 68acf050fd2a7d7438895bae4b02b1b0, type: 3} @@ -88619,6 +88653,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: notsuspicious forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &1197210934 stripped Transform: m_CorrespondingSourceObject: {fileID: 4598856690569718, guid: 3ec74bf586541a64386d798159775c05, type: 3} @@ -97353,9 +97389,9 @@ MonoBehaviour: m_HorizontalAlignment: 1 m_VerticalAlignment: 256 m_textAlignment: 65535 - m_characterSpacing: -10 + m_characterSpacing: 0 m_wordSpacing: 0 - m_lineSpacing: -39.49 + m_lineSpacing: 0 m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 @@ -97407,6 +97443,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: whatwerethecluessummary forceRightAlignment: 1 + forceSpacingBool: 1 + charLineSpacing: {x: -10, y: -39.49} --- !u!1001 &1321965012 PrefabInstance: m_ObjectHideFlags: 0 @@ -103639,6 +103677,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: phishingawareness forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &1406236233 stripped Transform: m_CorrespondingSourceObject: {fileID: 4598856690569718, guid: 3ec74bf586541a64386d798159775c05, type: 3} @@ -103793,6 +103833,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: sent forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &1407036543 PrefabInstance: m_ObjectHideFlags: 0 @@ -122464,6 +122506,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: inbox forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &1665812592 PrefabInstance: m_ObjectHideFlags: 0 @@ -122941,6 +122985,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: inbox forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &1674054030 PrefabInstance: m_ObjectHideFlags: 0 @@ -124796,6 +124842,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: search forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &1701751480 stripped Transform: m_CorrespondingSourceObject: {fileID: 4204627924666460, guid: 7e3a842bda3e7424e9fede8bc029c9fa, type: 3} @@ -133046,6 +133094,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: alwaysreport forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &1832389832 stripped Transform: m_CorrespondingSourceObject: {fileID: 4808176449061188, guid: 6fcbb7c2744bf764f9c7f6f46767b77f, type: 3} @@ -139503,6 +139553,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: What was the biggest red flag in this phishing email? forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &1934084553 stripped Transform: m_CorrespondingSourceObject: {fileID: 4429576471617264, guid: e1b7acc66a1570041b8dee59003c793d, type: 3} @@ -148160,6 +148212,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: TIMELINE OF ACTIONS forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!1001 &2055927760 PrefabInstance: m_ObjectHideFlags: 0 @@ -148521,7 +148575,7 @@ MonoBehaviour: m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 - m_lineSpacing: -40 + m_lineSpacing: 0 m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 @@ -148573,6 +148627,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: howtobesafesummary forceRightAlignment: 1 + forceSpacingBool: 1 + charLineSpacing: {x: 0, y: -40} --- !u!1001 &2060737185 PrefabInstance: m_ObjectHideFlags: 0 @@ -149508,6 +149564,8 @@ MonoBehaviour: m_EditorClassIdentifier: localizationKey: Urgent Language forceRightAlignment: 0 + forceSpacingBool: 0 + charLineSpacing: {x: 0, y: 0} --- !u!4 &2069515845 stripped Transform: m_CorrespondingSourceObject: {fileID: 4285425695655684, guid: f5e290f6142a51a42a0a9b85f2c115a5, type: 3} diff --git a/Assets/Scripts/LocalizedTextComponent.cs b/Assets/Scripts/LocalizedTextComponent.cs index 7cc92c1..5a42b9a 100644 --- a/Assets/Scripts/LocalizedTextComponent.cs +++ b/Assets/Scripts/LocalizedTextComponent.cs @@ -8,6 +8,8 @@ public class LocalizedTextComponent : MonoBehaviour public string localizationKey; private TextMeshProUGUI tmp; public bool forceRightAlignment = false; + public bool forceSpacingBool= false; + public Vector2 charLineSpacing; private void Start() { tmp = GetComponent(); @@ -70,6 +72,12 @@ public class LocalizedTextComponent : MonoBehaviour } if (forceRightAlignment && isArabic) tmp.alignment = TextAlignmentOptions.Right; + + if(forceSpacingBool && isArabic) + { + tmp.characterSpacing = charLineSpacing.x; + tmp.lineSpacing = charLineSpacing.y; + } tmp.font = LanguageManager.Instance.GetCurrentFont(); tmp.ForceMeshUpdate(); }