// Start is called before the first frame update
 void Start()
 {
     conditionVars   = new ConditionVars();
     animator        = GetComponent <Animator>();
     currentMode     = aiBlueprint.GetCurrentCombatMode(conditionVars);
     combatSequencer = new CombatSequencer(currentMode, sequencesCount);
     currentAction   = combatSequencer.NextAction(currentMode.generateActionMode);
     animator.SetTrigger(currentAction.getTriggerName());
 }
Beispiel #2
0
        public Mode GetCurrentCombatMode(ConditionVars conditionVars)
        {
            List <Mode> modesApplyable = mode.Where(mode =>
            {
                if (mode.optionalCondition != null)
                {
                    return(mode.condition.applyCondition(conditionVars) &&
                           mode.optionalCondition.applyCondition(conditionVars));
                }

                return(mode.condition.applyCondition(conditionVars));
            }).ToList();

            if (modesApplyable.Count > 1)
            {
                modesApplyable.Sort((mode1, mode2) => mode1.prio.CompareTo(mode2.prio));
            }

            return(modesApplyable.First());
        }
Beispiel #3
0
 public virtual bool applyCondition(ConditionVars conditionVars)
 {
     return(false);
 }
Beispiel #4
0
 public override bool applyCondition(ConditionVars conditionVars) =>
 Input.GetKey(keyCode);
Beispiel #5
0
 public override bool applyCondition(ConditionVars conditionVars)
 {
     return(conditionVars.boolsMap[boolName]);
 }