void Damage(Transform enemy) { enemy_CS e = enemy.GetComponent <enemy_CS>(); if (e != null) { e.TakeDamage(damage); } }
// Start is called before the first frame update void Start() { enemy = GetComponent <enemy_CS>(); target = WayPoints_CS.waypoints[0]; }