Exemple #1
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))
            {
                if (mSound != null)
                {
                    mSound.Play();
                }
                IsDetail = true;
                if (linkweb != "")
                {
                    nDetailLayer.PopWebPage(linkweb);
                }
                else
                {
                    nDetailLayer.OpenDetail(NewsDetail);
                }
            }
        }
    }
Exemple #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 (box == hit.collider)
            {
                mSound.playCheckSound("click");
                TextAll.SetActive(false);
                TextCosmetic.SetActive(false);
                TextDanger.SetActive(false);
                TextDrug.SetActive(false);
                TextFood.SetActive(false);
                TextTool.SetActive(false);
                ResultNotFound.SetActive(false);
                Loading.SetActive(true);
                r.SetActive(false);
                main.SetActive(true);
                header.SetActive(true);
                returnButton.SetActive(false);
                rLayer.ClearContentData();
            }
        }
    }
    void ShelfItemUpdate()
    {
        if (IsTouch)
        {
            Vector2 touchPos = TouchInterface.GetTouchPosition();
//calculate last touch
            ItemMoveMent    += (touchPos.x - lastTouch.x) * (Sensitive / 10.0f);
            MoveSpeed        = (touchPos.x - lastTouch.x) * (Sensitive / 10.0f) / (Time.deltaTime);
            currentMoveSpeed = MoveSpeed;
            if (ItemMoveMent > 0)
            {
                ItemMoveMent = 0;
            }
            if (ItemMoveMent < -(DetailLength * (ShelfItemList.Count - 1)))
            {
                ItemMoveMent = -DetailLength * (ShelfItemList.Count - 1);
            }
            lastTouch.x       = touchPos.x;
            currentShelfIndex = (int)(-(ItemMoveMent - (DetailLength / 2.0f)) / DetailLength);
            SnappingMorph.morphEasein(ItemMoveMent, -currentShelfIndex * DetailLength, Mathf.Abs(MoveSpeed) / DetailLength + Smooth);
//move all item
            for (int i = 0; i < ShelfItemList.Count; i++)
            {
                ShelfItemList [i].transform.localPosition = new Vector3(ItemMoveMent + i * DetailLength, 0, 0);
                float size = ((ScaleItemRate + 4) - Mathf.Abs(ShelfItemList [i].transform.localPosition.x)) / (ScaleItemRate + 4);
                ShelfItemList [i].transform.localScale = new Vector3(size, size, 1);
                ItemDetail idt = ShelfItemList [i].GetComponent <ItemDetail>();
                idt.SetSortingOrder(10 - (int)Mathf.Abs(ShelfItemList [i].transform.localPosition.x * 100));
            }
//move arrow item
            PrevPageArrow.transform.localPosition = new Vector3(-1 + ItemMoveMent + -DetailLength, 0, 0);
            NextPageArrow.transform.localPosition = new Vector3(1 + ItemMoveMent + ShelfItemList.Count * DetailLength, 0, 0);
        }
    }
Exemple #4
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);
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (PageDetailGlobal.state != DetailState.DS_LIST)
        {
            return;
        }
        if (TouchCollider == null)
        {
            return;
        }
        bool         touchedDown = TouchInterface.GetTouchDown();
        bool         touchedUp   = TouchInterface.GetTouchUp();
        Vector2      touchPos    = TouchInterface.GetTouchPosition();
        RaycastHit2D hit         = Physics2D.Raycast(touchPos, Vector2.zero);

        if (touchedDown)
        {
            if (TouchCollider == hit.collider)
            {
                StopCoroutine("SnappingItem");
                IsTouch   = true;
                lastTouch = touchPos;
            }
        }
        else if (touchedUp)
        {
            if (IsTouch)
            {
                IsTouch = false;
                StopCoroutine("SnappingItem");
                StartCoroutine("SnappingItem");
            }
        }
        ItemListUpdate();
    }
Exemple #6
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) && !(mBoxFooter.OverlapPoint(touchPos)))
            {
                IsTouch = true;
//				if(lastTouch!=touchPos){
//					IsDrag = true;
//				}
                lastTouch = touchPos;
            }
        }
        if (touchedUp)
        {
            //touch up here
            if (IsTouch)
            {
                IsTouch = false;
                IsDrag  = false;
                //Debug.Log("Touch Up "+IsDrag);
            }
        }
        if (IsSearchInput)
        {
        }
        ContentUpdate();
    }
    // Update is called once per frame
    void Update()
    {
        if (PageDetailGlobal.state != DetailState.DS_LIST)
        {
            return;
        }
        if (!IsEnable)
        {
            return;
        }
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (ButtonCollider.OverlapPoint(touchPos))
            {
                //show button
                GetComponent <AudioSource>().PlayOneShot(sound);
//				mSound.playContentSound("click");
                if (IsFavourite)
                {
                    PageDetailGlobal.PopFavouriteContentPage(cData);
                }
                else
                {
                    PageDetailGlobal.PopContentPage(cData);
                }
            }
        }
    }
