IEnumerator ResultRunning() { ScoreMorph.morphEasein(0, Score, 60); ScoreBonusMorph.morphEasein(0, ScoreBonus, 60); GetComponent <AudioSource>().Play(); while ((!ScoreMorph.IsFinish()) || (!ScoreBonusMorph.IsFinish())) { ScoreMorph.Update(); ScoreBonusMorph.Update(); int score = (int)ScoreMorph.val; int scorebonus = (int)ScoreBonusMorph.val; ScoreText.text = score.ToString("#,##0"); ScoreBonusText.text = scorebonus.ToString() + "%"; yield return(null); } GetComponent <AudioSource>().Stop(); yield return(new WaitForSeconds(0.5f)); if (ScoreBonus > 0) { ScoreMorph.morphEasein(Score + Score * ScoreBonus / 100, 60); GetComponent <AudioSource>().Play(); while (!ScoreMorph.IsFinish()) { ScoreMorph.Update(); int score = (int)ScoreMorph.val; ScoreText.text = score.ToString("#,##0"); yield return(null); } GetComponent <AudioSource>().Stop(); yield return(new WaitForSeconds(1.0f)); } //load friend list StartCoroutine("ShowOnlineResult"); }
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); } }
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); // } } }
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 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); } } }
public void SetMoney(int money) { StopCoroutine("RunMoney"); mPrice = money; MoneyMorph.morphEasein(money, 60); StartCoroutine("RunMoney"); }
public void PrevPage() { if (currentPageIndex <= 0) { return; } int index = currentPageIndex - 1; if (index != currentPageIndex) { currentPageIndex = index; SnappingMorph.morphEasein(PageMoveMent, -currentPageIndex * PageLength, Mathf.Abs(currentMoveSpeed) / PageLength + Smooth); //start Coroutine } StopCoroutine("SnappingItem"); StartCoroutine("SnappingItem"); }
public void popup() { BubbleVal.morphBubble(0, 0, 20, 60, Delay); ScaleVal.morphEasein(0, fixScale, 15, Delay); state = BubbleState.BS_BUBBLE; setButton(false); }
IEnumerator IRunProgress() { int lvlCount = nextLevel - currentLevel; int progressRun = (nextProgress + lvlCount * 100) - currentProgress; progressMorph.morphEasein(currentProgress, currentProgress + progressRun, 120); while (!progressMorph.IsFinish()) { progressMorph.Update(); int cPro = (int)progressMorph.val; int lvl = currentLevel + (cPro) / 100; SetProgress(cPro % 100); LevelTxt.text = lvl.ToString(); yield return(null); } yield return(null); }
private void setUpdateSlide() { 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.344f) { ItemMoveMent = -0.344f; } if (ItemMoveMent > 0.35f) { ItemMoveMent = 0.35f; } lastTouch = touchPos; SnappingMorph.morphEasein(ItemMoveMent, ItemMoveMent + currentMoveSpeed, Mathf.Abs(MoveSpeed) / 10.0f + Smooth * 30.0f); //if(currentMoveSpeed!=0){ // IsDrag = true; //} //move all item if (BTON == 1) { if (ItemMoveMent <= 0.0f) { Sound.transform.localPosition = new Vector3(-0.344f, 0, 0); } else { Sound.transform.localPosition = new Vector3(0.35f, 0, 0); } } else if (BTON == 2) { if (ItemMoveMent <= 0.0f) { Tel.transform.localPosition = new Vector3(-0.344f, 0, 0); TelOn = false; } else { Tel.transform.localPosition = new Vector3(0.35f, 0, 0); TelOn = true; } } else if (BTON == 3) { if (ItemMoveMent <= 0.0f) { Lat.transform.localPosition = new Vector3(-0.344f, 0, 0); LatOn = false; } else { Lat.transform.localPosition = new Vector3(0.35f, 0, 0); LatOn = true; } } } else { if (Sound.transform.localPosition.x <= 0.0f) { Sound.transform.localPosition = new Vector3(-0.344f, 0, 0); AudioListener.volume = 0.0f; UserCommonData.SetSound(false); SoundOn = false; } else { Sound.transform.localPosition = new Vector3(0.35f, 0, 0); AudioListener.volume = 1.0f; UserCommonData.SetSound(true); SoundOn = true; } if (Tel.transform.localPosition.x <= 0.0f) { Tel.transform.localPosition = new Vector3(-0.344f, 0, 0); UserCommonData.SetPhone(false); TelOn = false; } else { Tel.transform.localPosition = new Vector3(0.35f, 0, 0); UserCommonData.SetPhone(true); TelOn = true; } if (Lat.transform.localPosition.x <= 0.0f) { Lat.transform.localPosition = new Vector3(-0.344f, 0, 0); UserCommonData.SetGPS(false); LatOn = false; } else { Lat.transform.localPosition = new Vector3(0.35f, 0, 0); UserCommonData.SetGPS(true); LatOn = true; } } }
private void updateTouch() { float diff = 0; if (TouchInterface.GetTouchDown()) { if (rotateMorphVal.IsFinish()) { IsMouseDown = true; Vector2 mousePos = TouchInterface.GetTouchPosition(); lastTouchPos = mousePos; } } if (TouchInterface.GetTouchUp()) { if (IsMouseDown) { mSound.playSound("fw"); if (IsDrag) { foreach (GameObject gobj in pageLayers) { PageLayer obj = gobj.GetComponent <PageLayer> (); obj.PopBubble(); obj.PopObject(); } if (MainMenuGlobal.getCurrentState() == MainMenuState.MS_TUTORIAL_DRAG) { MainMenuGlobal.Tutorial.NextTutorial(); } } setCurrentLayerNo(); rotateMorphVal.morphEasein(0, -moveVal, 10); IsDrag = false; IsMouseDown = false; } } if (IsMouseDown) { Vector2 mousePos = TouchInterface.GetTouchPosition(); diff = (lastTouchPos.x - mousePos.x) * DragSensitive; if (Mathf.Abs(diff) > DragTreshold) { if ((MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_DRAG) && (MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_SHORTCUT)) { MainMenuGlobal.SetState(MainMenuState.MS_DRAG); } IsDrag = true; } if (IsDrag) { lastTouchPos = mousePos; moveVal += diff; Debug.Log("IsDrag Cal Page No = " + currentLayerNo + " " + moveVal); foreach (GameObject gobj in pageLayers) { PageLayer obj = gobj.GetComponent <PageLayer> (); obj.ResetBubble(); } roadLayer.SlideRoad(diff); //move layer here foreach (GameObject gobj in pageLayers) { PageLayer obj = gobj.GetComponent <PageLayer> (); obj.RotatePageDiff(diff); } //get current Layer you're in //check current RotateVal length } } else { moveVal = 0; { //keep snap layer //snap layer by using rotateVal //get delta angle here foreach (GameObject gobj in pageLayers) { PageLayer obj = gobj.GetComponent <PageLayer> (); obj.RotatePageDiff(rotateMorphVal.dVal); } roadLayer.SlideRoad(rotateMorphVal.dVal); rotateMorphVal.Update(); if (rotateMorphVal.IsFinish()) { if ((MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_DRAG) && (MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_SHORTCUT)) { MainMenuGlobal.SetState(MainMenuState.MS_NORMAL); } } } } }