// Initialize sprite and health protected virtual void Start() { rs = GetComponent <RegularShot>(); maxHealth *= difficulty.HealthIncreasedMultiplier; InvokeRepeating("FireShot", 1f, shootInterval); }
public void ReplaceWeapon(RegularShot weapon, float selfDamage, float bulletSpeed, GameObject bulletPrefab, GameObject effect) { Destroy(shootAbility); shootAbility = gameObject.AddComponent(weapon.GetType()) as RegularShot; shootAbility.bulletSpeed = bulletSpeed; shootAbility.bulletTrail = bulletPrefab; shootAbility.damage = selfDamage; shootAbility.particle = effect; }
private void Awake() { cam = Camera.main; rigid = GetComponent <Rigidbody2D>(); shootAbility = GetComponent <RegularShot>(); }