Author: Rando Wiltschek (Orion)
This script scales a GUITexture depending on the screen size / resolution. This allows the interface to be designed independently of a fixed resolution.
Place this script on a GameObject with a GUITexture component. The scale and position that you use for "Pixel inset" of the GUITexture will be used as the smallest scale. I usually use 50% of the original size, so it works well in the game view. When the game is run at a higher resolution, the GUITexture will be scaled up to 2x (maxFactor). If you want your GUITexture to be anchored in a corner of the screen, set the object's transform x and y to 0 or 1 (or 0.5 for centered) and then adjust the Pixel inset to move the GUITexture.
If another script needs to know the scaling factor of the GUI, you can just use GuiScaler.GetSize();