Quick answer: Unity Shader.EnableKeyword applied globally also affecting editor preview windows? Global keywords are process-wide - use local or per-material keywords for runtime state.

Game enables 'NIGHT_MODE' keyword. Editor's Scene view also goes dark; material preview thumbnails dark too.

Use LocalKeyword

material.SetKeyword(new LocalKeyword(shader, "NIGHT"), true);

Local keywords don't leak across materials, let alone across editor.

Or reset on edit-mode

OnDisable/Edit mode: clear runtime keywords. Editor returns to baseline.

Audit Shader.EnableKeyword

Search the codebase. Each call is a candidate for migration to local keywords.

“Global keywords are an old API. Local keywords are the right primitive for runtime state.”

Migrate Shader.EnableKeyword calls to LocalKeyword over a sprint. Lower variant count; cleaner state isolation.

Related reading