summaryrefslogtreecommitdiff
path: root/Assembly_CSharp/BuildButtonUI.cs
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2023-11-26 23:52:30 +0800
committerchai <215380520@qq.com>2023-11-26 23:52:30 +0800
commit626381f061cde0c78564f6336e3131835cf20a5b (patch)
treed9991d6eda6ae5d7649ac91ecaa3b4dc833cd4c3 /Assembly_CSharp/BuildButtonUI.cs
parent0e63c4a2c6dec8dfa260501fb7d73750261ea7b7 (diff)
* move
Diffstat (limited to 'Assembly_CSharp/BuildButtonUI.cs')
-rw-r--r--Assembly_CSharp/BuildButtonUI.cs107
1 files changed, 0 insertions, 107 deletions
diff --git a/Assembly_CSharp/BuildButtonUI.cs b/Assembly_CSharp/BuildButtonUI.cs
deleted file mode 100644
index 86c7732..0000000
--- a/Assembly_CSharp/BuildButtonUI.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-using UnityEngine;
-using UnityEngine.UI;
-
-public class BuildButtonUI : MonoBehaviour
-{
- [SerializeField]
- private GameObject tower;
-
- [SerializeField]
- private TowerFlyweight towerFlyweight;
-
- [SerializeField]
- private Text priceTag;
-
- [SerializeField]
- private Text modifiersText;
-
- [SerializeField]
- private TowerType myTowerType;
-
- private void Start()
- {
- priceTag.text = towerFlyweight.currentPrice + "g";
- UpdateModifiersText();
- }
-
- public void Build()
- {
- BuildingManager.instance.EnterBuildMode(tower, towerFlyweight.currentPrice, towerFlyweight.priceIncrease, myTowerType);
- }
-
- public void UpdatePriceText()
- {
- priceTag.text = towerFlyweight.currentPrice + "g";
- }
-
- public void UpdateModifiersText()
- {
- if (!(modifiersText != null))
- {
- return;
- }
- string text = "";
- if (TowerManager.instance.GetBonusBaseDamage(myTowerType) > 0)
- {
- text = text + "\n+" + TowerManager.instance.GetBonusBaseDamage(myTowerType) + " Base Damage";
- }
- if (TowerManager.instance.GetBonusBaseDamage(myTowerType) < 0)
- {
- text = text + "\n" + TowerManager.instance.GetBonusBaseDamage(myTowerType) + " Base Damage";
- }
- if (TowerManager.instance.GetBonusHealthDamage(myTowerType) > 0)
- {
- text = text + "\n+" + TowerManager.instance.GetBonusHealthDamage(myTowerType) + " Health Damage";
- }
- if (TowerManager.instance.GetBonusArmorDamage(myTowerType) > 0)
- {
- text = text + "\n+" + TowerManager.instance.GetBonusArmorDamage(myTowerType) + " Armor Damage";
- }
- if (TowerManager.instance.GetBonusShieldDamage(myTowerType) > 0)
- {
- text = text + "\n+" + TowerManager.instance.GetBonusShieldDamage(myTowerType) + " Shield Damage";
- }
- if (TowerManager.instance.GetCritChance(myTowerType) + TowerManager.instance.GetCritChanceLevelMultiplier(myTowerType) > 0f)
- {
- text = text + "\n+(" + (int)(TowerManager.instance.GetCritChance(myTowerType) * 100f);
- if (TowerManager.instance.GetCritChanceLevelMultiplier(myTowerType) > 1f)
- {
- text = text + " + " + (int)TowerManager.instance.GetCritChanceLevelMultiplier(myTowerType) + "xLvl";
- }
- else if (TowerManager.instance.GetCritChanceLevelMultiplier(myTowerType) > 0f)
- {
- text += " + level";
- }
- text += ")% Crit";
- }
- if (TowerManager.instance.GetStunChance(myTowerType) > 0f)
- {
- text = text + "\n+" + Mathf.FloorToInt(TowerManager.instance.GetStunChance(myTowerType) * 101f) + "% Freeze Chance";
- }
- if (TowerManager.instance.GetBonusRange(myTowerType) > 0f)
- {
- text = text + "\n+" + TowerManager.instance.GetBonusRange(myTowerType) + " Range";
- }
- if (TowerManager.instance.GetBonusBlast(myTowerType) > 0f)
- {
- text = text + "\n+" + (int)(TowerManager.instance.GetBonusBlast(myTowerType) * 100f) + "% Blast Radius";
- }
- if (TowerManager.instance.GetBonusSlow(myTowerType) > 0f)
- {
- text = text + "\n+" + (int)(TowerManager.instance.GetBonusSlow(myTowerType) * 100f) + "% Slow";
- }
- if (TowerManager.instance.GetBonusBleed(myTowerType) > 0f)
- {
- text = text + "\n+" + (int)(TowerManager.instance.GetBonusBleed(myTowerType) * 100f) + "% Bleed";
- }
- if (TowerManager.instance.GetBonusBurn(myTowerType) > 0f)
- {
- text = text + "\n+" + (int)(TowerManager.instance.GetBonusBurn(myTowerType) * 100f) + "% Burn";
- }
- if (TowerManager.instance.GetBonusPoison(myTowerType) > 0f)
- {
- text = text + "\n+" + (int)(TowerManager.instance.GetBonusPoison(myTowerType) * 100f) + "% Poison";
- }
- modifiersText.text = text;
- }
-}