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

View File

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

View File

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