using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class UAVSkillInfo : MonoBehaviour { public Text titleTxt; public Image icon; public Text descTxt; void Awake() { titleTxt.text = Language.GetStr ("PowerTip", "extraPower"); } public void SetData(Equipment equipment) { UAVData uavData = UAVManager.GetInstance ().GetDataByEquipId (equipment.GetData().id); string desc = ""; for(int i=0; i 0) { desc += GetBuffDesc (powerData.buff); } desc += "\n" + Language.GetStr ("PowerTip", "coolDown").Replace("%SEC%", powerData.cd.ToString()); icon.sprite = Power.GetIcon (powerData); if(i < uavData.powers.Length - 1) desc += "\n\n"; } descTxt.text = desc; } private string GetTarget(PowerData powerData) { if (powerData.target == Power.TargetRange.Self.GetHashCode ()) return Language.GetStr ("PowerTip", "tarSelf"); return ""; } private string GetValue(PowerData powerData) { if (powerData.value_type == Power.ValueType.Percent.GetHashCode ()) { return powerData.value + "%"; } else if(powerData.value_type == Power.ValueType.Constant.GetHashCode()) { return powerData.value.ToString (); } return ""; } private string GetHealDesc(PowerData powerData) { string str = Language.GetStr ("PowerTip", "heal"); str = str.Replace ("%TAR%", GetTarget(powerData)); str = str.Replace ("%NUM%", GetValue(powerData)); return str; } private string GetBuffTarget(BuffData buffData) { if (buffData.target == Buff.TargetType.Launcher.GetHashCode()) return Language.GetStr ("PowerTip", "tarSelf"); return ""; } private string GetBuffValue(BuffData buffData, int index) { if (buffData.value_type[index] == ConfigValue.ValueType.Percentage.GetHashCode ()) return buffData.value[index] + "%"; return ""; } private string GetBuffDesc(int buffId) { BuffData buffData = BuffManager.GetInstance ().GetData (buffId); string str = ""; for(int i=0; i