private void Start() { if (!tutorial) { Time.timeScale = 1; } upgrades = UpgradeSystem.Get(); increaseScoreMilestone = initialMilestone; WaveSystem.OnStartWaveFirstTime += StartGivingPoints; Fairy.OnFairyDeath += CheckFairies; Fairy.OnFairyEscaped += AddTimesEscaped; Enemy.OnDeath += AddPoints; upgrades.AssignUpgrades(); maxFairies = (int)upgrades.GetUpgrade(0).GetCurrentAmount(); shoot.rechargeTime = upgrades.GetUpgrade(1).GetCurrentAmount(); towerFireRate = upgrades.GetUpgrade(2).GetCurrentAmount(); fairySpeed = (int)upgrades.GetUpgrade(3).GetCurrentAmount(); turretSpawner.fireRate = towerFireRate; upgradePointsGiveMilestone = upgradePointsGiveMilestonesOriginal; for (int i = 0; i < confetti.Length; i++) { confetti[i].Stop(); } }
public IEnumerator UpgradeObjectRetrievalTest() { UpgradeSystem upgradeSystem = new UpgradeSystem(); Upgrade testUpgrade = new Upgrade("Attack", 1); upgradeSystem.AddUpgrade(testUpgrade); Upgrade testUpgrade2 = upgradeSystem.GetUpgrade("Attack"); Assert.AreEqual("Attack", testUpgrade2.GetUpgradeName()); yield return(null); }
public IEnumerator UpgradeLevelTest() { UpgradeSystem upgradeSystem = new UpgradeSystem(); Upgrade testUpgrade = new Upgrade("Attack", 1); upgradeSystem.AddUpgrade(testUpgrade); int upgradeLevel = upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel(); upgradeSystem.GetUpgrade("Attack").IncreaseLevel(); Assert.AreNotEqual(upgradeLevel, upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel()); upgradeLevel = upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel(); upgradeSystem.GetUpgrade("Attack").SetLevel(0); Assert.AreNotEqual(upgradeLevel, upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel()); yield return(null); }