public static void Init() { { var t = new Texture2D(3, 3, TextureFormat.RGBA32, false); var arr = new Color32[t.width * t.height]; for (int i = 0; i < t.width * t.height; ++i) { arr[i] = new Color(0.3f, 0.5f, 1f, 0.5f); } t.SetPixels32(arr); t.Apply(); Styles.connectionTexture = t; } { Styles.background = new GUIStyle(); var t = new Texture2D(1, 1, TextureFormat.RGBA32, false); var arr = new Color32[t.width * t.height]; for (int i = 0; i < t.width * t.height; ++i) { arr[i] = new Color(0.17f, 0.17f, 0.17f, 1f); } t.SetPixels32(arr); t.Apply(); Styles.background.normal.background = t; } Styles.nodeStyle = new GUIStyle(); Styles.nodeStyle.normal.background = EditorStyles.miniButton.normal.scaledBackgrounds[0];//EditorGUIUtility.Load("builtin skins/darkskin/images/node1.png") as Texture2D; Styles.nodeStyle.border = new RectOffset(12, 12, 12, 12); Styles.nodeCustomStyle = new GUIStyle(); Styles.nodeCustomStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/node0.png") as Texture2D; Styles.nodeCustomStyle.border = new RectOffset(12, 12, 12, 12); Styles.systemNode = new GUIStyle(); Styles.systemNode.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/node2.png") as Texture2D; Styles.systemNode.border = new RectOffset(12, 12, 12, 12); Styles.measureLabelNormal = Color.green; Styles.measureLabelWarning = Color.yellow; Styles.measureLabelError = Color.red; Styles.containerCaption = new GUIStyle(EditorStyles.centeredGreyMiniLabel); Styles.containerCaption.alignment = TextAnchor.UpperCenter; Styles.nodeCaption = new GUIStyle(EditorStyles.label); Styles.nodeCaption.alignment = TextAnchor.LowerCenter; Styles.nodeCaption.padding = new RectOffset(0, 0, 0, 15); Styles.containerStyle = new GUIStyle(EditorStyles.helpBox); Styles.enterStyle = new GUIStyle(); Styles.enterStyle.normal.background = EditorStyles.miniButton.onNormal.scaledBackgrounds[0];//EditorGUIUtility.Load("builtin skins/darkskin/images/node5.png") as Texture2D; Styles.enterStyle.border = new RectOffset(12, 12, 12, 0); Styles.exitStyle = new GUIStyle(); Styles.exitStyle.normal.background = EditorStyles.miniButton.onNormal.scaledBackgrounds[0];//EditorGUIUtility.Load("builtin skins/darkskin/images/node5.png") as Texture2D; Styles.exitStyle.border = new RectOffset(12, 12, 0, 12); Styles.beginTickStyle = new GUIStyle(); Styles.beginTickStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/node3.png") as Texture2D; Styles.beginTickStyle.border = new RectOffset(12, 12, 12, 12); Styles.endTickStyle = new GUIStyle(); Styles.endTickStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/node4.png") as Texture2D; Styles.endTickStyle.border = new RectOffset(12, 12, 12, 12); if (Styles.fixedFontLabel == null) { Styles.fixedFontLabel = new GUIStyle(EditorStyles.miniLabel); string fontName; if (Application.platform == RuntimePlatform.WindowsEditor) { fontName = "Consolas"; } else { fontName = "Courier"; } Styles.CleanupFont(); Styles.fixedFont = Font.CreateDynamicFontFromOSFont(fontName, Styles.fixedFontLabel.fontSize); Styles.fixedFontLabel.richText = true; Styles.fixedFontLabel.font = Styles.fixedFont; Styles.fixedFontLabel.fontSize = Styles.fixedFontLabel.fontSize; Styles.measureLabel = new GUIStyle(Styles.fixedFontLabel); Styles.measureLabel.richText = true; Styles.measureLabel.padding = new RectOffset(0, 0, 15, 0); Styles.measureLabel.alignment = TextAnchor.UpperCenter; } //Styles.measureLabel = new GUIStyle(EditorStyles.miniBoldLabel); //Styles.measureLabel.richText = true; //Styles.measureLabel.padding = new RectOffset(0, 0, 15, 0); //Styles.measureLabel.alignment = TextAnchor.UpperCenter; }