Сценарий Unity обнаружил, если в режиме Edition Prefab Edition

using UnityEditor;
using UnityEditor.Experimental.SceneManagement;

if (PrefabStageUtility.GetCurrentPrefabStage() == null) {}
// If null it mean you are not in prefab editing mode
Kaldrin