Merged in experimental/unity2018_3 (pull request #40)
Testing branch for 2018.3Updated source to work with 2018.3 without errors Approved-by: Simon Jackson <darkside@xna-uk.net>pull/413/head
commit
ee23104372
|
@ -139,10 +139,16 @@ 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
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,11 +89,16 @@ 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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue