private void OnTriggerExit(Collider other) { TroopHitPoints troopHP = other.GetComponent <TroopHitPoints> (); //if (other.transform == target) // target = null; }
public void DealDamage() { anim.SetTrigger("Melee Attack"); TroopHitPoints troopHitPoints = target.GetComponentInChildren <TroopHitPoints>(); troopHitPoints.TakeDamage(attackDamage); }
public void ShootProjectile() { GameObject proj = Instantiate(projectile, muzzle.position, muzzle.rotation); TroopHitPoints troopHP = target.GetComponentInChildren <TroopHitPoints> (); proj.GetComponent <EnemyProjectile>().SetTarget(attackDamage, troopHP.hitTarget); }
private void OnTriggerEnter(Collider other) { TroopHitPoints troopHP = other.transform.GetComponent <TroopHitPoints> (); if (troopHP != null) { Destroy(troopHP.transform.parent.gameObject); } }
private void OnTriggerEnter(Collider other) { TroopHitPoints troopHP = other.transform.GetComponent <TroopHitPoints> (); if (troopHP != null) { Win(); } }
private void OnTriggerExit(Collider other) { TroopHitPoints troop = other.transform.GetComponent <TroopHitPoints> (); if (troop != null) { troopsCaught.Remove(troop); } }
private void OnTriggerEnter(Collider other) { currentState.OnTriggerEnter(other); TroopHitPoints troopHP = other.GetComponent <TroopHitPoints> (); if (troopHP != null && !targets.Contains(troopHP.transform)) { targets.Add(troopHP.transform); } }