Right now I have it set up so that the player can input a string and if it matches an default color, an object changes to that string. However, is there a way I could simplify my code and do something like (pseudocode)-
var INPUT : string = "blue";
renderer.material.color = Color.INPUT;
instead of
var INPUT : string = "blue";
if(INPUT=="blue"){
renderer.material.color = Color.blue;
}
else if(INPUT=="red"){
renderer.material.color = Color.red;
}
etc...