using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UIElements; namespace SC.XR.Unity { public class SCKeyboard3D : SCKeyboardBase { private SCKeyboardMono keyboardMono; public SCKeyboard3D(Transform parent, Vector3 position, Quaternion rotation, Vector3 scale) : base(parent, position, rotation, scale) { } public override string PrefabResourceName { get { return "Keyboard/3DKeyboard"; } } public override void Init() { keyboardMono = KeyboardGameObject.GetComponent(); if (keyboardMono == null) { Debug.LogError("This keyboard prefab do not have scripts inhert from SCKeyboardMono!"); return; } keyboardMono.Initialize(); //keyboardText = keyboardMono.keyboardText; keyboardMono.OnDoneButtonClick += OnDoneButtonClick; keyboardMono.OnTextChange += OnTextChange; } public override string text { get { return m_Text; } set { keyboardMono.keyboardPrompt.SetEnteredText(value); m_Text = value; } } public override void SetTextOnOpen(string openText) { keyboardMono.stringBuilder.Clear(); keyboardMono.stringBuilder.Append(openText); keyboardMono.SetTextString(); } } }