unity deactive all object in list

Code Example - unity deactive all object in list

                
                        public List<GameObject> childrens = new List<GameObject>();

    void Update()
    {
        if(/* Something */)
        {
            foreach (var obj in childrens)
                obj.SetActive(false);
        }
    }