public static void highlight(GameObject obj, Color color)
{
if(obj == null)
{
if(last != null)
last.renderer.material.shader = old_shader;
return;
}
GameObject obj_with_renderer = findRendererRecursive(obj);
if(last != null)
{
last.renderer.material.shader = old_shader;
}
old_shader = obj_with_renderer.renderer.material.shader;
last = obj_with_renderer;
obj_with_renderer.renderer.material.shader = highlightShader();
obj_with_renderer.renderer.material.SetColor("_OutlineColor", color);
}