Testing branch for 2018.3

pull/413/head
Simon (Darkside) Jackson 2018-12-31 15:54:49 +00:00
parent a645c1e0c2
commit 48d3c40623
3 changed files with 13 additions and 2 deletions

View File

@ -139,10 +139,16 @@ namespace UnityEngine.UI.Extensions
// Update rects since other things might affect them even if value didn't change.
if(!Application.isPlaying) UpdateVisuals();
#if UNITY_2018_3_OR_NEWER
if (!Application.isPlaying)
#else
var prefabType = UnityEditor.PrefabUtility.GetPrefabType(this);
if (prefabType != UnityEditor.PrefabType.Prefab && !Application.isPlaying)
#endif
{
CanvasUpdateRegistry.RegisterCanvasElementForLayoutRebuild(this);
}
}
#endif // if UNITY_EDITOR

View File

@ -118,7 +118,7 @@ namespace UnityEngine.UI.Extensions {
}
protected void UpdateQuadImage() {
#if UNITY_EDITOR
#if UNITY_EDITOR && !UNITY_2018_3_OR_NEWER
if (UnityEditor.PrefabUtility.GetPrefabType(this) == UnityEditor.PrefabType.Prefab) {
return;
}

View File

@ -89,11 +89,16 @@ namespace UnityEngine.UI
base.OnValidate();
Set(m_IsOn, false);
PlayEffect(toggleTransition == ToggleTransition.None);
#if UNITY_2018_3_OR_NEWER
if (!Application.isPlaying)
#else
var prefabType = UnityEditor.PrefabUtility.GetPrefabType(this);
if (prefabType != UnityEditor.PrefabType.Prefab && !Application.isPlaying)
#endif
{
CanvasUpdateRegistry.RegisterCanvasElementForLayoutRebuild(this);
}
}
#endif // if UNITY_EDITOR