public override void OnStateUpdate(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex) { if (cellDetector == null) { cellDetector = cell.GetComponent <CellDetector>(); detectors = cellDetector.detectors .Where(dtc => dtc.Definition.In(Definition)).ToList(); } animator.SetBool(DetectName, detectors.Any(d => d.foundedOne)); }
public override void OnStateUpdate(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex) { if (cellDetector == null) { cellDetector = cell.GetComponent <CellDetector>(); detectors = cellDetector?.detectors.Where(dtc => dtc.Definition.In(Definition)).ToList(); } if (AiInput == null) { AiInput = cell.GetComponent <InputHandler>(); } AiInput.Target = calcultateTarget(cell.mtransform.position); }