ZMWSLI0-SL2021-GR11/Projekt/MWSProjekt/Library/PackageCache/com.unity.ugui@1.0.0/Editor/UI/PrefabLayoutRebuilder.cs

25 lines
586 B
C#
Raw Permalink Normal View History

2021-07-05 21:20:56 +02:00
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);
}
}
}
}