public void Initialize(Vector3 spawnPosition, Vector3 targetPosition, float time, int extraBonus, SmeltingLaserUpgradeManager manager) { collider.enabled = false; transform.position = spawnPosition; baseDamage += extraBonus; // for the upgrade stuff applyUpgrades(); StartCoroutine(laserRoutine(targetPosition, time)); upgradeManager = manager; }
void upgradeLaser() { collider.enabled = false; LeanTween.alpha(this.gameObject, 0, 1f).setOnComplete(() => Destroy(this.gameObject)); foreach (ShipWeaponScript script in PlayerProperties.playerScript.GetShipWeaponScripts()) { SmeltingLaserUpgradeManager smeltingLaserUpgradeManager = script.shipWeaponTemplate.GetComponent <SmeltingLaserUpgradeManager>(); if (smeltingLaserUpgradeManager != null) { smeltingLaserUpgradeManager.addFragment(); } } }