コード例 #1
0
    static FixedPathNode GetNeedToFixedPath_UnableParse(string source)
    {
        FixedPathNode reslut = null;

        if (source.StartsWith(FixedKey_UnablePars))
        {
            reslut            = new FixedPathNode();
            reslut.sourcePath = source;
            reslut.fixedType  = "UnableParse";
            reslut.FixedPath  = source.Replace(FixedKey_UnablePars, string.Empty);
            string[] temp = reslut.FixedPath.Split(':');
            if (temp.Length != 2)
            {
                Debug.Log("GetNeedToFixedPath_UnableParse 失败,temp.Length != 2 :" + source);
                reslut = null;
            }
            else
            {
                reslut.FixedPath = temp[0].Trim();
                if (!File.Exists(reslut.FixedPath))
                {
                    Debug.Log("GetNeedToFixedPath_UnableParse 失败,文件不存在:" + reslut);
                    reslut = null;
                }
            }
        }

        return(reslut);
    }
コード例 #2
0
    static FixedPathNode GetNeedToFixedPath_UnableNotKnow(string source)
    {
        FixedPathNode reslut = null;

        if (source.StartsWith(FixedKey_NotKnow_First) && source.Contains(FixedKey_NotKnow_Second))
        {
            reslut            = new FixedPathNode();
            reslut.sourcePath = source;
            reslut.fixedType  = "UnableNotKnown";
            reslut.FixedPath  = source.Replace(FixedKey_NotKnow_First, string.Empty);
            string[] temp = reslut.FixedPath.Split('\'');
            if (temp.Length != 2)
            {
                Debug.Log("GetNeedToFixedPath_UnableNotKnow 失败,temp.Length != 2:" + source);
                reslut = null;
            }
            else
            {
                reslut.FixedPath = temp[0].Trim();
                if (!File.Exists(reslut.FixedPath))
                {
                    Debug.Log("GetNeedToFixedPath_UnableNotKnow 失败,文件不存在:" + reslut);
                    reslut = null;
                }
            }
        }

        return(reslut);
    }
コード例 #3
0
    private static FixedPathNode GetNeedToFixedPath(string source)
    {
        FixedPathNode reslut = null;

        reslut = GetNeedToFixedPath_UnableParse(source);
        if (null == reslut)
        {
            reslut = GetNeedToFixedPath_UnableNotKnow(source);
        }
        return(reslut);
    }
コード例 #4
0
    private static void GenerateErrorFile(string overrideCopyEditorLogPath)
    {
        string LogPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Unity\\Editor\\Editor.log";

        if (EditorRunTypeWindow.IsRunFromCommandLine)
        {
            string[] allCommandLine = Environment.GetCommandLineArgs();
            for (int i = 0; i < allCommandLine.Length; i++)
            {
                if (allCommandLine[i].Contains("-logFile"))
                {
                    LogPath = allCommandLine[i + 1];
                    EditorLog.LogInfo("findCommandLineLogPath:" + LogPath, true);
                    break;
                }
            }
        }
        string reladyCopyPath = CopyLogPath;

        if (!string.IsNullOrEmpty(overrideCopyEditorLogPath))
        {
            reladyCopyPath = overrideCopyEditorLogPath;
        }
        File.Copy(LogPath, reladyCopyPath, true);

        string reader = File.ReadAllText(reladyCopyPath);

        reader = reader.Replace("\r", string.Empty);
        string[] lines = reader.Split('\n');
        foreach (string line in lines)
        {
            FixedPathNode reslut = GetNeedToFixedPath(line);
            if (null != reslut)
            {
                if (reslut.FixedPath.Contains(".dll"))
                {
                    needtoFixDll = true;
                }
                else
                {
                    needToFixedFilePath.Add(reslut);
                }
            }
        }
    }