Beispiel #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) && !(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 (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();
                }
            }
        }
    }
Beispiel #4
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();
    }
    // 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);
        }
    }
Beispiel #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 (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();
            }
        }
    }
Beispiel #7
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);
                }
            }
        }
    }
Beispiel #8
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();
            }
        }
    }
Beispiel #9
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();
    }
    // 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();
    }
    // 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);
                }
            }
        }
    }
Beispiel #13
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;
                }
            }
        }
    }
Beispiel #14
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;
        }
    }
    // 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();
    }
    // 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();
    }
Beispiel #17
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);
            }
        }
    }
Beispiel #18
0
    // Update is called once per frame
    void Update()
    {
        if (!isClickable || Game6Controller.GetInstance().IsPause())
        {
            return;
        }
        bool    TouchDown = TouchInterface.GetTouchDown();
        bool    TouchUp   = TouchInterface.GetTouchUp();
        Vector2 pos       = TouchInterface.GetTouchPosition();
        var     isHit     = GetComponent <Collider2D>().OverlapPoint(pos);

        if (TouchDown && isHit)
        {
            Game6Controller.GetInstance().StartDrag(this);
        }
    }
Beispiel #19
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();
            }
        }
    }
Beispiel #20
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);
            }
        }
    }
Beispiel #21
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 (BTAll.OverlapPoint(touchPos))
            {
                mSound.playCheckSound("click");
                enableIcon(0);
                CheckPageGlobal.pGlobal.ProductType = 0;
            }
            if (BTCosmetic.OverlapPoint(touchPos))
            {
                mSound.playCheckSound("click");
                enableIcon(1);
                CheckPageGlobal.pGlobal.ProductType = 1;
            }
            if (BTDanger.OverlapPoint(touchPos))
            {
                mSound.playCheckSound("click");
                enableIcon(2);
                CheckPageGlobal.pGlobal.ProductType = 2;
            }
            if (BTDrug.OverlapPoint(touchPos))
            {
                mSound.playCheckSound("click");
                enableIcon(3);
                CheckPageGlobal.pGlobal.ProductType = 3;
            }
            if (BTFood.OverlapPoint(touchPos))
            {
                mSound.playCheckSound("click");
                enableIcon(4);
                CheckPageGlobal.pGlobal.ProductType = 4;
            }
            if (BTTool.OverlapPoint(touchPos))
            {
                mSound.playCheckSound("click");
                enableIcon(5);
                CheckPageGlobal.pGlobal.ProductType = 5;
            }
        }
    }
Beispiel #22
0
    // Update is called once per frame
    void Update()
    {
        if (PageDetailGlobal.state != DetailState.DS_LIST)
        {
            return;
        }
        if (TouchCollider == null)
        {
            return;
        }
        if (PageList.Count <= 0)
        {
            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;
                mSound.playContentSound("click");
            }
        }
        else if (touchedUp)
        {
            if (IsTouch)
            {
                IsTouch = false;
                int index = (int)(-(PageMoveMent - (PageLength / 2.0f) + currentMoveSpeed * ((Smooth / 30.0f > 1) ? 1 : Smooth / 30.0f)) / PageLength);
                if (index != currentPageIndex)
                {
                    currentPageIndex = index;
                    SnappingMorph.morphEasein(PageMoveMent, -currentPageIndex * PageLength, Mathf.Abs(currentMoveSpeed) / PageLength + Smooth);
                    //start Coroutine
                }
                StopCoroutine("SnappingItem");
                StartCoroutine("SnappingItem");
            }
        }
        PageItemUpdate();
    }
Beispiel #23
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 (mCollider.OverlapPoint(touchPos))
            {
                //show button
                ResultLayer.transform.position = bottomposition;
                ResultLayer.SetActive(false);
            }
        }
    }
