// 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() { 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() { 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(); } } }
// 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); } } } }
// 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() { 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 (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() { 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(); } } }
// 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(); } } } }
// 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() { 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() { 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); } } } }
// 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); } } } } }
// 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; } } } }
// 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 (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(); }
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() { 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; } }
// 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(); }
void Update() { bool touchedDown = TouchInterface.GetTouchDown(); bool touchedUp = TouchInterface.GetTouchUp(); Vector2 touchPos = TouchInterface.GetTouchPosition(); if (touchedDown) { if (mCollider.OverlapPoint(touchPos)) { //show button OnPressed(ButtonIdx); } } }
// 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); } }
// 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(); } } }
// 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); } } }
// Update is called once per frame void Update() { if (box == null) { return; } bool touchDown = TouchInterface.GetTouchDown(); Vector2 pos = TouchInterface.GetTouchPosition(); if (touchDown) { if (box.OverlapPoint(pos)) { if (SoundClick != null) { SoundClick.Play(); } //show keyboard #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 || keyboard.wasCanceled) { return; } if (keyboard.done) { // keyboard = null; CheckPageGlobal.CheckProduct(); } // if (keyboard.wasCanceled) { // keyboard = null; // } if (keyboard.active) { setText(keyboard.text); } }
// 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; } } }
// 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); } } }
// 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(); }
// 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); //} } } }
// 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(); } } } }