public void Show(bool harder) { if (!root.activeSelf) { if (fwoosh != null) { LeanAudio.play(fwoosh); } activeOpen = true; smallButton.Hide(); isShowing = true; isHarder = harder; root.SetActive(true); descrText.text = ContentData.getLabelText("title_MakeHarder"); Vector3 startPos = GetAdjustedPlayerScreenPos(); root.transform.localScale = Vector3.one * 0.2f; comicTail.transform.localScale = Vector3.one * 5; LeanTween.value(root, MoveRoot, startPos, savedPos, animationTime * 0.757f).setEase(LeanTweenType.easeOutExpo); LeanTween.scale(root, Vector3.one, animationTime).setEase(LeanTweenType.easeOutBack); LeanTween.scale(comicTail, Vector3.one, animationTime).setEase(LeanTweenType.easeOutCirc); UpdateTailPos(); } }
void Update() { if (ClimberStateManager.state == ClimberState.MOVING && queue.Count > 0) { timer -= Time.deltaTime; float t = 1 - (timer / _slideTime); stairCtrl.UpdateStairs(direction, moveAnimation.Evaluate(t)); character.UpdateReturn(moveAnimation.Evaluate(t)); camCtrl.UpdateCam(moveAnimation.Evaluate(t) * direction); if (timer < 0) { OnEndMove(); } } if (ClimberStateManager.isFlying) { if (queue.Count > 0) { if (smallButton && smallButton.isShowing) { smallButton.Hide(); } timer -= Time.deltaTime; float t = 1 - (timer / _slideTime); stairCtrl.UpdateStairs(direction, t); if (timer < 0) { adjustFlight = false; RemoveQueue(); //queue.RemoveAt (0); jumpCount += direction; dropMgr.ShiftIndex(-1); stairCtrl.SnapBack(); if (queue.Count == 0) { EndFlight(); } else { timer = _slideTime; //dropMgr.SpawnRandom (dropMgr.spawnPos, 7); dropMgr.SpawnRandom(7, 7); } } } else { EndFlight(); } } // else if (ClimberStateManager.state == ClimberState.SLIDING){ // timer -= Time.deltaTime; // // float t = timer / 1; // // // if (direction < 0){ // t = 1 - (timer / 1); // } // camCtrl.UpdateCamRaw (t); // if (timer < 0.15f){ // if (direction > 0) { // // //Loop (); // camCtrl.progress = 0.15f; // camCtrl.shiftCount += 1; // callback (); // } // else if (direction <0){ // camCtrl.progress = 0.85f; // camCtrl.shiftCount -= 1; // callback (); // } // } // // // } // if (ClimberStateManager.state == ClimberState.PAUSE && (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.KeypadEnter))){ // TogglePause (); // } }