public void JumpToEnd() { float duration = 1f; livingLetter.transform.DOLocalMove(startPosition, delay).OnComplete(delegate() { shadowTransform.gameObject.SetActive(true); livingLetter.gameObject.SetActive(true); livingLetter.transform.DOScale(endScale, duration * 0.5f); //livingLetter.Poof(); livingLetter.OnJumpStart(); float timeToJumpStart = 0.15f; float timeToJumpEnd = 0.4f; Sequence animationSequence = DOTween.Sequence(); animationSequence.AppendInterval(timeToJumpStart); animationSequence.AppendCallback(delegate() { livingLetter.transform.DOLocalJump(endPosition, 7f, 1, duration).OnComplete(delegate() { if (endCallback != null) { endCallback(); } }).SetEase(Ease.Linear); }); animationSequence.AppendInterval(duration - timeToJumpEnd); animationSequence.AppendCallback(delegate() { livingLetter.OnJumpEnded(); }); animationSequence.AppendInterval(timeToJumpEnd); animationSequence.OnComplete(delegate() { livingLetter.DoHorray(); }); animationSequence.Play(); }); }
IEnumerator coJumpIn() { showLLMesh(true); getNewLetterData(); scatterWrongDDs(); StartCoroutine(fadeShadow()); GetComponent <Rigidbody>().isKinematic = false; GetComponent <CapsuleCollider>().isTrigger = false; letterView.Falling = true; yield return(new WaitForSeconds(0.30f)); letterView.OnJumpEnded(); letterAnimator.SetBool("dancing", game.LLCanDance); if (game.roundsCount > 0) { game.disableInput = false; } yield return(new WaitForSeconds(1f)); if (game.roundsCount == 0) { game.tut.doTutorial(thisLLWrongDDs[Random.Range(0, thisLLWrongDDs.Count - 1)].transform); } else { SickLettersConfiguration.Instance.Context.GetAudioManager().PlayVocabularyData(letterView.Data, true, soundType: SickLettersConfiguration.Instance.GetVocabularySoundType()); } }
IEnumerator playLandinganimation(float delay) { letter.GetComponent <Animator>().Play("LL_fall_down"); letter.Falling = true; yield return(new WaitForSeconds(delay)); letter.Falling = false; letter.OnJumpEnded(); letter.GetComponent <Animator>().CrossFade("LL_land", 0.3f); }
void Update() { letter.HasFear = fear; letter.SetWalkingSpeed(walkSpeed); letter.SetDancingSpeed(danceSpeed); if (doTransition) { doTransition = false; letter.SetState(targetState); } if (doHooray) { doHooray = false; letter.DoHorray(); } if (doAngry) { doAngry = false; letter.DoAngry(); } if (doHighFive) { doHighFive = false; letter.DoHighFive(); } if (onJumpStart) { onJumpStart = false; letter.OnJumpStart(); } if (onJumpMiddle) { onJumpMiddle = false; letter.OnJumpMaximumHeightReached(); } if (onJumpEnd) { onJumpEnd = false; letter.OnJumpEnded(); } if (doSmallJump) { doSmallJump = false; letter.DoSmallJump(); } if (doDanceWin) { doDanceWin = false; letter.DoDancingWin(); } if (doDanceLose) { doDanceLose = false; letter.DoDancingLose(); } if (doTwirl) { doTwirl = false; letter.DoTwirl(() => { Debug.Log("BACK!"); }); } if (doToggleDance) { doToggleDance = false; letter.ToggleDance(); } }