当前位置: 首页>>代码示例>>C#>>正文


C# Ability.Use方法代码示例

本文整理汇总了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;

        }
开发者ID:weichx,项目名称:AbilitySystem,代码行数:34,代码来源:CastQueue.cs

示例2: Damager

    public Damager(UnitBody attacker, UnitBody target, Ability ability)
    {
        Attacker = attacker;
            Attacker.Tick += OnTick;
            Target = target;

            currdelay = ability.Delay;
            Value = ability.Use();
    }
开发者ID:Elringus,项目名称:Saga,代码行数:9,代码来源:Damager.cs

示例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;
     }
 }
开发者ID:weichx,项目名称:AbilitySystem,代码行数:12,代码来源:CastQueue.cs

示例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);
        }
    }
开发者ID:tedmunds,项目名称:HunterGame,代码行数:11,代码来源:Pawn.cs


注:本文中的Ability.Use方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。