コード例 #1
0
 public override void Evaluate(ActionUsingNode node)
 {
     if (_isWaiting)
     {
         if (TimeManager.Time >= node.ActionEvent.TimeStart + WaitTime)
         {
             node.AdvanceEvent();
         }
         return;
     }
     if (!PlayerInputSystem.GetButton(ChargeInput) || _vitalStat.Current < Cost)
     {
         node.AdvanceEvent();
     }
 }
コード例 #2
0
 public override void Evaluate(ActionUsingNode node)
 {
     if (!_currentSpawn.Tags.Contain(EntityTags.Moving))
     {
         node.AdvanceEvent();
         _currentSpawn.Destroy(); // this doesn't respect pooling
         _currentSpawn = null;
     }
 }
コード例 #3
0
ファイル: WaitChargeLayer.cs プロジェクト: Peng2017/Framework
        public override void Evaluate(ActionUsingNode node)
        {
            var elapsed = (TimeManager.Time - _start);

            if (elapsed >= MaxChargeTime || (_input != null && !_input.Handler.GetButton(ChargeInput)))
            {
                var chargeComponent = node.ActionEvent.Action.Entity.GetOrAdd <ChargeComponent>();
                chargeComponent.CurrentCharge = ForceRange.Lerp(Mathf.Clamp01(elapsed / MaxChargeTime));
                node.AdvanceEvent();
            }
        }
コード例 #4
0
ファイル: AnimationLayer.cs プロジェクト: Peng2017/Framework
        public override void Evaluate(ActionUsingNode node)
        {
            switch (node.CurrentState)
            {
            case ActionUsingNode.State.Disabled:
                return;

            case ActionUsingNode.State.Starting:
                if (node.Animator.CurrentAnimation == Animation)
                {
                    node.CurrentState = ActionUsingNode.State.Running;
                }
                else
                {
                    return;
                }
                break;

            case ActionUsingNode.State.Running:
                if (node.Animator.CurrentAnimation != Animation)
                {
                    World.Get <ActionSystem>().AdvanceEvent(node);
                    return;
                }
                break;
            }
            if (!string.IsNullOrEmpty(node.Animator.CurrentAnimationEvent) && node.LastProcessedAnimationEvent != node.Animator.CurrentAnimationEvent)
            {
                node.LastProcessedAnimationEvent = node.Animator.CurrentAnimationEvent;
                if (!string.IsNullOrEmpty(node.LastProcessedAnimationEvent))
                {
                    node.ActionEvent.Current.PostAnimationEvent(node, node.LastProcessedAnimationEvent);
                }
            }
            if (node.Animator.CurrentAnimationRemaining <= 0)
            {
                node.AdvanceEvent();
            }
        }