private void OnTriggerEnter(Collider col) { if (col.gameObject.TryGetComponent(out playerControl player)) { SetLock(true); foreach (var AIComponent in enemyAIManagers) { AIComponent.EnableBehavior(); } } }
// Start is called before the first frame update void Start() { box = GetComponent <Collider>(); // If isLocked has been set to true in the inspector if (isLocked) { SetLock(true); foreach (var AIComponent in enemyAIManagers) { AIComponent.EnableBehavior(); } } }