public void UpAttackSpeed() { if (coin >= upCostAttackSpeed && lm.GetAttackSpeed() > 0.1f) { lm.SetCoin(lm.GetCoin() - upCostAttackSpeed); coin = lm.GetCoin(); coinText.text = coin.ToString(); lm.SetAttackSpeed(lm.GetAttackSpeed() - 0.08f); attackSpeedText.text = lm.GetAttackSpeed().ToString(); } }
// Start is called before the first frame update void Start() { lm = new LegacyManager(); potionCount = lm.GetPotion(); playerHealth = player.GetComponent <Damagable>(); playerBehave = player.GetComponent <PlayerBehaviours>(); if (potionText != null) { potionText.text = "X " + potionCount; } if (player == null) { return; } playerHealth.maxHealth = lm.GetMaxHealth(); playerHealth.SetHealth(lm.GetCurrentHealth()); //player.GetComponent<Damager>().damage = lm.GetDamage(); playerBehave.attackDelay = lm.GetAttackSpeed(); playerBehave.maxArrowAmmo = lm.GetMaxArrow(); if (playerBehave.ammoBar != null) { playerBehave.ammoBar.maxValue = lm.GetMaxArrow(); playerBehave.ammoBar.value = lm.GetMaxArrow(); } }
// Start is called before the first frame update void Start() { lm = new LegacyManager(); maxArrow = lm.GetMaxArrow(); arrowDamage = lm.GetDamage(); attackSpeed = lm.GetAttackSpeed(); maxHealth = lm.GetMaxHealth(); potion = lm.GetPotion(); coin = lm.GetCoin(); maxArrowText.text = maxArrow.ToString(); arrowDamageText.text = arrowDamage.ToString(); attackSpeedText.text = attackSpeed.ToString(); maxHealthText.text = maxHealth.ToString(); potionText.text = potion.ToString(); coinText.text = coin.ToString(); }