Beispiel #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();
     }
 }
 public override void Evaluate(ActionUsingNode node)
 {
     if (!_currentSpawn.Tags.Contain(EntityTags.Moving))
     {
         node.AdvanceEvent();
         _currentSpawn.Destroy(); // this doesn't respect pooling
         _currentSpawn = null;
     }
 }
Beispiel #3
0
        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();
            }
        }
Beispiel #4
0
        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();
            }
        }