public void DamageTest() { float damage = 10; EarthHealth earthHealth = new EarthHealth(); float startHealth = earthHealth.GetHealth(); earthHealth.TakeDamage(damage); float newHealth = earthHealth.GetHealth(); Assert.AreEqual(startHealth, newHealth + damage); }
void Start() { GameObject earth = GameObject.FindGameObjectWithTag("Earth"); GameObject player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <PlayerHealth>(); playerWeapon = player.GetComponent <PlayerWeapon>(); scoreKeeping = player.GetComponent <ScoreKeeping>(); earthHealth = earth.GetComponent <EarthHealth>(); upgradeMenu = gameObject.GetComponent <UpgradeMenu>(); if (upgradeMenu != null) { RefreshTexts(); ToggleUpgradeButtons(); } }