You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
586 B
C#
25 lines
586 B
C#
1 year ago
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|