I came up with a solution myself: When the player turns on raytracing in the options menu it will change my mirror materials to the ones with RT and prompt the command “r.ReflectionMethod 3”. if it turned off again it willd change the materials to the ones without RT and prompt the command “r.ReflectionMethod 1”.
Hope this helps!