set public variable for child prefab

I have a prefab which is parent for 4 other prefabs. I would like to set from the parent, a public variable for a child prefab. The way that i would do this is this:

void Start () {
		
	Transform t = transform.FindChild("cube1");
		Object texture1 = Resources.Load("jumpButton");
		
		(t as childPrefab).face1Texture = texture1;
	}

where “cube1” is a child prefab and face1Texture is a public property of my cube1 prefab.

The thing is that i can’t convert with “as childPrefab” so i don’t know how to assign my texture to my child prefab.

How can i do so?

GetComponentInChildren is your solution:

If you need to access the four of them:

GetComponentsInChildren