概要
using UnityEditor; using UnityEditor.Experimental.SceneManagement; using UnityEngine; [InitializeOnLoad] public static class Example { static Example() { PrefabStage.prefabSaved += OnPrefabSaved; PrefabStage.prefabSaving += OnPrefabSaving; PrefabStage.prefabStageClosing += OnPrefabStageClosing; PrefabStage.prefabStageOpened += OnPrefabStageOpened; } private static void OnPrefabSaved( GameObject gameObject ) { Debug.Log( "OnPrefabSaved" ); } private static void OnPrefabSaving( GameObject gameObject ) { Debug.Log( "OnPrefabSaving" ); } private static void OnPrefabStageClosing( PrefabStage prefabStage ) { Debug.Log( "OnPrefabStageClosing" ); } private static void OnPrefabStageOpened( PrefabStage prefabStage ) { Debug.Log( "OnPrefabStageOpened" ); } }