本文整理匯總了C#中Ability.CooldownRemaining方法的典型用法代碼示例。如果您正苦於以下問題:C# Ability.CooldownRemaining方法的具體用法?C# Ability.CooldownRemaining怎麽用?C# Ability.CooldownRemaining使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Ability
的用法示例。
在下文中一共展示了Ability.CooldownRemaining方法的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;
}
}