public virtual void Enable(bool enable, bool clearTextOnEnable = true) { if (enable) { Animator animator = QuickSingletonManager.GetInstance <QuickVRManager>().GetAnimatorTarget(); if (animator) { Vector2 hSize = GetComponent <RectTransform>().GetSizeHalf(); Transform t = QuickVRManager.IsXREnabled() ? animator.transform : Camera.main.transform; Vector3 pos = animator.GetBoneTransform(HumanBodyBones.Head).position; transform.position = pos - (t.right * hSize.x) + (t.up * hSize.y) + t.forward * 2; transform.rotation = t.rotation; } } foreach (Transform t in transform) { t.gameObject.SetActive(enable); } if (enable && clearTextOnEnable) { SetText(""); } if (!QuickVRManager.IsXREnabled()) { InputManagerKeyboard iManager = QuickSingletonManager.GetInstance <InputManager>().GetComponentInChildren <InputManagerKeyboard>(); iManager.enabled = !enable; _rootKeys.gameObject.SetActive(false); } _isEnabled = enable; }
protected virtual void UpdateKeyboardMono() { if (InputManagerKeyboard.GetKeyUp(Key.LeftShift)) { ToggleShift(); } foreach (QuickKeyboardKey k in _keys) { if (k._keyCode != Key.None && InputManagerKeyboard.GetKeyDown(k._keyCode)) { k.DoAction(); } } }