示例#1
0
        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;
        }
示例#2
0
    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);
        });
    }
示例#3
0
 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;
     }
 }
示例#4
0
        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);
            });
        }
示例#5
0
 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;
     }
 }
示例#6
0
    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);
    }
示例#7
0
 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);
     }
 }
示例#8
0
 public void Stop()
 {
     Time.timeScale      = 1;
     Time.fixedDeltaTime = 0.02f;
     DOTweenUtils.KillTween(ref currentTween);
 }
示例#9
0
 public void Stop()
 {
     DOTweenUtils.KillTween(ref currentTween);
 }
示例#10
0
 void OnDisable()
 {
     DOTweenUtils.KillTween(ref tween);
     gameObject.SetActive(false);
 }
示例#11
0
 void OnEnable()
 {
     DOTweenUtils.KillTween(ref tween);
     tween = DOVirtual.DelayedCall(duration, () => gameObject.SetActive(false));
 }
示例#12
0
 public void Hide()
 {
     CurrentAnimator.SetTrigger("hide");
     DOTweenUtils.KillTween(ref currentTween);
 }
示例#13
0
 public void StopPeriodic()
 {
     DOTweenUtils.KillTween(ref currentPeriodicTween);
 }