// Use this for initialization void Start() { var textPromtGo = GameObject.Find("Witch Prompt Text"); if (textPromtGo == null) { gameObject.SetActive(false); return; } _witchPromptText = textPromtGo.GetComponent <Text>(); _witchPromptText.text = " "; _keepStillScript = GameObject.Find("MechanicsScripts").GetComponent <WitchKeepStill>(); }
private void Awake() { // get the components on the object we need ( should not be null due to require component so no need to check ) agent = GetComponentInChildren <NavMeshAgent>(); character = GetComponent <ThirdPersonCharacter>(); player = FindObjectOfType <ThirdPersonUserControl>(); _aiSight = GetComponentInChildren <AISight>(); _noiseScript = GameObject.FindGameObjectWithTag("NoiseBar").GetComponent <Noise>(); var mechanicsObj = GameObject.FindWithTag("MechanicsObject"); micInput = mechanicsObj.GetComponent <MicrophoneInput>(); _hideFromWitchCooldownTarget = mechanicsObj.GetComponent <WitchKeepStill>().keepStillDuration; _witchScript = mechanicsObj.GetComponent <WitchKeepStill>(); _aiSight.aiController = this; }