本文整理汇总了C#中Ability.Use方法的典型用法代码示例。如果您正苦于以下问题:C# Ability.Use方法的具体用法?C# Ability.Use怎么用?C# Ability.Use使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ability
的用法示例。
在下文中一共展示了Ability.Use方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateCast
public Ability UpdateCast() {
if (queuedExpire.ReadyWithReset(0.2f)) {
queuedAbility = null;
}
if (currentAbility == null || !gcdTimer.Ready) return null;
CastState castState = currentAbility.UpdateCast();
if (castState == CastState.Invalid) {
Clear();
}
else if (castState == CastState.Completed) {
if (currentAbility.IsInstant && !currentAbility.IgnoreGCD) {
gcdTimer.Reset(GetGlobalCooldownTime(currentAbility));
}
currentAbility = queuedAbility;
currentContext = queuedContext;
queuedAbility = null;
queuedContext = null;
if (currentAbility != null && !currentAbility.Use(currentContext)) {
currentAbility = null;
currentContext = null;
}
}
return currentAbility;
}
示例2: Damager
public Damager(UnitBody attacker, UnitBody target, Ability ability)
{
Attacker = attacker;
Attacker.Tick += OnTick;
Target = target;
currdelay = ability.Delay;
Value = ability.Use();
}
示例3: Enqueue
public void Enqueue(Ability ability, OldContext context) {
if (ability == null || context == null) return;
if (currentAbility == null) {
currentAbility = ability;
currentContext = context;
currentAbility.Use(context);
}
else {
queuedAbility = ability;
queuedContext = context;
}
}
示例4: UseAbility
// Little utility for using abilities that ensures they are added to teh correct lists
// TODO: some way of using targets?
private void UseAbility(Ability a)
{
// Dont bother adding to the list if it is instant use
bool used = a.Use(this);
if(a.totalDuration > 0.0f && used) {
abilitiesInUse.Add(a);
}
}