Merge pull request #21 from CarsonKompon/fix-karate-man-shadows-fade-white

Karate Man shadows no longer fade to White
This commit is contained in:
Jenny Crowe 2022-02-28 14:11:14 -07:00 committed by GitHub
commit f5013c31df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,8 +108,11 @@ namespace RhythmHeavenMania.Games.KarateMan
private IEnumerator FadeOut() private IEnumerator FadeOut()
{ {
yield return new WaitForSeconds(Conductor.instance.secPerBeat * 3); yield return new WaitForSeconds(Conductor.instance.secPerBeat * 3);
var shadowSprite = shadow.GetComponent<SpriteRenderer>();
var fadeColor = shadowSprite.color;
fadeColor.a = 0;
SpriteRenderer.DOColor(new Color(1, 1, 1, 0), Conductor.instance.secPerBeat * 3).OnComplete(delegate { Destroy(this.gameObject); }); SpriteRenderer.DOColor(new Color(1, 1, 1, 0), Conductor.instance.secPerBeat * 3).OnComplete(delegate { Destroy(this.gameObject); });
shadow.GetComponent<SpriteRenderer>().DOColor(new Color(1, 1, 1, 0), Conductor.instance.secPerBeat * 3).OnComplete(delegate { Destroy(shadow); }); shadowSprite.DOColor(fadeColor, Conductor.instance.secPerBeat * 3).OnComplete(delegate { Destroy(shadow); });
} }
} }
} }