void OnTriggerEnter(Collider other) { INettable x = other.GetComponent <INettable>(); if (x != null) { x.BeNetted(1.0f); other.GetComponent <Creep>().TakeDamage(netDamage, Tower.DamageType.PHYSICAL); Destroy(gameObject); } }
void FlashFreeze() { foreach (GameObject x in countEnemiesInCollider.creepsInsideCollider) { INettable net = x.GetComponent <INettable>(); if (net != null) { net.BeNetted(howLongToFreezeEnemies); } } abilityCountdown = Time.time + abilityCooldown; DeactivateAbilityIndicator(); // freeze some enemies. doesn't hit air units Air units will have their own path. }