Firstborn/Library/PackageCache/com.unity.ugui@1.0.0/Editor/UI/PrefabLayoutRebuilder.cs
Schaken-Mods b486678290 Library -Artifacts
Library -Artifacts
2023-03-28 12:24:16 -05:00

25 lines
586 B
C#

using UnityEngine;
using UnityEngine.UI;
namespace UnityEditor.UI
{
[InitializeOnLoad]
internal class PrefabLayoutRebuilder
{
static PrefabLayoutRebuilder()
{
PrefabUtility.prefabInstanceUpdated += OnPrefabInstanceUpdates;
}
static void OnPrefabInstanceUpdates(GameObject instance)
{
if (instance)
{
RectTransform rect = instance.transform as RectTransform;
if (rect)
LayoutRebuilder.MarkLayoutForRebuild(rect);
}
}
}
}