From 626381f061cde0c78564f6336e3131835cf20a5b Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Sun, 26 Nov 2023 23:52:30 +0800 Subject: * move --- Assembly_CSharp/UI/UniBonusUI.cs | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Assembly_CSharp/UI/UniBonusUI.cs (limited to 'Assembly_CSharp/UI/UniBonusUI.cs') 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; + } +} -- cgit v1.1-26-g67d0