123456789101112131415161718192021222324252627282930313233343536 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace SC.XR.Unity.Module_Keyboard
- {
- public class SCKeyboard3DPrompt : SCKeyboardBasePrompt
- {
- public int PROMPT_PER_PAGE = 15;
- public RectTransform promptInput;
- public RectTransform maskRect;
- public override int GetChinese(string englishWords)
- {
- wordCount = ChineseIMEManager.Instance.GetWordCount(englishWords);
- return wordCount;
- }
- public override string GetChinese(int index)
- {
- return ChineseIMEManager.Instance.GetWord(index);
- }
- public override void SetEnteredText(string textStr)
- {
- alreadyInput.alignment = TextAnchor.MiddleCenter;
- alreadyInput.text = textStr;
- if ((KeyboardUtils.CaculateTextLength(textStr, alreadyInput) * 0.1) > maskRect.sizeDelta.x) { alreadyInput.alignment = TextAnchor.MiddleRight; }
- }
- }
- }
|