Skip to content

Instantly share code, notes, and snippets.

@baba-s
Created March 22, 2024 11:13
Show Gist options
  • Save baba-s/98feada6703c0973fea5a158ebd40b37 to your computer and use it in GitHub Desktop.
Save baba-s/98feada6703c0973fea5a158ebd40b37 to your computer and use it in GitHub Desktop.
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
internal static class Example
{
static Example()
{
PrefabUtility.prefabInstanceApplying += go =>
{
Debug.Log( $"prefabInstanceApplying: {go}", go );
};
PrefabUtility.prefabInstanceApplied += go =>
{
Debug.Log( $"prefabInstanceApplied: {go}", go );
};
PrefabUtility.prefabInstanceReverting += go =>
{
Debug.Log( $"prefabInstanceReverting: {go}", go );
};
PrefabUtility.prefabInstanceReverted += go =>
{
Debug.Log( $"prefabInstanceReverted: {go}", go );
};
PrefabUtility.prefabInstanceUnpacking += ( go, mode ) =>
{
Debug.Log( $"prefabInstanceUnpacking: {go}, {mode}", go );
};
PrefabUtility.prefabInstanceUnpacked += ( go, mode ) =>
{
Debug.Log( $"prefabInstanceUnpacked: {go}, {mode}", go );
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment