您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

27 行
1014 B

using Unity.Entities;
using UnityEngine;
using UnityEngine.UI;
public class GrenadeLauncherUI : AbilityUI
{
public RawImage activeIcon;
public Text cooldownText;
public GameObject disabledOverlay;
public override void UpdateAbilityUI(EntityManager entityManager, ref GameTime time)
{
var state = entityManager.GetComponentData<Ability_GrenadeLauncher.PredictedState>(ability);
var settings = entityManager.GetComponentData<Ability_GrenadeLauncher.Settings>(ability);
activeIcon.enabled = state.phase == Ability_GrenadeLauncher.Phase.Active;
bool showCooldown = state.phase == Ability_GrenadeLauncher.Phase.Cooldown;
cooldownText.gameObject.SetActive(showCooldown);
disabledOverlay.SetActive(showCooldown);
if (showCooldown)
{
float cooldownLeft = settings.cooldownDuration - time.DurationSinceTick(state.phaseStartTick);
cooldownText.text = string.Format("{0:F1}", cooldownLeft);
}
}
}