Skip to content

Commit d804918

Browse files
brnkhyabhishektrip
authored andcommitted
Magnifier icon fix (#497)
* change magnifier icon to property and load if it's null on first get * change local field to private
1 parent 249f744 commit d804918

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

sdkproject/Assets/Mapbox/Unity/Editor/NodeEditor/NodeBasedEditor.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,18 @@ public class NodeBasedEditor : EditorWindow
3232
public static GUIStyle selectedNodeStyle;
3333
public static GUIStyle inPointStyle;
3434
public static GUIStyle outPointStyle;
35-
public static Texture2D magnifierTexture;
35+
private static Texture2D _magnifierTexture;
36+
public static Texture2D magnifierTexture
37+
{
38+
get
39+
{
40+
if(_magnifierTexture == null)
41+
{
42+
_magnifierTexture = EditorGUIUtility.FindTexture("d_ViewToolZoom");
43+
}
44+
return _magnifierTexture;
45+
}
46+
}
3647
private GUIStyle _optionLabel;
3748

3849
//private ConnectionPoint selectedInPoint;
@@ -57,7 +68,7 @@ private static void OpenWindow()
5768
private void OnEnable()
5869
{
5970
GUIScaleUtility.CheckInit();
60-
magnifierTexture = EditorGUIUtility.FindTexture("d_ViewToolZoom");
71+
//MagnifierTexture = EditorGUIUtility.FindTexture("d_ViewToolZoom");
6172
var textOffset = new RectOffset(12, 0, 10, 0);
6273

6374
nodeStyle = new GUIStyle();

0 commit comments

Comments
 (0)