/// <summary>
    /// Método responsavel por setar o uso do teclado de acordo com o index passado dos teclados configurados
    /// </summary>
    /// <param name="_index"></param>
    public bool useVirtualKeyBoard(int _index)
    {
        ///Verifica se o teclado está disativado ou se o index está dentro dos parametros
        if (!this.gameObject.transform.GetChild(0).gameObject.activeSelf || _index < 0 || _index > this.listKeyBoard.Count)
        {
            return(false);
        }

        ///Pega a referencia
        GameObject _painel = gameObject.transform.GetChild(0).gameObject;

        StructKeyBoard _keyBoard = listKeyBoard[_index];

        this.nameVirtualKeyBoard = _keyBoard.namePainel;

        RectTransform _painelRectTransform = _painel.transform.GetComponent <RectTransform>();

        _painelRectTransform.anchoredPosition = _keyBoard.anchored;
        _painelRectTransform.sizeDelta        = _keyBoard.sizedelta;

        for (int i = 0; i < _keyBoard.listStructKeyButton.Count; i++)
        {
            RectTransform            _rectTransform = _painel.transform.GetChild(i).GetComponent <RectTransform>();
            VirtualKeyBoardBehaviour _virtual       = _painel.transform.GetChild(i).GetComponent <VirtualKeyBoardBehaviour>();

            _rectTransform.gameObject.SetActive(_keyBoard.listStructKeyButton[i].active);

            if (_rectTransform.gameObject.activeSelf)
            {
                _rectTransform.anchoredPosition = _keyBoard.listStructKeyButton[i].anchored;
                _rectTransform.sizeDelta        = _keyBoard.listStructKeyButton[i].sizedelta;
                _virtual.capital = _keyBoard.listStructKeyButton[i].capital;
                _virtual.tiny    = _keyBoard.listStructKeyButton[i].tiny;
            }

            _virtual.HandleChargeCapsLock(false);
        }
        return(true);
    }
Пример #2
0
 public VirtualKeyBoardBehaviour(VirtualKeyBoardBehaviour _behaviour)
 {
     this.Capital = _behaviour.capital;
     this.Tiny    = _behaviour.tiny;
 }