private void SetTimer(int index)
    {
        string slotIdentifier = LootCrateSlot.GetSlotIdentifier(index);

        if (Singleton <TimeManager> .Instance.HasTimer(slotIdentifier))
        {
            float seconds = Singleton <TimeManager> .Instance.TimeLeft(slotIdentifier);

            base.StartCoroutine(CoroutineRunner.DelayActionSequence(new Action(this.Check), seconds, true));
        }
    }
    private void OnAnimationEnd(Spine.AnimationState state, int trackIndex)
    {
        if (this.icon != null)
        {
            this.rewardParticleSystem.transform.position = this.icon.transform.position;
            this.rewardParticleSystem.Play();
            Singleton <AudioManager> .Instance.Spawn2dOneShotEffect(WPFMonoBehaviour.gameData.commonAudioCollection.bonusBoxCollected);

            base.StartCoroutine(CoroutineRunner.DelayActionSequence(delegate
            {
                this.OnPressed();
            }, this.rewardParticleSystem.startLifetime + this.rewardParticleSystem.duration, false));
        }
    }
Beispiel #3
0
    private void InitTimeBombAnimations()
    {
        float seconds = this.cakeRaceMode.RaceTimeLeft / 2f;

        base.StartCoroutine(CoroutineRunner.DelayActionSequence(delegate
        {
            this.SetTimeBombMode(CakeRaceHUD.TimerMode.Intermediate, false, true);
        }, seconds, false));
        float seconds2 = this.cakeRaceMode.RaceTimeLeft - 10f;

        base.StartCoroutine(CoroutineRunner.DelayActionSequence(delegate
        {
            this.SetTimeBombMode(CakeRaceHUD.TimerMode.Critical, false, true);
        }, seconds2, false));
    }
Beispiel #4
0
 protected override void OnTouch()
 {
     if (this.m_boostUsed)
     {
         return;
     }
     this.m_enabled = !this.m_enabled;
     this.m_particlesIgnitionInstance.Play();
     this.m_timeBoostStarted = Time.time;
     this.m_boostUsed        = true;
     base.contraption.ChangeOneShotPartAmount(this.m_partType, this.EffectDirection(), -1);
     if (this.m_loopAudio != null)
     {
         float length;
         if (this.m_shakeAudio != null)
         {
             length = this.m_shakeAudio.clip.length;
             Singleton <AudioManager> .Instance.SpawnOneShotEffect(this.m_shakeAudio, base.transform);
         }
         else
         {
             length = this.m_launchAudio.clip.length;
         }
         base.StartCoroutine(CoroutineRunner.DelayActionSequence(delegate
         {
             this.m_loopAudioObject      = Singleton <AudioManager> .Instance.SpawnLoopingEffect(this.m_loopAudio, base.transform);
             AudioSource loopAudioSource = this.m_loopAudioObject.GetComponent <AudioSource>();
             float originalVolume        = loopAudioSource.volume;
             if (this.m_loopAudioTimeLimit > 0f)
             {
                 base.StartCoroutine(CoroutineRunner.DeltaAction(this.m_loopAudioTimeLimit, false, delegate(float t)
                 {
                     loopAudioSource.volume = originalVolume * t;
                 }));
             }
         }, length, false));
     }
     else
     {
         Singleton <AudioManager> .Instance.SpawnOneShotEffect(this.m_launchAudio, base.transform);
     }
     base.StartCoroutine(this.ShineRocketLight());
 }