Unity 2D – Laser Defender (4)

Continued Damage dealer Create a new script file in our script folder. Add code below into the new script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class DamageDealer : MonoBehaviour { [SerializeField] int damage = 100; public int GetDamage() { return damage; } public void Hit() { Destroy(gameObject); } } And then add this script …