Beispiel #1
0
 void onItemCollected(ItemCollectedEvent itemCollected)
 {
     if (itemCollected.PlayerUpgrade.GetHealth() > 0)
     {
         float healthIncrease = playerHealth.GetTotalHealth() * itemCollected.PlayerUpgrade.GetHealth();
         updateHealthbar(playerHealth.GetCurrentHealth() + healthIncrease);
     }
 }
Beispiel #2
0
    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);
    }
Beispiel #3
0
    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);
    }