public UguiNovelTextHitArea(UguiNovelText novelText, CharData.HitEventType type, string arg, List <UguiNovelTextCharacter> characters) { this.novelText = novelText; this.HitEventType = type; this.Arg = arg; this.characters = characters; }
//Startで設定されていたテキストに戻す public virtual void EndCheckCaracterCount(string text) { if (this.text == null) { return; } this.text.text = text; }
// 文字数オーバー チェック internal int EditorCheckCharacterCount(AdvEngine engine, ref string currentWindowName, Dictionary <string, AdvUguiMessageWindow> windows) { AdvUguiMessageWindow messageWindow; if (!string.IsNullOrEmpty(MessageWindowName)) { currentWindowName = MessageWindowName; } if (!windows.TryGetValue(currentWindowName, out messageWindow)) { foreach (var window in windows.Values) { messageWindow = window; break; } } bool isActive = messageWindow.gameObject.activeSelf; if (!isActive) { messageWindow.gameObject.SetActive(true); } UguiLocalizeBase[] localizeArray = messageWindow.GetComponentsInChildren <UguiLocalizeBase>(); foreach (var item in localizeArray) { item.EditorRefresh(); } UguiNovelText textGUI = messageWindow.Text; string oldText = textGUI.text; string text = MakeText(); string errorString; int len; if (!textGUI.TextGenerator.EditorCheckRect(text, out len, out errorString)) { Debug.LogError("TextOver:" + TextDataList[0].RowData.ToStringOfFileSheetLine() + "\n" + errorString); } textGUI.text = oldText; foreach (var item in localizeArray) { item.ResetDefault(); } messageWindow.gameObject.SetActive(isActive); return(len); }
/// <summary> /// 初期化 /// </summary> /// <param name="data">バックログのデータ</param> public void Init(Utage.AdvBacklog data) { this.data = data; if (isMultiTextInPage) { float defaltHeight = this.text.rectTransform.rect.height; this.text.text = data.Text; float height = this.text.preferredHeight; (this.text.transform as RectTransform).SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height); float baseH = (this.transform as RectTransform).rect.height; float scale = this.text.transform.lossyScale.y / this.transform.lossyScale.y; baseH += (height - defaltHeight) * scale; (this.transform as RectTransform).SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, baseH); } else { this.text.text = data.Text; } characterName.text = data.MainCharacterNameText; int countVoice = data.CountVoice; if (countVoice <= 0) { soundIcon.SetActive(false); Button.interactable = false; } else { if (countVoice >= 2 || isMultiTextInPage) { UguiNovelTextEventTrigger trigger = text.gameObject.GetComponentCreateIfMissing <UguiNovelTextEventTrigger>(); trigger.OnClick.AddListener((x) => OnClickHitArea(x, OnClicked)); } else { Button.onClick.AddListener(() => OnClicked(data.MainVoiceFileName)); } } }