I need some help in assigning material by script.
The situation is like this: I have a script attached to the camera which creates a GUI.button. The GUI.button will attach a script to the camera when the user clicks on it. The user will then be able to draw on the screen.
Here comes the problem. I have a variable for the material in the script. However, as I am only activating the script when the game is running, I am unable to assign the material through the inspector.
Is there any way to assign the Material through script?
EDIT: Solved by using Resource.Load method.