summaryrefslogtreecommitdiff
path: root/Assembly_CSharp/UI/UniBonusUI.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/UI/UniBonusUI.cs
parent0e63c4a2c6dec8dfa260501fb7d73750261ea7b7 (diff)
* move
Diffstat (limited to 'Assembly_CSharp/UI/UniBonusUI.cs')
-rw-r--r--Assembly_CSharp/UI/UniBonusUI.cs46
1 files changed, 46 insertions, 0 deletions
diff --git a/Assembly_CSharp/UI/UniBonusUI.cs b/Assembly_CSharp/UI/UniBonusUI.cs
new file mode 100644
index 0000000..8d29a9b
--- /dev/null
+++ b/Assembly_CSharp/UI/UniBonusUI.cs
@@ -0,0 +1,46 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+public class UniBonusUI : MonoBehaviour
+{
+ public static UniBonusUI instance;
+
+ [SerializeField]
+ private GameObject uniUI;
+
+ [SerializeField]
+ private Text uniUIText;
+
+ private int healthTotal;
+
+ private int armorTotal;
+
+ private int shieldTotal;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ public void UniBonus(int health, int armor, int shield)
+ {
+ healthTotal += health;
+ armorTotal += armor;
+ shieldTotal += shield;
+ uniUI.SetActive(value: true);
+ string text = "";
+ if (healthTotal > 0)
+ {
+ text = text + "+" + healthTotal + "HD";
+ }
+ if (armorTotal > 0)
+ {
+ text = text + "\n+" + armorTotal + "AD";
+ }
+ if (shieldTotal > 0)
+ {
+ text = text + "\n+" + shieldTotal + "SD";
+ }
+ uniUIText.text = text;
+ }
+}