From b9aff70de7f5f3f1a393bf8f154daf53f991edfc Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 11 十月 2018 14:56:49 +0800
Subject: [PATCH] 3335 添加一套在unity中点击配置文件用excel打开查看的功能.

---
 Assets/Editor/Tool/FileOpenEx.cs |   51 ++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 40 insertions(+), 11 deletions(-)

diff --git a/Assets/Editor/Tool/FileOpenEx.cs b/Assets/Editor/Tool/FileOpenEx.cs
index 01b48c1..036977a 100644
--- a/Assets/Editor/Tool/FileOpenEx.cs
+++ b/Assets/Editor/Tool/FileOpenEx.cs
@@ -1,7 +1,7 @@
-锘�
-using UnityEngine;
+锘縰sing UnityEngine;
 using UnityEditor;
 using UnityEditor.Callbacks;
+using System.IO;
 
 public class FileOpenEx
 {
@@ -21,16 +21,45 @@
 
         if (name.EndsWith(".Shader") || name.EndsWith(".cginc") || name.EndsWith(".shader"))
         {
-            System.Diagnostics.Process process = new System.Diagnostics.Process();
-            System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
-            startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
-            startInfo.FileName = "C:/Program Files/Microsoft VS Code/Code.exe";
-            startInfo.Arguments = name;
-            process.StartInfo = startInfo;
-            process.Start();
-            return true;
+            if (string.IsNullOrEmpty(ExtensionalTools.shaderEditorPath))
+            {
+                return false;
+            }
+            else
+            {
+                System.Diagnostics.Process process = new System.Diagnostics.Process();
+                System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
+                startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
+                startInfo.FileName = ExtensionalTools.shaderEditorPath;
+                startInfo.Arguments = name;
+                process.StartInfo = startInfo;
+                process.Start();
+                return true;
+            }
+        }
+
+        if (name.EndsWith(".txt") && name.Contains("ResourcesOut") && name.Contains("Refdata"))
+        {
+            if (string.IsNullOrEmpty(ExtensionalTools.txtEditorPath))
+            {
+                return false;
+            }
+            else
+            {
+                System.Diagnostics.Process process = new System.Diagnostics.Process();
+                System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
+
+                startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
+                startInfo.FileName = ExtensionalTools.txtEditorPath;
+
+                name = ExcelReader.GetExcelPath(Path.GetFileNameWithoutExtension(path));
+                startInfo.Arguments = name;
+                process.StartInfo = startInfo;
+                process.Start();
+                return true;
+            }
         }
 
         return false;
     }
-}
\ No newline at end of file
+}

--
Gitblit v1.8.0