Exemple #8
0
 void ItemListUpdate()
 {
     if (IsTouch)
     {
         Vector2 touchPos = TouchInterface.GetTouchPosition();
         //calculate last touch
         ItemMoveMent    += (touchPos.y - lastTouch.y) * (Sensitive / 10.0f);
         MoveSpeed        = (touchPos.y - lastTouch.y) * (Sensitive / 10.0f) / (Time.deltaTime);
         currentMoveSpeed = MoveSpeed;
         if (ItemMoveMent < 0)
         {
             ItemMoveMent = 0;
         }
         if (ItemMoveMent > (DetailLength * (itemDetailList.Count - 1)))
         {
             ItemMoveMent = DetailLength * (itemDetailList.Count - 1);
         }
         lastTouch.y = touchPos.y;
         SnappingMorph.morphEasein(ItemMoveMent, ItemMoveMent + currentMoveSpeed, Mathf.Abs(MoveSpeed) / DetailLength + Smooth);
         //move all item
         for (int i = 0; i < itemDetailList.Count; i++)
         {
             itemDetailList [i].transform.localPosition = new Vector3(0, ItemMoveMent - i * DetailLength, 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) && !(pBox.OverlapPoint(touchPos)))
            {
                IsTouch   = true;
                lastTouch = touchPos;
            }
        }
        if (touchedUp && IsTouch)
        {
            //touch up here
            if (IsTouch)
            {
                IsTouch = false;
            }
        }
        ContentUpdate();
    }
Exemple #10
0
    // Update is called once per frame
    void Update()
    {
        if (MainMenuGlobal.getCurrentState() != MainMenuState.MS_SHORTCUT &&
            MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_UNPIN_RED)
        {
            return;
        }

        if (PopupObject.IsPopup)
        {
            return;
        }
        if (PinCollider == null)
        {
            return;
        }
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (PinCollider.OverlapPoint(touchPos))
            {
                if (MainMenuGlobal.getCurrentState() == MainMenuState.MS_TUTORIAL_UNPIN_RED)
                {
                    MainMenuGlobal.Tutorial.NextTutorial();
                }
                //UnPinned item
                UnPinn();
            }
        }
    }
