I created a gizmo script that has a public color variable then in the ondrawgizmos I set the color to that variable. The intention is to have a color picker in the inspector to change the gizmo color. For some reason this does not work in my current project, I can set the gizmo color in my script to an exact color using Color.yellow etc and it will work. The weird thing is if I create a new empty project using the exact same script it works just fine, just not in the project I already have in progress. Any ideas on why this may be?
public class CubeGizmo : MonoBehaviour
{
public Vector3 centerOffset = new Vector3(0, 0, 0);
public Vector3 cubeSize = new Vector3(1.0f, 1.0f, 1.0f);
public Color color;
Vector3 origin;
public void OnDrawGizmosSelected()
{
Gizmos.color = color;
origin = transform.position + centerOffset;
Gizmos.DrawCube(origin, cubeSize);
}
}