void Awake()
 {
     _collider = GetComponent <Collider>();
     detection = GetComponent <ConeDetection>();
     sensor    = GetComponent <GuardAlertSensor>();
     behavior  = GetComponent <BehaviorTree>();
     agent     = GetComponent <NavMeshAgent>();
 }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        DetectionCone = GetComponentInChildren <ConeDetection>();


        player   = GameObject.Find("tempPlayer");
        normal   = true;
        alerted  = false;
        detected = false;


        currentPatrolNode = 0;
    }
Пример #3
0
    void Awake()
    {
        behavior  = GetComponent <BehaviorTree>();
        agent     = GetComponent <NavMeshAgent>();
        detection = GetComponent <ConeDetection>();
        attack    = GetComponent <EnemyAttack>();

        player     = GameObject.FindGameObjectWithTag("Player");
        visibility = player.GetComponent <PlayerVisibility>();

        GlobalVariables.Instance.SetVariableValue("Player", player);

        brokenEffect.SetActive(false);
    }