當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。