private void SetupUpgradeTexts(Element element) { if (ElementUtility.ElementDamage(element) == 0) { damageChange.text = string.Empty; } else { damageChange.text = string.Format("{0}{1}", ElementUtility.ElementDamage(element) >= 0f ? "+" : "-", ElementUtility.ElementDamage(element).ToString()); damageChange.color = ElementUtility.ElementDamage(element) >= 0f ? Color.green : Color.red; } if (ElementUtility.ElementRange(element) == 0) { fireRangeChange.text = string.Empty; } else { fireRangeChange.text = string.Format("{0}{1}", ElementUtility.ElementRange(element) >= 0f ? "+" : "-", ElementUtility.ElementRange(element).ToString()); fireRangeChange.color = ElementUtility.ElementDamage(element) >= 0f ? Color.green : Color.red; } if (ElementUtility.ElementFireRate(element) == 0) { fireRateChange.text = string.Empty; } else { fireRateChange.text = string.Format("{0}{1}", ElementUtility.ElementFireRate(element) >= 0f ? "+" : "-", ElementUtility.ElementFireRate(element).ToString()); fireRateChange.color = ElementUtility.ElementDamage(element) >= 0f ? Color.green : Color.red; } if (ElementUtility.ElementBounces(element) == 0) { bounces.text = string.Empty; } else { bouncesChange.text = string.Format("{0}{1}", ElementUtility.ElementBounces(element) >= 0f ? "+" : "-", ElementUtility.ElementBounces(element).ToString()); bouncesChange.color = ElementUtility.ElementDamage(element) >= 0f ? Color.green : Color.red; } if (ElementUtility.ElementChain(element) == 0) { chainChange.text = string.Empty; } else { chainChange.text = string.Format("{0}{1}", ElementUtility.ElementChain(element) >= 0f ? "+" : "-", ElementUtility.ElementChain(element).ToString()); chainChange.color = ElementUtility.ElementDamage(element) >= 0f ? Color.green : Color.red; } if (ElementUtility.ElementAoE(element) == 0) { aoeChange.text = string.Empty; } else { aoeChange.text = string.Format("{0}{1}", ElementUtility.ElementAoE(element) >= 0f ? "+" : "-", ElementUtility.ElementAoE(element).ToString()); aoeChange.color = ElementUtility.ElementDamage(element) >= 0f ? Color.green : Color.red; } if (ElementUtility.ElementSlow(element) == 0) { slowChange.text = string.Empty; } else { slowChange.text = string.Format("{0}{1}%", ElementUtility.ElementSlow(element) >= 0f ? "+" : "-", ElementUtility.ElementSlow(element).ToString()); slowChange.color = ElementUtility.ElementDamage(element) >= 0f ? Color.green : Color.red; } }