protected void OnEnable() { var content = (target as MarkdownAsset).text; var path = AssetDatabase.GetAssetPath(target); mViewer = new MarkdownViewer(Skin, path, content); EditorApplication.update += UpdateRequests; }
protected void OnDisable() { if (mViewer != null) { EditorApplication.update -= UpdateRequests; mViewer = null; } }
protected void OnEnable() { var content = (target as MarkdownAsset).text; var path = AssetDatabase.GetAssetPath(target); string dir = @"Assets/ShaderReference/Plugins/UnityMarkdownViewer/Editor/Skin/MarkdownViewerSkin.guiskin"; Skin = AssetDatabase.LoadAssetAtPath <GUISkin>(dir); Debug.Log(Skin); mViewer = new MarkdownViewer(Skin, path, content); EditorApplication.update += UpdateRequests; }
protected void OnEnable() { var content = (target as TextAsset).text; var path = AssetDatabase.GetAssetPath(target); var ext = Path.GetExtension(path).ToLower(); if (mExtensions.Contains(ext)) { mViewer = new MarkdownViewer(Skin, path, content); EditorApplication.update += UpdateRequests; } }
protected void OnEnable() { var content = (target as TextAsset).text; var path = AssetDatabase.GetAssetPath(target); var ext = Path.GetExtension(path).ToLower(); string dir = @"Assets/ShaderReference/Plugins/UnityMarkdownViewer/Editor/Skin/MarkdownViewerSkin.guiskin"; Skin = AssetDatabase.LoadAssetAtPath <GUISkin>(dir); if (Skin == null) { Skin = new GUISkin(); Skin.label.normal.textColor = Color.black; } if (mExtensions.Contains(ext)) { mViewer = new MarkdownViewer(Skin, path, content); EditorApplication.update += UpdateRequests; } }