if (Application.isPlaying) {
call();
}
else if (call.Target != null) {
System.Type type = call.Target.GetType();
object[] objs
= type
.GetCustomAttributes(typeof(ExecuteInEditMode
),
true); if (objs != null && objs.Length > 0
|| type
.IsSubclassOf(typeof(UnityEditor
.Editor))) call();
}