EditorWindow is an editor and it works only there, after building the project access to the UnityEditor Assembly is not. And it is for service components MonoBehavour, and not Vice versa. If you want to influence him, in component, create some fields, and in the editor window, check them, and change their logic.