public static IsThaiString ( string s ) : bool | ||
s | string | |
return | bool |
void Display() { if (PageData.isShowYokaiDetail) { _library.SetActive(false); _detail.SetActive(true); _backLibrary.SetActive(true); if (ApplicationData.YokaiData.Exists(s => s.id == UserData.GetUserInfo().yokais.Last().yokai_id)) { var d = ApplicationData.YokaiData.Where(s => s.id == UserData.GetUserInfo().yokais.Last().yokai_id).First(); _image.GetComponent <Image>().sprite = d.image; if (d.kana != "" && ApplicationData.SelectedLanguage == LanguageType.Japanese) { _name.GetComponent <Text>().text = d.localNames[(int)ApplicationData.SelectedLanguage].text; _kana.GetComponent <Text>().text = d.kana; _name.GetComponent <Text>().fontSize = 90; } else { if (ThaiFontAdjuster.IsThaiString(d.localNames[(int)ApplicationData.SelectedLanguage].text.ToString())) { _name.GetComponent <Text>().text = ThaiFontAdjuster.Adjust(d.localNames[(int)ApplicationData.SelectedLanguage].text.ToString()); _kana.GetComponent <Text>().text = ""; _name.GetComponent <Text>().font = ApplicationData.GetFont(4); _name.GetComponent <Text>().fontSize = 110; } else { _name.GetComponent <Text>().text = d.localNames[(int)ApplicationData.SelectedLanguage].text; _kana.GetComponent <Text>().text = ""; _name.GetComponent <Text>().fontSize = 90; } } _description.GetComponent <Text>().text = d.localContents[(int)ApplicationData.SelectedLanguage].text; if (ApplicationData.SelectedLanguage == LanguageType.Thai) { _description.GetComponent <Text>().font = ApplicationData.GetFont(4); _description.GetComponent <Text>().fontSize = 62; _description.GetComponent <Text>().text = ThaiFontAdjuster.Adjust(d.localContents[(int)ApplicationData.SelectedLanguage].text); } else { _description.GetComponent <Text>().font = ApplicationData.GetFont(2); _description.GetComponent <Text>().fontSize = 42; } } } PageData.Initialize(); }
public string TextAdjust() { string value = defaultText.Replace("\\n", "\n"); float boxwidth = GetBoxWidth(); onWrapChange = false; if (ThaiFontAdjuster.IsThaiString(value)) { if (base.horizontalOverflow == HorizontalWrapMode.Wrap) { base.text = ThaiWrappingText(value, boxwidth); } else { base.text = ThaiFontAdjuster.Adjust(value); } } base.text = System.Text.RegularExpressions.Regex.Unescape(base.text); return(base.text); }
void OnEnable() { MapPageManager.instance.SetMapPage(0, 0, -6, RenderMode.ScreenSpaceCamera); if (PageData.yokaiID != -1) { objYokai.SetActive(true); objItem.SetActive(false); } if (PageData.itemID != -1) { objItem.SetActive(true); objYokai.SetActive(false); } kindOfObject = GameObject.FindGameObjectWithTag("MapEffect").transform.Find("MapCircle").transform.Find("FireMagic").gameObject; backgroundCam.GetComponent <CameraAsBackground> ().CameraStart(); if (GameObject.FindGameObjectWithTag("ParentTutorial").transform.childCount == 0) { backgroundCam.transform.SetParent(GameObject.FindGameObjectWithTag("ParentTutorial").transform); } sprYCircle.transform.localScale = new Vector3(1.2f, 1.2f, 1.2f); #region Enable the map effect mapEffect = GameObject.FindGameObjectWithTag("MapEffect"); mapEffect.transform.GetChild(0).gameObject.SetActive(true); #endregion #region Enable the third Camera yokaiCam = GameObject.FindGameObjectWithTag("YokaiCamera"); yokaiCam.transform.GetChild(0).gameObject.SetActive(true); #endregion #region Pinch Zoom the map map = GameObject.FindGameObjectWithTag("Map"); map.transform.GetChild(1).gameObject.SetActive(true); map.transform.GetChild(1).gameObject.GetComponent <PinchZoom> ().enabled = false; map.transform.GetChild(1).gameObject.GetComponent <lb_drag> ().enabled = false; map.transform.GetChild(1).GetComponent <MeshCollider>().enabled = false; #endregion if (objYokai.activeSelf) { kindOfObject.GetComponent <MeshRenderer> ().material = fireMat; kindOfObject.transform.localScale = new Vector3(.1f, .1f, .2f); } else if (objItem.activeSelf) { kindOfObject.GetComponent <MeshRenderer> ().material = itemMat; kindOfObject.transform.localScale = new Vector3(.2f, .1f, .2f); } FireEffect(true); for (int i = 0; i < ApplicationData.YokaiGetTutorialData.Count; i++) { if (ThaiFontAdjuster.IsThaiString(ApplicationData.YokaiGetTutorialData[i].localContents[(int)ApplicationData.SelectedLanguage].text.ToString())) { yokai[i].GetComponentsInChildren <Text>(true)[0].text = ThaiFontAdjuster.Adjust(ApplicationData.YokaiGetTutorialData[i].localContents[(int)ApplicationData.SelectedLanguage].text.ToString()); yokai[i].GetComponentsInChildren <Text>(true)[0].fontSize += 20; } else { yokai[i].GetComponentsInChildren <Text>(true)[0].text = ApplicationData.YokaiGetTutorialData[i].localContents[(int)ApplicationData.SelectedLanguage].text.ToString(); yokai[i].GetComponentsInChildren <Text>(true)[0].fontSize = 42; } yokai [i].GetComponentsInChildren <Text> (true) [0].font = ChangeFont(); yokai [i].GetComponentsInChildren <Text> (true) [0].fontSize = ApplicationData.YokaiGetTutorialData [i].localContents [(int)ApplicationData.SelectedLanguage].fontSize; } for (int j = 0; j < item.Length; j++) { item[j].GetComponentsInChildren <Text> (true) [0].text = ApplicationData.GetLocaleText(LocaleType.ItemGetTutorial); item [j].GetComponentsInChildren <Text> (true) [0].font = ChangeFont(); item [j].GetComponentsInChildren <Text> (true) [0].fontSize = ApplicationData.SetFontSize(LocaleType.ItemGetTutorial); } CircleScale(); }