Resize all UI texts fontsize in a scene with one command?

I have several hundreds of UI texts in my 2D game. Having used the new UI system all trough the game looks the same on all devises apart from two things that I would like to fix in a time effective way. The first is the font sizes. Of course I could drag all of them to my game object in inspector and attach a script telling every text to resize accordingly to resolution ov the device. …or is it a way to call ALL text.fontsize in a scene at awake() without having to drag in inspector?

I have the sam problem with the built in UI shadow scripts that I have attached to everything (including all text). I want to be able to resize them in a elegant way aswell.

If you’d really really want to you could find all UnityEngine.UI.Text components with FindObjectsOfType<>(), but this will totally kill your performance at runtime if you have a lot of text objects.

API reference FindObjectsOfType

The better solution would be to make use of the dynamic scaling abilities of the new UI. There’s the Canvas Scaler, Content Size Fitter and Layout Group with Layout Element. Text can also have Best Fit with min and max size. This in conjunction with correct anchoring should give you a scalable UI. See: Unity Manual HowTo Design for Multiple Resolutions