private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("Crop") && other.gameObject.name == target.gameObject.name && !killBird) { //landed = true; targetedLand.setContestedStatus(true); crowRenderer.sprite = sprLanded; StartCoroutine(harmCrop()); } }
IEnumerator harmCrop() { targetedLand.setContestedStatus(true); yield return(new WaitForSeconds(delay)); if (!killBird) { targetedLand.harvestDestroy(); } cropDestroyed = true; targetedLand.setContestedStatus(false); }