Exemple #11
0
 void ItemListUpdate()
 {
     if (IsTouch)
     {
         Vector2 touchPos = TouchInterface.GetTouchPosition();
         //calculate last touch
         ItemMoveMent    += (touchPos.y - lastTouch.y) * (Sensitive / 10.0f);
         MoveSpeed        = (touchPos.y - lastTouch.y) * (Sensitive / 10.0f) / (Time.deltaTime);
         currentMoveSpeed = MoveSpeed;
         if (ListHeight - ListHeightGap < 0)
         {
             return;
         }
         if (ItemMoveMent < 0)
         {
             ItemMoveMent = 0;
         }
         if (ItemMoveMent > ListHeight - ListHeightGap)
         {
             ItemMoveMent = ListHeight - ListHeightGap;
         }
         lastTouch.y = touchPos.y;
         SnappingMorph.morphEasein(ItemMoveMent, ItemMoveMent + currentMoveSpeed, Mathf.Abs(MoveSpeed) / ListHeight + Smooth);
         //move all item
         transform.localPosition = new Vector3(0, ItemMoveMent + lastHeight, 0);
     }
 }
    void ContentUpdate()
    {
        if (IsTouch && AllowScroll)
        {
            Vector2 touchPos = TouchInterface.GetTouchPosition();
            //calculate last touch
            ItemMoveMent += (touchPos.y - lastTouch.y) * (Sensitive / 10.0f);
            MoveSpeed     = (touchPos.y - lastTouch.y) * (Sensitive / 10.0f) / (Time.deltaTime);
            //Debug.Log(ItemMoveMent.ToString()+" "+height.ToString());
            currentMoveSpeed = MoveSpeed;
            if (ItemMoveMent < 0)
            {
                ItemMoveMent = 0;
            }
            if (ItemMoveMent > height)
            {
                ItemMoveMent = height;
            }
            lastTouch = touchPos;
            SnappingMorph.morphEasein(ItemMoveMent, ItemMoveMent + currentMoveSpeed, Mathf.Abs(MoveSpeed) / 10.0f + Smooth * 30.0f);

            //move all item
            transform.localPosition = new Vector3(0, ItemMoveMent, 0);
            //			}
        }
    }
    // Update is called once per frame
    void Update()
    {
        bool TouchDown = TouchInterface.GetTouchDown();
        bool TouchUp   = TouchInterface.GetTouchUp();

        pos = TouchInterface.GetTouchPosition();
        if (TouchDown)
        {
            if (touchArea.OverlapPoint(pos))
            {
                lastTouchPos  = pos;
                currentMapPos = MapObject.transform.localPosition;
                IsDrag        = true;
            }
        }
        else if (TouchUp)
        {
            IsDrag = false;
        }

        if (IsDrag)
        {
            //calculate CurrentMapPos
            Vector3 movedPosition = currentMapPos + new Vector3(0,
                                                                pos.y - lastTouchPos.y,
                                                                0);
            //			MapObject.rigidbody2D.transform.localPosition = movedPosition;
            MapObject.GetComponent <Rigidbody2D>().velocity = (movedPosition - currentMapPos) * 60;
            lastTouchPos = pos;
        }
        else
        {
            MapObject.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (UnTouchArea == null)
        {
            return;
        }
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (!UnTouchArea.OverlapPoint(touchPos))
            {
                IsTouch   = true;
                lastTouch = touchPos;
            }
        }
        if (touchedUp && IsTouch)
        {
            //touch up here
            if (IsTouch)
            {
                IsTouch = false;
            }
        }
        ContentUpdate();
    }
    // Update is called once per frame
    void Update()
    {
        if ((state != GameState.GS_PLAY) && (state != GameState.GS_PAUSE))
        {
            return;
        }
        bool    TouchDown = TouchInterface.GetTouchDown();
        bool    TouchUp   = TouchInterface.GetTouchUp();
        Vector2 pos       = TouchInterface.GetTouchPosition();

        if (TouchDown)
        {
            if (PauseBtn.OverlapPoint(pos))
            {
                if (state == GameState.GS_PLAY)
                {
                    mGamePause();
                }
                else if (state == GameState.GS_PAUSE)
                {
                    mGameUnPause();
                }
            }
        }
    }
Exemple #16
0
    // Update is called once per frame
    void Update()
    {
        if (IsLock)
        {
            return;
        }
        bool    TouchDown = TouchInterface.GetTouchDown();
        Vector2 pos       = TouchInterface.GetTouchPosition();

        if (TouchDown)
        {
            if (chooseItem.OverlapPoint(pos))
            {
                Toggle();
                if (cb != null)
                {
                    if (ItemCount > 0)
                    {
                        cb(ItemDesc, 0);
                    }
                    else
                    {
                        cb(ItemDesc, IsSelect?-ItemPrice:ItemPrice);
                    }
                }
            }
        }
    }
Exemple #17
0
    // Update is called once per frame
    void Update()
    {
        if (PageDetailGlobal.state != DetailState.DS_LIST)
        {
            return;
        }
        if (TouchCollider == null)
        {
            return;
        }
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (TouchCollider.OverlapPoint(touchPos))
            {
                StopCoroutine("SnappingItem");
                IsTouch   = true;
                lastTouch = touchPos;
            }
        }
        else if (touchedUp)
        {
            if (IsTouch)
            {
                IsTouch = false;
                StopCoroutine("SnappingItem");
                StartCoroutine("SnappingItem");
            }
        }
        ItemListUpdate();
    }
Exemple #18
0
 void PageItemUpdate()
 {
     if (IsTouch)
     {
         Vector2 touchPos = TouchInterface.GetTouchPosition();
         //calculate last touch
         PageMoveMent    += (touchPos.x - lastTouch.x) * (Sensitive / 10.0f);
         MoveSpeed        = (touchPos.x - lastTouch.x) * (Sensitive / 10.0f) / (Time.deltaTime);
         currentMoveSpeed = MoveSpeed;
         if (PageMoveMent > 0)
         {
             PageMoveMent = 0;
         }
         if (PageMoveMent < -(PageLength * (PageSize - 1)))
         {
             PageMoveMent = -PageLength * (PageSize - 1);
         }
         lastTouch.x      = touchPos.x;
         currentPageIndex = (int)(-(PageMoveMent - (PageLength / 2.0f)) / PageLength);
         SnappingMorph.morphEasein(PageMoveMent, -currentPageIndex * PageLength, Mathf.Abs(MoveSpeed) / PageLength + Smooth);
         //move all item
         for (int i = 0; i < PageSize; i++)
         {
             PageList [i].transform.localPosition = new Vector3(PageMoveMent + i * PageLength, 0.12f, 0);
             if (i == currentPageIndex)
             {
                 PageList [i].color = Color.white;
             }
             else
             {
                 PageList [i].color = new Color32(0, 0, 0, 117);
             }
         }
     }
 }
