public void Reborn() { if (m_DeadSequence != null) { m_DeadSequence.Kill(); } m_Animator.Play("Run"); jumpThings.ForEach(j => j.SetActive(true)); GetComponentsInChildren <SpriteRenderer>().ToList().ForEach(s => { s.DOFade(0.3f, 0.3f).SetLoops(10, LoopType.Yoyo).OnComplete(() => { s.DOFade(1.0f, 0.3f); }); }); GetComponent <Rigidbody2D>().velocity = Vector2.zero; GetComponent <Rigidbody2D>().simulated = true; GetComponent <Collider2D>().enabled = false; DOTweenUtils.Delay(() => { GetComponent <Collider2D>().enabled = true; m_IsDeading = false; }, 3.0f); maxJumpCount = 99999; m_JumpCount = 0; ScenesManager.instance.continuteMenu.SetActive(true); Time.timeScale = 0.0f; }
public void BeginPeriodic(PeriodicType type, float period = .15f) { DOTweenUtils.KillTween(ref currentPeriodicTween); switch (type) { case PeriodicType.VERY_LIGHT: VibrateSelectionChange(); break; case PeriodicType.MEDIUM: VibrateMedium(); break; case PeriodicType.HEAVY: VibrateHeavy(); break; case PeriodicType.LIGHT: default: VibrateLight(); break; } DOTweenUtils.KillTween(ref currentPeriodicTween); currentPeriodicTween = DOVirtual.DelayedCall(period, () => { BeginPeriodic(type, period); }); }
public void Play() { if (!isPlaying) { DOTweenUtils.KillTween(ref currentTween); currentTween = DOVirtual.Float(0, volumeToReach, .2f, newVolume => CurrentAudioSource.volume = newVolume); if (CurrentAudioSource.gameObject.activeInHierarchy) { CurrentAudioSource.Play(); } isPlaying = true; } }
public void MakeLove() { var loveGO = Object.Instantiate <GameObject>(love); loveGO.transform.position = new Vector3(0f, -6f, 0f); loveGO.transform.GetChild(0).gameObject.GetComponent <SpriteRenderer>().DOFade(0.0f, 2.0f).SetEase(Ease.Linear); loveGO.transform.DOScale(Vector3.one * 10f, 2f).OnComplete(() => { yanhua.SetActive(true); DOTweenUtils.Delay(() => { bkg.SetActive(true); }, 3.5f); }); }
public void Stop() { if (isPlaying) { DOTweenUtils.KillTween(ref currentTween); currentTween = DOVirtual.Float(volumeToReach, 0, .2f, newVolume => CurrentAudioSource.volume = newVolume) .OnComplete(() => { if (CurrentAudioSource.gameObject.activeInHierarchy) { CurrentAudioSource.Stop(); } }); isPlaying = false; } }
public void Do(SlowMotionType type) { DOTweenUtils.KillTween(ref currentTween); currentTween = DOTween.Sequence() .Append(DOVirtual.Float(Time.timeScale, .1f, type.InDuration, newTimeScale => { Time.timeScale = newTimeScale; Time.fixedDeltaTime = newTimeScale * 0.02f; }).SetEase(type.InEaseType)) .AppendInterval(type.FreezeDuration) .Append(DOVirtual.Float(.1f, 1f, type.OutDuration, newTimeScale => { Time.timeScale = newTimeScale; Time.fixedDeltaTime = newTimeScale * 0.02f; }).SetEase(type.OutEaseType)) .SetUpdate(true); }
void InitPosition() { if (currentSequencePosition == null) { var transposer = currentVCam.GetCinemachineComponent <CinemachineTransposer>(); if (transposer != null) { currentInitialPosition = transposer.m_FollowOffset; } else { currentInitialPosition = currentVCam.transform.position; } } else { DOTweenUtils.KillTween(ref currentSequencePosition); } }
public void Stop() { Time.timeScale = 1; Time.fixedDeltaTime = 0.02f; DOTweenUtils.KillTween(ref currentTween); }
public void Stop() { DOTweenUtils.KillTween(ref currentTween); }
void OnDisable() { DOTweenUtils.KillTween(ref tween); gameObject.SetActive(false); }
void OnEnable() { DOTweenUtils.KillTween(ref tween); tween = DOVirtual.DelayedCall(duration, () => gameObject.SetActive(false)); }
public void Hide() { CurrentAnimator.SetTrigger("hide"); DOTweenUtils.KillTween(ref currentTween); }
public void StopPeriodic() { DOTweenUtils.KillTween(ref currentPeriodicTween); }