I have been using the gradient shader script below, but after upgrading to Unity 5 is only seems to display a solid color. Anyone have any suggestions as to what might be wrong, or some other solution for getting a gradient background (without resorting to a texture)?
The script you are using is more than three and a half years old and seems to be written for Unity3.1.
You should consider finding a more up-to-date script. This page from Unity Answers might point you to some better suited alternatives. There’s also a whole topic for gradient on Unity Answers found here.
Please note, that Gradients are now a Unity built-in feature. You might want to read the documentation to find out more.
as for the C# part of the original script, there are a number of warnings and errors caused by deprecated code:
warning CS0618: UnityEngine.Material.Material(string)' is obsolete: Creating materials from shader source string will be removed in the future. Use Shader assets instead.’
error CS0619: UnityEngine.Component.camera' is obsolete: Property camera has been deprecated. Use GetComponent() instead. (UnityUpgradable)’
error CS0619: UnityEngine.GameObject.renderer' is obsolete: Property renderer has been deprecated. Use GetComponent() instead. (UnityUpgradable)’
Running the Unity API Updater fixes most of the problems except the Material one. If you are willing to fix and share the code, I’m sure some people will thank you.