Exemple #19
0
    // Update is called once per frame
    void Update()
    {
        if (PageDetailGlobal.state != DetailState.DS_LIST)
        {
            return;
        }
        if (!IsEnable)
        {
            return;
        }
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (ButtonCollider.OverlapPoint(touchPos) && ((box == null) || ((box != null) && (box.OverlapPoint(touchPos)))))
            {
                Debug.Log("WebViewButton Click");
                if (mSound != null)
                {
                    mSound.playContentSound("click");
                }
                switch (link)
                {
                case LinkType.LINK_MOVIE:
                {
                    string url = cData.vdourl.Replace(@"\/", @"/");
                                        #if UNITY_WINRT
                    UnityPluginForWindowsPhone.BridgeWP.mediaPlayerLauncher(url);
                                        #else
                                                #if !UNITY_WEBGL && !DISABLE_WEBVIEW
                    Handheld.PlayFullScreenMovie(url);
                                                #endif
                                        #endif
                } break;

                case LinkType.LINK_PDF:
                {
                    Debug.Log("WebViewButton Link PDF");
                    if (IsFavourite)
                    {
                        Debug.Log("WebViewButton Favorite");
                        PageDetailGlobal.PopFavouritePDFPage(cData);
                    }
                    else
                    {
                        Debug.Log("WebViewButton Normal");
                        PageDetailGlobal.PopPDFPage(cData);
                    }
                } break;

                case LinkType.LINK_NULL:
                {
                } break;
                }
            }
        }
    }
Exemple #20
0
    // Update is called once per frame
    protected virtual void Update()
    {
        if (!PopupObject.IsPopup)
        {
            return;
        }
        if (GetComponent <Collider2D>() == null)
        {
            return;
        }
        if (!isenable)
        {
            return;
        }
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if ((box != null) && (!box.OverlapPoint(touchPos)))
            {
                return;
            }
            if (this.GetComponent <Collider2D>().OverlapPoint(touchPos))
            {
                if ((box == null) || ((box != null) && (box.OverlapPoint(touchPos))))
                {
                    IsTouch = true;
                    //run event here
                    if (OnClicked != null)
                    {
                        Debug.Log("OnClicked");
                        OnClicked();
                    }
                }
            }
        }
        if (touchedUp)
        {
            if (this.GetComponent <Collider2D>().OverlapPoint(touchPos))
            {
                if (IsTouch)
                {
                    if (HideEvent != null)
                    {
                        HideEvent();
                    }
                    if (OnReleased != null)
                    {
                        Debug.Log("OnReleased");
                        OnReleased();
                    }
                }
            }
            IsTouch = false;
        }
    }
