Skip - "Open Prefab"

A simple script to skip the “Open Prefab” button when clicking on a prefab from the “Project” window. Built to reduce the inconvenience of editing prefabs a bit. Just drop it in your “Project” to use.

using UnityEngine;
using UnityEditor;

/* Skips the "Open Prefab" button in the inspector */
[CustomEditor(typeof(GameObject))]
public class SkipPrefab : Editor
{
     public void OnEnable()
     {
          /* If this target is not a prefab, return */
          if (!PrefabUtility.IsPartOfAnyPrefab((GameObject)target)) {
               return;
          }

          /* If this target is a prefab, load it in the inspector */
          AssetDatabase.OpenAsset(target);
     }
}

PrefabUtility.IsPartOfAnyPrefab(gameobject) becomes temporarily false for the same selection when you use OpenAsset on it.