void onItemCollected(ItemCollectedEvent itemCollected) { if (itemCollected.PlayerUpgrade.GetHealth() > 0) { float healthIncrease = playerHealth.GetTotalHealth() * itemCollected.PlayerUpgrade.GetHealth(); updateHealthbar(playerHealth.GetCurrentHealth() + healthIncrease); } }
public void NotifyHUD() { var updateInfo = new HUDInfo { CurrentHealth = health.GetCurrentHealth(), TotalHealth = health.GetTotalHealth(), Damage = weapon.getCurrentDamage().ToString(), Range = weapon.getCurrentRange().ToString() }; APIHUD.instance.notifyChange(this, updateInfo); }
public void NotifyHUD() { var updateInfo = new HUDInfo { CurrentHealth = health.GetCurrentHealth(), TotalHealth = health.GetTotalHealth(), VisibleUpgradeButton = IsUpgradeable(GameObject.FindGameObjectWithTag("Human").GetComponent <Player>().GetNumCoins()), VisibleRepairButton = IsRepairable(GameObject.FindGameObjectWithTag("Human").GetComponent <Player>().GetNumCoins()) }; APIHUD.instance.notifyChange(this, updateInfo); }