Exemple #21
0
            internal static unsafe void Invoke(IntPtr obj, TouchInterface NewTouchInterface)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = NewTouchInterface;
                Main.GetProcessEvent(obj, ActivateTouchInterface_ptr, new IntPtr(p));;
            }
        }
    // Update is called once per frame
    void Update()
    {
        if (LoadingScript.IsLoading)
        {
            return;
        }
        if (GetComponent <Collider2D>() == null)
        {
            return;
        }
        bool    touchDown = TouchInterface.GetTouchDown();
        Vector2 pos       = TouchInterface.GetTouchPosition();

        if (touchDown)
        {
            if (GetComponent <Collider2D>().OverlapPoint(pos))
            {
                //show keyboard
                if (SoundClick != null)
                {
                    SoundClick.Play();
                }
                PageDetailGlobal.state = DetailState.DS_SEARCH;
                                #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;
        }
        else if (keyboard.done)
        {
            if (keyboard.text != "")
            {
                //Search
                Debug.Log("string = " + keyboard.text);
                string toSearch = keyboard.text;
                Search(toSearch);
                keyboard = null;
            }
            PageDetailGlobal.state = DetailState.DS_LIST;
        }
        else if (keyboard.wasCanceled)
        {
            PageDetailGlobal.state = DetailState.DS_LIST;
            keyboard = null;
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (PageDetailGlobal.state != DetailState.DS_LIST)
        {
            return;
        }
        if (!PageDetailGlobal.IsFinishLoading())
        {
            return;
        }
        if (PopupObject.IsPopup)
        {
            return;
        }
        if (TouchArea == null)
        {
            return;
        }
        if (ShelfItemList.Count <= 0)
        {
            return;
        }
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (TouchArea.OverlapPoint(touchPos))
            {
                StopCoroutine("SnappingItem");
                IsTouch = true;
                mSound.playContentSound("click");
                lastTouch = touchPos;
                content.HideContent();
            }
        }
        else if (touchedUp)
        {
            if (IsTouch)
            {
                IsTouch = false;
                int index = (int)(-(ItemMoveMent - (DetailLength / 2.0f) + currentMoveSpeed * ((Smooth / 30.0f > 1) ? 1 : Smooth / 30.0f)) / DetailLength);
                if (index != currentShelfIndex)
                {
                    currentShelfIndex = index;
                }
                SnappingMorph.morphEasein(ItemMoveMent, -currentShelfIndex * DetailLength, Mathf.Abs(currentMoveSpeed) / DetailLength + Smooth);
                StopCoroutine("SnappingItem");
                StartCoroutine("SnappingItem");
            }
        }
        ShelfItemUpdate();
    }
Exemple #24
0
        void Update()
        {
            Vector2 pos         = TouchInterface.GetTouchPosition();
            bool    isTouchDown = TouchInterface.GetTouchDown();

            if (isTouchDown && GetComponent <Collider2D>().OverlapPoint(pos))
            {
                parashootObject.DetachParashoot(type);
                //play animation detach parashoot before destroy object
                Destroy(this.gameObject);
            }
        }
    // Update is called once per frame
    void Update()
    {
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown && MainMenuState.MS_SETTING == MainMenuGlobal.getCurrentState())
        {
            if (BTSound.OverlapPoint(touchPos))
            {
                //Debug.Log("Sound");
                BTON      = 1;
                IsTouch   = true;
                lastTouch = touchPos;
            }
            else if (BTTel.OverlapPoint(touchPos))
            {
                //Debug.Log("Tel");
                BTON      = 2;
                IsTouch   = true;
                lastTouch = touchPos;
            }
            else if (BTLat.OverlapPoint(touchPos))
            {
                //Debug.Log("Lat Lon");
                BTON      = 3;
                IsTouch   = true;
                lastTouch = touchPos;
            }
//			else if(newsCollider.OverlapPoint(touchPos)){
//				//Debug.Log("Lat Lon");
//				BTON=4;
//				IsTouch = true;
//				lastTouch = touchPos;
//			}
        }
        if (touchedUp && MainMenuState.MS_SETTING == MainMenuGlobal.getCurrentState())
        {
            if (IsTouch)
            {
                IsTouch = false;

//				if(newsCollider.OverlapPoint(touchPos)){
//
//				}
//				else{
                BTON = 0;
//				}
            }
        }
        setUpdateSlide();
    }
Exemple #26
0
    // Update is called once per frame
    void Update()
    {
        if (LoadingScript.IsLoading)
        {
            return;
        }
        if (PopupObject.IsPopup)
        {
            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.done)
        {
            setText(keyboard.text);
        }
        if (keyboard.done || keyboard.wasCanceled)
        {
            setText(currentText);
            keyboard = null;
        }
    }
Exemple #27
0
        // Update is called once per frame
        void Update()
        {
            Vector2 pos = TouchInterface.GetTouchPosition();

            if (GetComponent <Collider2D>().OverlapPoint(pos))
            {
                Game3Global.pGlobal.boxObject = this;
            }
            else if (Game3Global.pGlobal.boxObject == this)
            {
                Game3Global.pGlobal.boxObject = null;
            }
        }
Exemple #28
0
    void Update()
    {
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (mCollider.OverlapPoint(touchPos))
            {
                //show button
                OnPressed(ButtonIdx);
            }
        }
    }
Exemple #29
0
    // Update is called once per frame
    void Update()
    {
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (ButtonCollider.OverlapPoint(touchPos))
            {
                //show button
                mSound.playContentSound("submenu");
                Trigger(!IsActive);
            }
        }
    }
Exemple #30
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))
            {
                mSound.playDietarySound("click");
                cEvent.AddData();
            }
        }
    }