/*
  * Set up script dependencies
  */
 void Awake()
 {
     _pathFinder   = gameObject.GetComponentInParent <Pathfinding>();
     _patrolBehav  = gameObject.GetComponentInParent <Patrol>();
     _player       = GameObject.FindGameObjectWithTag(PlayerTag);
     _soundHandler = GetComponentInParent <GuardSoundHandler>();
     _detection    = GetComponent <DetectionCommon>();
 }
 protected void AssignComponents()
 {
     _pathFinding    = GetComponentInParent <Pathfinding>();
     _patrolBehav    = GetComponentInParent <Patrol>();
     _soundHandler   = GetComponentInParent <GuardSoundHandler>();
     _spriteHandler  = GetComponentInParent <Spritehandler>();
     _playerDetector = GetComponent <PlayerDetection>();
     _visionCone     = GetComponent <LineRenderer>();
     _detection      = GetComponent <DetectionCommon>();
 }
예제 #3
0
 void Start()
 {
     _descriptionBox = GameObject.FindGameObjectWithTag("DescriptionBox").GetComponent <Text>();
     _behaviour      = transform.GetChild(0).GetComponent <IBehaviour>();
     _soundHandler   = GetComponent <GuardSoundHandler>();
 }