Beispiel #24
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 (touchedUp)
        {
            //if ((this.GetComponent<Collider2D>()==hit.collider) && rLayer.returnenableClick()) {
            if (box.OverlapPoint(touchPos) && ResultLayer.pGlobal.returnenableClick())
            {
                Debug.Log(ResultLayer.pGlobal.returnenableClick());
                //mSound.playCheckSound("click");
                //if( data.checktype == "2.2")
                //{
                if (productType == "1")                       // Cosmetic
//						data.contentList[0] = data.contentList[index];
                {
                }
                else if (productType == "2.1")                       // Danger Register
//						data.contentListDangerRegister[0] = data.contentListDangerRegister[index];
                {
                }
                else if (productType == "2.2")                       // Danger License
//						data.contentListDangerLicense[0] = data.contentListDangerLicense[index];
                {
                }
                else if (productType == "3")                       // Drug

                {
                }
                else if (productType == "4")                       // Food
//						data.contentListFood[0] = data.contentListFood[index];
                {
                }
                else if (productType == "5")                       // Tool

                {
                }
                onClick(data, data.checktype, index);
                //}
            }
        }
    }
Beispiel #25
0
    // Update is called once per frame
    void Update()
    {
        bool    TouchDown = TouchInterface.GetTouchDown();
        bool    TouchUp   = TouchInterface.GetTouchUp();
        Vector2 pos       = TouchInterface.GetTouchPosition();

        if (selectedProduct != null)
        {
            selectedProduct.transform.position = Vector3.back + (Vector3)pos;
            if (TouchUp)
            {
                if (selectedTile != null && (selectedProduct is Product || selectedProduct is Magnifier) && selectedTile.IsBuildAble())
                {
                    if (selectedProduct is Product)
                    {
                        buildSelected();
                    }
                    else if (selectedProduct is Magnifier)
                    {
                        useMagnifier();
                    }
                }
                else if (selectedTile != null && selectedProduct is Locker && selectedTile.GetBadGuy() != null)
                {
                    useLocker();
                }
                else if (selectedTile != null && selectedProduct is Oryor)
                {
                    useOryor();
                }
                else if (isSlotSelected(pos))
                {
                    swapProduct();
                }
                else if (isProductFactorySelected(pos))
                {
                    swapProductBackToFactory();
                }
                else
                {
                    cancelSelected();
                }
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (mbox.OverlapPoint(touchPos))
            {
                mSound.playDietarySound("click");
                MainPage.SetActive(true);
                AddPage.SetActive(false);
                Head.SetActive(true);
                SuggestPage.SetActive(false);
            }
        }
    }
Beispiel #27
0
    // Update is called once per frame
    void Update()
    {
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (this.GetComponent <Collider2D>().OverlapPoint(touchPos))
            {
                //run event here
                PopupObject.ShowAlertPopup(HeaderText, DetailText, ButtonText);
//				StopCoroutine("TestTiming");
//				StartCoroutine("TestTiming");
//				PopupObject.ShowWaitingPopup(HeaderText,"Cancel",ProgressCB,Cancel);
            }
        }
    }
Beispiel #28
0
    // Update is called once per frame
    void Update()
    {
        bool    TouchDown = TouchInterface.GetTouchDown();
        bool    TouchUp   = TouchInterface.GetTouchUp();
        Vector2 pos       = TouchInterface.GetTouchPosition();
        var     isHit     = GetComponent <Collider2D>().OverlapPoint(pos);

        if (isHit)
        {
            isSelected = true;
            Game6Controller.GetInstance().SetSelectTile(this);
        }
        else if (isSelected)
        {
            isSelected = false;
            Game6Controller.GetInstance().DeselectTile(this);
        }
    }
Beispiel #29
0
    // Update is called once per frame
    void Update()
    {
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();
        //				Debug.Log (Camera.main.ScreenToWorldPoint (touchPos));
        RaycastHit2D hit = Physics2D.Raycast(touchPos, Vector2.zero);

        if (touchedDown)
        {
            if (box == hit.collider)
            {
                mSound.playBMISound("click");
                BMIDetail.SetActive(false);
                Head.SetActive(true);
                Detail.SetActive(true);
            }
        }
    }
Beispiel #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))
            {
                //show button
                mSound.playDietarySound("click");
                MainPage.SetActive(false);
                AddPage.SetActive(true);
                cae.setAddState();
            }
        }
    }