// 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); } }
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() { 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 (!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(); 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() { 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() { 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 (touchedDown) { if (mCollider.OverlapPoint(touchPos)) { //show button ResultLayer.transform.position = bottomposition; ResultLayer.SetActive(false); } } }
// 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(); } } } }
// 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); } } }
// 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); } } }
// 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); } }
// 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(); } } }
// Update is called once per frame void Update() { bool touchedDown = TouchInterface.GetTouchDown(); bool touchedUp = TouchInterface.GetTouchUp(); Vector2 touchPos = TouchInterface.GetTouchPosition(); if (touchedDown) { LastTouch = touchPos; } if (touchedUp && (Mathf.Abs(LastTouch.y - touchPos.y) <= 0.09f) && (pBox.OverlapPoint(touchPos) && !pBoxFooter.OverlapPoint(touchPos))) { if (mBox.OverlapPoint(touchPos)) { mSound.playDietarySound("click"); cae.setText(fData); } } }
// 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); } } }
// 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 (TouchDown && ishit) { isDown = true; } else if (TouchUp) { if (isDown && ishit) { onClick(); } isDown = false; } }
// Update is called once per frame void Update() { if (PageDetailGlobal.state != DetailState.DS_LIST) { return; } bool touchedDown = TouchInterface.GetTouchDown(); bool touchedUp = TouchInterface.GetTouchUp(); Vector2 touchPos = TouchInterface.GetTouchPosition(); if (touchedDown) { // if (ButtonCollider.OverlapPoint(touchPos)) if (ButtonCollider.OverlapPoint(touchPos) && ((box == null) || ((box != null) && (box.OverlapPoint(touchPos))))) { //show button PageDetailGlobal.RemoveFavourite(cData); } } }
// 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 Header.SetActive(true); Detail.SetActive(true); ResultLayer.SetActive(false); BMIDetailBT.SetActive(true); BMRDetailBT.SetActive(false); mSound.playBMISound("click"); } } }
// Update is called once per frame void Update() { if (GameLandGlobal.state != GameLandState.GS_MAPMODE) { return; } 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(pos.x - lastTouchPos.x, 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 (mBox.OverlapPoint(touchPos)) { //show button mSound.playBMISound("click"); BTBMICal.sex = false; Male.SetActive(true); MalePress.SetActive(false); Female.SetActive(false); FemalePress.SetActive(true); Debug.Log(BTBMICal.sex); } } }
// 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)) { IsTouch = true; lastTouch = touchPos; } } if (touchedUp) { if (IsTouch) { IsTouch = false; } } ContentUpdate(); }
// Update is called once per frame void Update() { if (PageDetailGlobal.state != DetailState.DS_LIST) { return; } bool touchedDown = TouchInterface.GetTouchDown(); bool touchedUp = TouchInterface.GetTouchUp(); Vector2 touchPos = TouchInterface.GetTouchPosition(); // Debug.Log (Camera.main.ScreenToWorldPoint (touchPos)); if (touchedDown) { if (ShelfButton.OverlapPoint(touchPos)) { mSound.playContentSound("click"); CatagoryNumber = 1; CatagoryNumber1(); } else if (FullListButton.OverlapPoint(touchPos)) { mSound.playContentSound("click"); CatagoryNumber = 2; CatagoryNumber2(); } else if (FavouriteButton.OverlapPoint(touchPos)) { mSound.playContentSound("click"); CatagoryNumber = 3; CatagoryNumber3(); } // nextPosition = new Vector3 (CatagoryNumber * 2 - 4, -0.25f, 0); nextPosition.x = CatagoryNumber * 2 - 4; StopCoroutine("MoveArrow"); StartCoroutine("MoveArrow"); } }
void Update() { #if UNITY_EDITOR || UNITY_WEBPLAYER if (Input.GetKey(KeyCode.LeftArrow)) { GetComponent <Rigidbody2D>().velocity = new Vector2(-5.0f, 0); } else if (Input.GetKey(KeyCode.RightArrow)) { GetComponent <Rigidbody2D>().velocity = new Vector2(5.0f, 0); } if (Input.GetKeyUp(KeyCode.LeftArrow) || (Input.GetKeyUp(KeyCode.RightArrow))) { GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0); } #endif Vector2 pos = TouchInterface.GetTouchPosition(); bool isTouchDown = TouchInterface.GetTouchDown(); bool isTouchUp = TouchInterface.GetTouchUp(); if (isTouchDown) { IsTouch = true; lastPos = pos; } if (isTouchUp) { //calculate score GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0); IsTouch = false; } if (IsTouch) { touchPos = pos; } UpdatePosition(); }
void ContentUpdate() { 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 > height - 6) { ItemMoveMent = height - 6; } 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() { if (MainMenuGlobal.getCurrentState() != MainMenuState.MS_SHORTCUT && MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_PIN_RED) { return; } if (PopupObject.IsPopup) { return; } if (PinCollider == null) { return; } if (IsRunning) { 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_PIN_RED) { MainMenuGlobal.Tutorial.NextTutorial(); } //pinned item PinnItem(); } } }
void Start() { btMoveLeft.OnReleased += moveLeftFunc; btMoveRight.OnReleased += moveRightFunc; rotateMorphVal = new MorphObject(); IsDrag = false; IsMouseDown = false; // moveVal = 0.0f; currentLayerNo = MainMenuGlobal.lastIndex; moveVal = 0.0f; // moveVal = currentLayerNo * layerLength; lastTouchPos = TouchInterface.GetTouchPosition(); //create Layer pageLayers = new List <GameObject> (); int i = 0; PageLayer.maxPage = pagePrefabs.Count; PageLayer.pageLength = layerLength; foreach (PageLayer gObj in pagePrefabs) { if (gObj != null) { GameObject obj = (GameObject)GameObject.Instantiate(gObj.gameObject); pageLayers.Add(obj); PageLayer pObj = obj.GetComponent <PageLayer> (); pObj.setRotatePage(-layerLength * i++); } } foreach (GameObject gobj in pageLayers) { PageLayer obj = gobj.GetComponent <PageLayer> (); obj.RotatePageDiff(currentLayerNo * layerLength); } setCurrentLayerNo(); }
// Update is called once per frame void Update() { if (PageDetailGlobal.state != DetailState.DS_LIST) { return; } bool touchedDown = TouchInterface.GetTouchDown(); bool touchedUp = TouchInterface.GetTouchUp(); Vector2 touchPos = TouchInterface.GetTouchPosition(); RaycastHit2D hit = Physics2D.Raycast(touchPos, Vector2.zero); if (touchedDown) { if (NewReleaseCollider.OverlapPoint(touchPos)) { mSound.playContentSound("click"); NewReleaseButton.Press(); MostViewButton.Release(); MostLikeButton.Release(); } if (MostViewCollider.OverlapPoint(touchPos)) { mSound.playContentSound("click"); NewReleaseButton.Release(); MostViewButton.Press(); MostLikeButton.Release(); } if (MostLikeCollider.OverlapPoint(touchPos)) { mSound.playContentSound("click"); NewReleaseButton.Release(); MostViewButton.Release(); MostLikeButton.Press(); } } }
// Update is called once per frame void Update() { if (PageDetailGlobal.state != DetailState.DS_LIST) { return; } bool touchedDown = TouchInterface.GetTouchDown(); bool touchedUp = TouchInterface.GetTouchUp(); Vector2 touchPos = TouchInterface.GetTouchPosition(); if (touchedDown) { if (LikeButton.OverlapPoint(touchPos)) { } if (FavButton.OverlapPoint(touchPos)) { //add Favourite to list } if (ShareButton.OverlapPoint(touchPos)) { } } }