public void SetOwner(GameObject owner) { this.owner = owner; if ((enemy_handle = owner.GetComponent <enemy_controller>()) != null) { on_enemy = true; enemy_handle.RegisterBuff(this); return; } on_enemy = false; unit_handle = owner.GetComponent <unit_control_script>(); unit_handle.RegisterBuff(this); }