Skip to content

Commit

Permalink
Visibility toggle fix for 2018.3
Browse files Browse the repository at this point in the history
Implemented fix for 2018.3, provided by James Park.
  • Loading branch information
ChemiKhazi committed Dec 14, 2018
1 parent b07a4bd commit 3bb7e05
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions Editor/QuickToggle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,27 @@ private static void BuildStyles()

// Unselected just makes the normal states have no lock images
tempStyle = GUI.skin.FindStyle("OL Toggle");
styleUnlocked = new GUIStyle(tempStyle);

tempStyle = GUI.skin.FindStyle("VisibilityToggle");

styleVisOff = new GUIStyle(tempStyle);
styleUnlocked = new GUIStyle(tempStyle);
#if UNITY_2018_3_OR_NEWER
tempStyle = new GUIStyle()
{
normal = new GUIStyleState() { background = EditorGUIUtility.Load("Icons/animationvisibilitytoggleoff.png") as Texture2D },
onNormal = new GUIStyleState() { background = EditorGUIUtility.Load("Icons/animationvisibilitytoggleon.png") as Texture2D },
fixedHeight = 11,
fixedWidth = 13,
border = new RectOffset(2, 2, 2, 2),
overflow = new RectOffset(-1, 1, -2, 2),
padding = new RectOffset(3, 3, 3, 3),
richText = false,
stretchHeight = false,
stretchWidth = false,
};
#else
tempStyle = GUI.skin.FindStyle("VisibilityToggle");
#endif


styleVisOff = new GUIStyle(tempStyle);
styleVisOn = new GUIStyle(tempStyle)
{
normal = new GUIStyleState() { background = tempStyle.onNormal.background }
Expand Down

0 comments on commit 3bb7e05

Please sign in to comment.