From 48d3c406232f5c2c0cce2b7babd103e9b97c94c7 Mon Sep 17 00:00:00 2001 From: "Simon (Darkside) Jackson" Date: Mon, 31 Dec 2018 15:54:49 +0000 Subject: [PATCH] Testing branch for 2018.3 --- Scripts/Controls/BoxSlider.cs | 6 ++++++ Scripts/Controls/TextPic.cs | 2 +- Scripts/Utilities/ExtensionsToggle.cs | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Scripts/Controls/BoxSlider.cs b/Scripts/Controls/BoxSlider.cs index 84ac654..57dee94 100644 --- a/Scripts/Controls/BoxSlider.cs +++ b/Scripts/Controls/BoxSlider.cs @@ -139,9 +139,15 @@ 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 diff --git a/Scripts/Controls/TextPic.cs b/Scripts/Controls/TextPic.cs index 6dfe576..3cad891 100644 --- a/Scripts/Controls/TextPic.cs +++ b/Scripts/Controls/TextPic.cs @@ -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; } diff --git a/Scripts/Utilities/ExtensionsToggle.cs b/Scripts/Utilities/ExtensionsToggle.cs index 7c52d50..70653da 100644 --- a/Scripts/Utilities/ExtensionsToggle.cs +++ b/Scripts/Utilities/ExtensionsToggle.cs @@ -89,10 +89,15 @@ 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