generate a c# unity script to create 10 cubes spread out by 1 unit on the x axis with the material colour changing between the first and last from green to red Please use JSON format in your answer.
user