public override void FinishDecision(MAnimalBrain brain, int Index)
 {
     //Reset all variables
     boolListener  = null;
     intListener   = null;
     floatListener = null;
 }
        public override void PrepareDecision(MAnimalBrain brain, int Index)
        {
            //Reset all variables
            boolListener  = null;
            intListener   = null;
            floatListener = null;

            if (checkOn == Affected.Target)
            {
                var objective = brain.Target;

                switch (varType)
                {
                case VarType.Bool:
                    boolListener = objective.GetComponent <BoolVarListener>();
                    break;

                case VarType.Int:
                    intListener = objective.GetComponent <IntVarListener>();
                    break;

                case VarType.Float:
                    floatListener = objective.GetComponent <FloatVarListener>();
                    break;

                default:
                    break;
                }
            }
            else
            {
                var objective = brain.transform;

                switch (varType)
                {
                case VarType.Bool:
                    boolListener = objective.GetComponent <BoolVarListener>();
                    break;

                case VarType.Int:
                    intListener = objective.GetComponent <IntVarListener>();
                    break;

                case VarType.Float:
                    floatListener = objective.GetComponent <FloatVarListener>();
                    break;

                default:
                    break;
                }
            }
        }