protected void OnEnable()
        {
            var content = (target as MarkdownAsset).text;
            var path    = AssetDatabase.GetAssetPath(target);

            mViewer = new MarkdownViewer(Skin, path, content);
            EditorApplication.update += UpdateRequests;
        }
Esempio n. 2
0
 protected void OnDisable()
 {
     if (mViewer != null)
     {
         EditorApplication.update -= UpdateRequests;
         mViewer = null;
     }
 }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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;
            }
        }
Esempio n. 5
0
        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;
            }
        }