コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (LoadingScript.IsLoading)
        {
            return;
        }
        if (box == null)
        {
            return;
        }
        bool    touchDown = TouchInterface.GetTouchDown();
        Vector2 pos       = TouchInterface.GetTouchPosition();

        if (touchDown)
        {
            if (box.OverlapPoint(pos))
            {
                //show keyboard
                if (SoundClick != null)
                {
                    SoundClick.Play();
                }
                                #if UNITY_EDITOR
                IsKeyboardShow = true;
                                #else
                                        #if !UNITY_WEBGL && !DISABLE_WEBVIEW
                if (!TouchScreenKeyboard.visible)
                {
                    keyboard = TouchScreenKeyboard.Open(currentText, type, false, multiline, false, false);
                }
                                        #endif
                                #endif
            }
        }
        if (keyboard == null)
        {
            return;
        }
        if (keyboard.active)
        {
            setText(keyboard.text);
        }
        if (keyboard.done || keyboard.wasCanceled)
        {
            keyboard          = null;
            cae.IsSearchInput = true;
            cae.selectingCat(0);
        }
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        bool         touchedDown = TouchInterface.GetTouchDown();
        bool         touchedUp   = TouchInterface.GetTouchUp();
        Vector2      touchPos    = TouchInterface.GetTouchPosition();
        RaycastHit2D hit         = Physics2D.Raycast(touchPos, Vector2.zero);

        if (touchedDown)
        {
            if (mBox.OverlapPoint(touchPos))
            {
                //show button
                mSound.playDietarySound("click");
                if (!Sel)
                {
                    thisSeled.SetActive(true); thisSel.SetActive(false);
                }
                else
                {
                    thisSeled.SetActive(false); thisSel.SetActive(true);
                }
                Sel = !Sel;
                control.selectingCat(SelCat);
            }
        }
    }