private void OnTriggerEnter2D(Collider2D collision) { if (collision.GetComponent <autoMover>()) { if (fadeIn) { jukeBox.FadeIn(secsIn, volume, clipIn, pitch, loop); } else { jukeBox.FadeOut(secsOut, clipOut); } } }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.GetComponent <autoMover>()) { collision.gameObject.GetComponent <Animator>().enabled = false; collision.rigidbody.bodyType = RigidbodyType2D.Static; collision.otherRigidbody.bodyType = RigidbodyType2D.Static; jukeBox.FadeIn(secsIn, volume, clipIn, pitch, loop); Invoke("Transition", transitionDelay); Invoke("Load", loadDelay); } }