|
|
|
@ -10,33 +10,46 @@ namespace UltraCombos.Marvel.DrawHeroes |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class ThaiAdjust : MonoBehaviour |
|
|
|
public class ThaiAdjust : MonoBehaviour |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
string current_language; |
|
|
|
|
|
|
|
bool is_bold; |
|
|
|
void Start() |
|
|
|
void Start() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Debug.Log("start"); |
|
|
|
Debug.Log("start"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var text=GetComponent<TMP_Text>(); |
|
|
|
|
|
|
|
is_bold=(text.fontStyle & FontStyles.Bold) != 0; |
|
|
|
|
|
|
|
|
|
|
|
fix(); |
|
|
|
fix(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Update() |
|
|
|
void Update() |
|
|
|
{ |
|
|
|
{ |
|
|
|
// fix(); |
|
|
|
fix(); |
|
|
|
} |
|
|
|
} |
|
|
|
void fix(){ |
|
|
|
void fix(){ |
|
|
|
var current=I2.Loc.LocalizationManager.CurrentLanguage; |
|
|
|
var current=I2.Loc.LocalizationManager.CurrentLanguage; |
|
|
|
|
|
|
|
if(current_language==current) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
current_language=current; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var text=GetComponent<TMP_Text>(); |
|
|
|
var text=GetComponent<TMP_Text>(); |
|
|
|
|
|
|
|
|
|
|
|
if(current!="Thai"){ |
|
|
|
if(current!="Thai"){ |
|
|
|
text.margin=new Vector4(0,0,0,0); |
|
|
|
text.margin=new Vector4(0,0,0,0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(is_bold){ |
|
|
|
|
|
|
|
text.fontStyle |= FontStyles.Bold; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
var adjust=ThaiFontAdjuster.Adjust(text.text); |
|
|
|
var adjust=ThaiFontAdjuster.Adjust(text.text); |
|
|
|
|
|
|
|
|
|
|
|
bool isBold = (text.fontStyle & FontStyles.Bold) != 0; |
|
|
|
if(is_bold) |
|
|
|
if(isBold) |
|
|
|
|
|
|
|
text.fontStyle ^= FontStyles.Bold; |
|
|
|
text.fontStyle ^= FontStyles.Bold; |
|
|
|
|
|
|
|
|
|
|
|
text.margin=text.margin+new Vector4(0,-text.fontSize*.3f,0,0); |
|
|
|
text.margin=text.margin+new Vector4(0,-text.fontSize*.3f,0,0); |
|
|
|
|