本文整理汇总了C#中Ability.OnCooldown方法的典型用法代码示例。如果您正苦于以下问题:C# Ability.OnCooldown方法的具体用法?C# Ability.OnCooldown怎么用?C# Ability.OnCooldown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ability
的用法示例。
在下文中一共展示了Ability.OnCooldown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ActionBarUpdate
/// <summary>
/// Method for changing the fill of the overlay image corresponding to the ability
/// </summary>
/// <param name="overlayImage">Image for visualizing cooldown</param>
/// <param name="ability">The ability corresponding to the action bar slot</param>
public void ActionBarUpdate(ref Image overlayImage, Ability ability)
{
if (ability.OnCooldown()) {
if(ability.CooldownRemaining() < 0) {
if (!castBar.gameObject.activeSelf) {
string[] subpar = ability.tooltipText.Split(':');
castBar.gameObject.SetActive(true);
Color color = subpar[0] == "Poison Dart" ? new Color(106f / 255f, 197f / 255f, 54f / 255f) : new Color(106f / 255f, 0f / 255f, 0f / 255f);
castBar.fillRect.GetComponentInChildren<Image>().color = color;
castBar.targetGraphic.GetComponentInChildren<Image>().color = new Color(255f / 255f, 255f / 255f, 255f / 255f);
currentText = string.Format("Out of {0} Berries", subpar[0] == "Poison Dart" ? "Bad" : "Good");
castBar.GetComponentInChildren<Text>().text = currentText;
castBar.value = 1;
}
}
overlayImage.fillAmount = ability.CooldownRemaining();
} else if (overlayImage.fillAmount < 1) {
overlayImage.fillAmount = 1;
}
}