Esempio n. 1
0
    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));
    }
Esempio n. 2
0
    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);
    }