private IEnumerator AnimEnableCup(PlayFabLeaderboard.Leaderboard cup, bool enable) { this.Init(null); if (this.cups == null) { yield break; } int cupIndex = (int)cup; cupIndex--; if (cupIndex >= 0 && cupIndex < this.cups.Length && this.cups[cupIndex] != null) { Transform currentCupGraphics = this.cups[cupIndex].Find("BarYou"); Transform shine = this.cups[cupIndex].Find("Shine"); if (currentCupGraphics.gameObject.activeSelf == enable) { yield break; } if (!enable && shine) { shine.gameObject.SetActive(true); shine.transform.localScale = Vector3.one; yield return(base.StartCoroutine(CoroutineRunner.DeltaAction(0.5f, false, delegate(float t) { shine.transform.localScale = Vector3.Lerp(Vector3.zero, Vector3.one, t); }))); shine.gameObject.SetActive(false); } else if (enable && shine) { shine.gameObject.SetActive(true); shine.transform.localScale = Vector3.zero; yield return(base.StartCoroutine(CoroutineRunner.DeltaAction(0.5f, false, delegate(float t) { shine.transform.localScale = Vector3.Lerp(Vector3.one, Vector3.zero, t); }))); GameObject icon = this.cups[cupIndex].Find("CupIcon").gameObject; Animation animation = (!icon) ? null : icon.GetComponent <Animation>(); animation.Play(); } if (currentCupGraphics != null) { currentCupGraphics.gameObject.SetActive(enable); } } yield break; }
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()); }