Beispiel #1
0
 void StopAutomaticKeyboard()
 {
     if (auto_keyboard != null && auto_keyboard)
     {
         Destroy(auto_keyboard.gameObject);
     }
     auto_keyboard = null;
 }
Beispiel #2
0
 void StopAutomaticKeyboard()
 {
     /* NB. can't use OnEnable/OnDisable, because we enable and disable the dialog
      * internally for rendering purposes */
     if (auto_keyboard != null && auto_keyboard)
     {
         Destroy(auto_keyboard.gameObject);
     }
     auto_keyboard = null;
 }
Beispiel #3
0
        void StartAutomaticKeyboard()
        {
            if (automaticKeyboard && GetComponentInChildren <KeyboardVRInput>() != null && auto_keyboard == null)
            {
                GameObject    keyboard_prefab = Resources.Load <GameObject>("BaroqueUI/Keyboard");
                RectTransform rtr             = transform as RectTransform;
                Vector3       vcorr           = rtr.TransformVector(new Vector3(0, rtr.rect.height * rtr.pivot.y, 0));

                Vector3    pos      = transform.position - 0.08f * transform.forward - 0.09f * transform.up - vcorr;
                Quaternion rotation = Quaternion.LookRotation(transform.forward);
                rotation = Quaternion.Euler(41.6335f, rotation.eulerAngles.y, 0);
                // note: 41.6335 = atan(0.08/0.09)
                auto_keyboard = Instantiate(keyboard_prefab, pos, rotation).GetComponent <KeyboardClicker>();
                auto_keyboard.enableEnterKey = true;
                auto_keyboard.enableTabKey   = false;
                auto_keyboard.enableEscKey   = true;

                auto_keyboard.onKeyboardTyping.AddListener(KeyboardTyping);
            }
        }