Пример #1
0
 public override void OnStartAuthority()
 {
     if (MobileUtilities.IsOnMobile())
     {
         OnBecomesActive();
     }
 }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        chatClient.Service();
        TouchScreenKeyboard.hideInput = true;

        /*    InpuFiledPressCheck();*/

        /*temp = inputF.text;*/
        // MobileDebug.Log("TouchScreenKeyboard "+ keyboard + " status " + keyboard?.status + " ratio " +MobileUtilities.GetKeyboardHeightRatio(true), "Chat",LogType.Log,1);

        MobileDebug.Log("TouchScreenKeyboard.visible " + TouchScreenKeyboard.visible, "Chat", LogType.Log, 1);

        MobileDebug.Log("KeyBoardIsVisible" + KeyBoardIsVisible, "Chat", LogType.Log, 2);


        /*        MobileDebug.Log("TouchScreenKeyboard.hideInput " + TouchScreenKeyboard.hideInput, "Chat", LogType.Log, 2);
         *      MobileDebug.Log("TouchScreenKeyboard.isInPlaceEditingAllowed " + TouchScreenKeyboard.isInPlaceEditingAllowed, "Chat", LogType.Log, 3);
         *      MobileDebug.Log("TouchScreenKeyboard.area " + TouchScreenKeyboard.area, "Chat", LogType.Log, 4);
         *      MobileDebug.Log("TouchScreenKeyboard.isSupported " + TouchScreenKeyboard.isSupported, "Chat", LogType.Log, 5);
         *      MobileDebug.Log("MobileUtilities.GetKeyboardHeightRatio(true) " + MobileUtilities.GetKeyboardHeightRatio(true), "Chat", LogType.Log, 6);
         *      MobileDebug.Log("MobileUtilities.GetKeyboardHeightRatio(false) " + MobileUtilities.GetKeyboardHeightRatio(false), "Chat", LogType.Log, 7);
         *      MobileDebug.Log("MobileUtilities.GetKeyboardHeight(true) " + MobileUtilities.GetKeyboardHeight(true), "Chat", LogType.Log, 8);
         *      MobileDebug.Log("MobileUtilities.GetKeyboardHeight(false) " + MobileUtilities.GetKeyboardHeight(false), "Chat", LogType.Log, 9);
         *      MobileDebug.Log("Screen.width " + Screen.width, "Chat", LogType.Log, 10);
         *      MobileDebug.Log("Screen.height " + Screen.height, "Chat", LogType.Log, 11);*/


        /*if (keyboard?.status == TouchScreenKeyboard.Status.Visible)*/
        if (KeyBoardIsVisible)
        {
            //make chat text area fix keyboard size


#if !UNITY_EDITOR
            float KBheight            = MobileUtilities.GetKeyboardHeight(false);
            float CanvasToScreenRatio = (float)Screen.height / canvas.rect.height;
            float chatSize            = canvas.rect.height - (KBheight / CanvasToScreenRatio);

            chatBoxToResize.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, chatSize);
            chatBoxToResize.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, canvas.rect.width);

            chatBoxToResize.anchoredPosition = new Vector2(0, 0);
#else
            chatBoxToResize.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, canvas.rect.width);
            chatBoxToResize.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, canvas.rect.height);
#endif
        }
        else
        {
            chatBoxToResize.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, canvas.rect.width);
            chatBoxToResize.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, canvas.rect.height);
        }
    }
Пример #3
0
        protected void Start()
        {
            //Set default method based on current platform.
            if (MobileUtilities.IsOnMobile())
            {
                ChangeInput(true);
            }
            else
            {
                ChangeInput(false);
            }

            //Subscribe to the input module to change active text on the fly if new input is received.
            TankInputModule.s_InputMethodChanged += ChangeInput;
        }
Пример #4
0
        protected virtual void Start()
        {
            LoadingModal modal = LoadingModal.s_Instance;

            if (modal != null)
            {
                modal.FadeOut();
            }

            if (m_QuitButton != null)
            {
                m_QuitButton.SetActive(!MobileUtilities.IsOnMobile());
            }
            else
            {
                Debug.LogError("Missing quitButton from MainMenuUI");
            }

            if (m_SharingModal != null)
            {
                m_SharingModal.ShowIfRecording();
            }

            //Used to return to correct page on return to menu
            switch (s_ReturnPage)
            {
            case MenuPage.Home:
            default:
                ShowDefaultPanel();
                break;

            case MenuPage.Lobby:
                ShowLobbyPanel();
                break;

            case MenuPage.CustomizationPage:
                ShowCustomizePanel();
                break;

            case MenuPage.SinglePlayer:
                ShowSingleplayerPanel();
                break;
            }
        }