private void ExecutionStarted(Song song, int streakPower) { TriggerFade(.25f); foreach (RectTransform indicatorLine in _indicatorLines) { StartCoroutine(Coroutines.FadeColor(indicatorLine.gameObject, Color.red, BeatInputService.HALF_NOTE_TIME)); } }
private void ExecutionFinished(Song obj, int streakPower) { TriggerFade(1); foreach (RectTransform indicatorLine in _indicatorLines) { StartCoroutine(Coroutines.FadeColor(indicatorLine.gameObject, Color.cyan, BeatInputService.HALF_NOTE_TIME)); } }
public void TurnRed(Light threadmillLight) { // GLOBAL LIGHTS if (globalLightsCoroutine != null) { StopCoroutine(globalLightsCoroutine); } List <IEnumerator> fadeToRedCoroutines = new List <IEnumerator>(); List <IEnumerator> fadeBackFromRedCoroutines = new List <IEnumerator>(); fadeToRedCoroutines.Add( Coroutines.FadeColor(directionalLight, 0.5f, directionalLight.color, Color.red)); fadeBackFromRedCoroutines.Add( Coroutines.FadeColor(directionalLight, 0.5f, Color.red, GetDefaultColor(directionalLight))); for (int i = 0; i < pointLights.Length; i++) { fadeToRedCoroutines.Add( Coroutines.FadeColor(pointLights[i], 0.5f, pointLights[i].color, Color.red)); fadeBackFromRedCoroutines.Add( Coroutines.FadeColor(pointLights[i], 0.5f, Color.red, GetDefaultColor(pointLights[i]))); } globalLightsCoroutine = CoroutineSingleton.Instance.StartCoroutine(Coroutines.Chain( Coroutines.Join(fadeToRedCoroutines.ToArray()), Coroutines.Wait(1.0f), Coroutines.Join(fadeBackFromRedCoroutines.ToArray()))); // TREADMILL LIGHT if (treadmillLightsCoroutine.ContainsKey(threadmillLight) && treadmillLightsCoroutine[threadmillLight] != null) { StopCoroutine(treadmillLightsCoroutine[threadmillLight]); } Renderer r = threadmillLight.transform.parent.GetComponent <Renderer>(); treadmillLightsCoroutine[threadmillLight] = StartCoroutine(Coroutines.Chain( Coroutines.Join( Coroutines.FadeColor(threadmillLight, 0.5f, threadmillLight.color, Color.red), // Coroutines.FadeColor(r.material, "_Color", 0.5f, Color.white, new Color(255, 89, 89) / 255.0f), Coroutines.FadeColor(r.material, "_EmissionColor", 0.5f, Color.black, Color.red)), Coroutines.Wait(1.0f), Coroutines.Join( Coroutines.FadeColor(threadmillLight, 0.5f, Color.red, GetDefaultColor(threadmillLight)), // Coroutines.FadeColor(r.material, "_Color", 0.5f, new Color(255, 89, 89) / 255.0f, Color.white), Coroutines.FadeColor(r.material, "_EmissionColor", 0.5f, Color.red, Color.black)))); }
public void Initialize(Sprite sprite, AnimationCurve itemSpawnYCurve) { _spriteRenderer.sprite = sprite; Color prevColor = _spriteRenderer.color; Color transparent = new Color(prevColor.r, prevColor.g, prevColor.b, 0); _spriteRenderer.color = transparent; StartCoroutine(Coroutines.FadeColor(gameObject, prevColor, 1)); StartCoroutine(Coroutines.MoveAlongCurve(transform, itemSpawnYCurve, Vector3.up, 1f, false, () => { StartCoroutine(Coroutines.FadeColor(gameObject, transparent, 2, () => { Destroy(gameObject); })); })); }
public void TurnGreen(Light threadmillLight) { Renderer r = threadmillLight.transform.parent.GetComponent <Renderer>(); if (treadmillLightsCoroutine.ContainsKey(threadmillLight) && treadmillLightsCoroutine[threadmillLight] != null) { StopCoroutine(treadmillLightsCoroutine[threadmillLight]); } treadmillLightsCoroutine[threadmillLight] = StartCoroutine(Coroutines.Chain( Coroutines.Join( Coroutines.FadeColor(threadmillLight, 0.5f, threadmillLight.color, Color.green), // Coroutines.FadeColor(r.material, "_Color", 0.5f, Color.white, new Color(255, 89, 89) / 255.0f), Coroutines.FadeColor(r.material, "_EmissionColor", 0.5f, r.material.GetColor("_EmissionColor"), Color.green)), Coroutines.Wait(1.0f), Coroutines.Join( Coroutines.FadeColor(threadmillLight, 0.5f, Color.green, GetDefaultColor(threadmillLight)), // Coroutines.FadeColor(r.material, "_Color", 0.5f, new Color(255, 89, 89) / 255.0f, Color.white), Coroutines.FadeColor(r.material, "_EmissionColor", 0.5f, Color.green, Color.black)))); }