Use UnityEditor namespace properly

Avoid using the UnityEditor namespace if not in the Unity Editor
environment