private IEnumerator TemporarilyDisableTongue() { // Temporarily disables yoshi's tongue Yoshi yoshi = FindObjectOfType <Yoshi>(); yoshi.EnableTongue = false; yield return(new WaitForSeconds(0.1f)); yoshi.EnableTongue = true; }
private void OnCollisionEnter2D(Collision2D collision) { // If the other thing is Yoshi AND we're enabled AND Yoshi is not invincible Yoshi yoshi = collision.gameObject.GetComponent <Yoshi>(); if (yoshi != null && enabled && !yoshi.Invincible) { // Start harming Yoshi StartCoroutine("HarmYoshi"); } }