1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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<SCKeyboardMono>();
- 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();
- }
- }
- }
|