Beispiel #1
0
        public static List <InkFile> GetUniqueMasterInkFilesToCompile(List <string> importedInkAssets)
        {
            List <InkFile> masterInkFiles = new List <InkFile>();

            foreach (var importedAssetPath in importedInkAssets)
            {
                InkFile inkFile = InkLibrary.GetInkFileWithPath(importedAssetPath);
                // Trying to catch a rare (and not especially important) bug that seems to happen occasionally when opening a project
                // It's probably this - I've noticed it before in another context.
                Debug.Assert(InkSettings.Instance != null,
                             "No ink settings file. This is a bug. For now you should be able to fix this via Assets > Rebuild Ink Library");
                // I've caught it here before
                Debug.Assert(inkFile != null,
                             "No internal InkFile reference at path " + importedAssetPath +
                             ". This is a bug. For now you can fix this via Assets > Rebuild Ink Library");
                Debug.Assert(inkFile.metaInfo != null);
                Debug.Assert(inkFile.metaInfo.masterInkFileIncludingSelf != null);
                if (!masterInkFiles.Contains(inkFile.metaInfo.masterInkFileIncludingSelf) &&
                    (InkSettings.Instance.compileAutomatically || inkFile.metaInfo.masterInkFileIncludingSelf.compileAutomatically))
                {
                    masterInkFiles.Add(inkFile.metaInfo.masterInkFileIncludingSelf);
                }
            }

            return(masterInkFiles);
        }
        // Find all the master ink files in a list of assets given by path.
        public static List <InkFile> GetUniqueMasterInkFilesToCompile(List <string> importedInkAssets)
        {
            List <InkFile> masterInkFiles = new List <InkFile>();

            foreach (var importedAssetPath in importedInkAssets)
            {
                foreach (var masterInkFile in GetMasterFilesIncludingInkAssetPath(importedAssetPath))
                {
                    if (!masterInkFiles.Contains(masterInkFile) && InkSettings.instance.ShouldCompileInkFileAutomatically(masterInkFile))
                    {
                        masterInkFiles.Add(masterInkFile);
                    }
                }
            }
            return(masterInkFiles);

            // An ink file might actually have several owners! Return them all.
            IEnumerable <InkFile> GetMasterFilesIncludingInkAssetPath(string importedAssetPath)
            {
                InkFile inkFile = InkLibrary.GetInkFileWithPath(importedAssetPath);

                // Trying to catch a rare (and not especially important) bug that seems to happen occasionally when opening a project
                // It's probably this - I've noticed it before in another context.
                Debug.Assert(InkSettings.instance != null, "No ink settings file. This is a bug. For now you should be able to fix this via Assets > Rebuild Ink Library");
                // I've caught it here before
                Debug.Assert(inkFile != null, "No internal InkFile reference at path " + importedAssetPath + ". This is a bug. For now you can fix this via Assets > Rebuild Ink Library");
                Debug.Assert(inkFile != null);
                return(inkFile.masterInkFilesIncludingSelf);
            }
        }
Beispiel #3
0
 // This is called from InkPostProcessor after ink file(s) has been added/changed.
 public static void CreateOrReadUpdatedInkFiles(List <string> importedInkAssets)
 {
     for (int i = 0; i < importedInkAssets.Count; i++)
     {
         string  importedAssetPath = importedInkAssets[i];
         InkFile inkFile           = InkLibrary.GetInkFileWithPath(importedAssetPath);
         if (inkFile == null)
         {
             DefaultAsset asset = AssetDatabase.LoadAssetAtPath <DefaultAsset>(importedAssetPath);
             if (asset == null)
             {
                 // This file wasn't found! This is a rare bug. We remove the file from the list in this case, preventing it from causing further bugs.
                 importedInkAssets.RemoveAt(i);
                 i--;
                 Debug.LogWarning("InkLibrary failed to load ink file at " + importedAssetPath + ". It has been removed from the list of files. You can ignore this warning.");
             }
             else
             {
                 // New file; create and add InkFile to represent it. Content is read in InkFile constructor.
                 inkFile = new InkFile(asset);
                 inkFile.FindCompiledJSONAsset();
                 Add(inkFile);
             }
         }
         else
         {
             // Read content
             inkFile.ParseContent();
         }
     }
     // Now we've updated all the include paths for the ink library we can create master/child references between them.
     RebuildInkFileConnections();
 }
        public override void OnEnable()
        {
            InkCompiler.OnCompileInk += OnCompileInk;
            InkLibrary.Refresh();
            string assetPath = AssetDatabase.GetAssetPath(target);

            inkFile = InkLibrary.GetInkFileWithPath(assetPath);
            if (inkFile == null)
            {
                return;
            }
            InkFile masterInkFile = inkFile;

            if (inkFile.master == null)
            {
                if (inkFile.includes != null)
                {
                    CreateIncludeList();
                }
            }
            else
            {
                masterInkFile = inkFile.master;
            }
//			CreateTODOList();

            if (inkFile.jsonAsset != null)
            {
                // This can be slow. Disable if you find viewing an ink file in the inspector takes too long.
                InkEditorUtils.CheckStoryIsValid(masterInkFile.jsonAsset.text, out exception);
            }
        }
        void Rebuild()
        {
            cachedTrimmedFileContents = "";
            string assetPath = AssetDatabase.GetAssetPath(target);

            inkFile = InkLibrary.GetInkFileWithPath(assetPath);
            if (inkFile == null)
            {
                return;
            }

            if (inkFile.jsonAsset != null && inkFile.metaInfo.includes.Count > 0)
            {
                CreateIncludeList();
            }
            else
            {
                includesFileList = null;
            }

            CreateErrorList();
            CreateWarningList();
            CreateTodoList();
            cachedTrimmedFileContents = inkFile.metaInfo.GetFileContents();
            cachedTrimmedFileContents = cachedTrimmedFileContents.Substring(0, Mathf.Min(cachedTrimmedFileContents.Length, maxCharacters));
            if (cachedTrimmedFileContents.Length >= maxCharacters)
            {
                cachedTrimmedFileContents += "...\n\n<...etc...>";
            }
        }
        static void OnDrawProjectWindowItem(string guid, Rect rect)
        {
            if (!InkLibrary.created)
            {
                return;
            }
            var path = AssetDatabase.GUIDToAssetPath(guid);

            if (Path.GetExtension(path) == InkEditorUtils.inkFileExtension)
            {
                InkFile inkFile = InkLibrary.GetInkFileWithPath(path);

                var isSmall = rect.width > rect.height;
                if (isSmall)
                {
                    rect.width = rect.height;
                }
                else
                {
                    rect.height = rect.width;
                }
                if (rect.width >= largeIconSize)
                {
                    DrawLarge(inkFile, rect);
                }
                else
                {
                    DrawSmall(inkFile, rect);
                }
            }
        }
 private static List<InkFile> GetUniqueMasterInkFilesToCompile(List<string> importedInkAssets)
 {
     List<InkFile> masterInkFiles = new List<InkFile>();
     foreach (var importedAssetPath in importedInkAssets) {
         InkFile inkFile = InkLibrary.GetInkFileWithPath(importedAssetPath);
         if(!masterInkFiles.Contains(inkFile.metaInfo.masterInkFileIncludingSelf) && (InkSettings.Instance.compileAutomatically || inkFile.metaInfo.masterInkFileIncludingSelf.compileAutomatically)) {
             masterInkFiles.Add(inkFile.metaInfo.masterInkFileIncludingSelf);
         }
     }
     return masterInkFiles;
 }
Beispiel #8
0
        // An ink file might actually have several owners! This should be reflected here.
        public static IEnumerable <InkFile> GetMasterFilesIncludingInkAssetPath(string importedAssetPath)
        {
            InkFile inkFile = InkLibrary.GetInkFileWithPath(importedAssetPath);

            // Trying to catch a rare (and not especially important) bug that seems to happen occasionally when opening a project
            // It's probably this - I've noticed it before in another context.
            Debug.Assert(InkSettings.Instance != null, "No ink settings file. This is a bug. For now you should be able to fix this via Assets > Rebuild Ink Library");
            // I've caught it here before
            Debug.Assert(inkFile != null, "No internal InkFile reference at path " + importedAssetPath + ". This is a bug. For now you can fix this via Assets > Rebuild Ink Library");
            Debug.Assert(inkFile.metaInfo != null);
            return(inkFile.metaInfo.masterInkFilesIncludingSelf);
        }
 private static void CreateOrReadUpdatedInkFiles(List<string> importedInkAssets)
 {
     foreach (var importedAssetPath in importedInkAssets) {
         InkFile inkFile = InkLibrary.GetInkFileWithPath(importedAssetPath);
         if(inkFile == null) {
             DefaultAsset asset = AssetDatabase.LoadAssetAtPath<DefaultAsset>(importedAssetPath);
             inkFile = new InkFile(asset);
             InkLibrary.Instance.inkLibrary.Add(inkFile);
             InkMetaLibrary.Instance.metaLibrary.Add(new InkMetaFile(inkFile));
         } else {
             inkFile.metaInfo.ParseContent();
         }
     }
     // Now we've updated all the include paths for the ink library we can create master/child references between them.
     InkMetaLibrary.RebuildInkFileConnections();
 }
Beispiel #10
0
        void Rebuild()
        {
            string assetPath = AssetDatabase.GetAssetPath(target);

            inkFile = InkLibrary.GetInkFileWithPath(assetPath);
            if (inkFile == null)
            {
                return;
            }

            if (inkFile.includes.Count > 0)
            {
                CreateIncludeList();
            }
            CreateErrorList();
            CreateWarningList();
            CreateTodoList();
        }
        private static List <InkFile> GetUniqueMasterInkFilesToCompile(List <string> importedInkAssets)
        {
            List <InkFile> masterInkFiles = new List <InkFile>();

            foreach (var importedAssetPath in importedInkAssets)
            {
                InkFile inkFile = InkLibrary.GetInkFileWithPath(importedAssetPath);
                if (inkFile.isMaster && !masterInkFiles.Contains(inkFile) && (InkLibrary.Instance.compileAutomatically || inkFile.compileAutomatically))
                {
                    masterInkFiles.Add(inkFile);
                }
                else if (!inkFile.isMaster && !masterInkFiles.Contains(inkFile.masterInkFile) && (InkLibrary.Instance.compileAutomatically || inkFile.masterInkFile.compileAutomatically))
                {
                    masterInkFiles.Add(inkFile.masterInkFile);
                }
            }
            return(masterInkFiles);
        }
 private static void OnMoveAssets(string[] movedAssets)
 {
     if (!InkLibrary.Instance.handleJSONFilesAutomatically)
     {
         return;
     }
     for (var i = 0; i < movedAssets.Length; i++)
     {
         if (Path.GetExtension(movedAssets[i]) != InkEditorUtils.inkFileExtension)
         {
             continue;
         }
         InkFile inkFile = InkLibrary.GetInkFileWithPath(movedAssets[i]);
         if (inkFile != null)
         {
             string jsonAssetPath = AssetDatabase.GetAssetPath(inkFile.jsonAsset);
             string newPath       = Path.Combine(Path.GetDirectoryName(movedAssets[i]), Path.GetFileNameWithoutExtension(Path.GetFileName(movedAssets[i]))) + ".json";
             AssetDatabase.MoveAsset(jsonAssetPath, newPath);
         }
     }
 }
        static void PostprocessInkFiles(List <string> importedInkAssets)
        {
            InkLibrary.Refresh();
            List <string> inkAssetsToCompile = new List <string>();

            foreach (var importedAssetPath in importedInkAssets)
            {
                InkFile file = InkLibrary.GetInkFileWithPath(importedAssetPath);
                if (file.master != null && !inkAssetsToCompile.Contains(file.master.absoluteFilePath))
                {
                    inkAssetsToCompile.Add(file.master.absoluteFilePath);
                }
                else if (!inkAssetsToCompile.Contains(file.absoluteFilePath))
                {
                    inkAssetsToCompile.Add(file.absoluteFilePath);
                }
            }

            foreach (var inkAssetToCompile in inkAssetsToCompile)
            {
                InkCompiler.CompileInk(inkAssetToCompile);
            }
        }
Beispiel #14
0
        private static void SetOutputLog(CompilationStackItem pendingFile)
        {
            pendingFile.inkFile.metaInfo.errors.Clear();
            pendingFile.inkFile.metaInfo.warnings.Clear();
            pendingFile.inkFile.metaInfo.todos.Clear();

            foreach (var childInkFile in pendingFile.inkFile.metaInfo.inkFilesInIncludeHierarchy)
            {
                childInkFile.metaInfo.compileErrors.Clear();
                childInkFile.metaInfo.errors.Clear();
                childInkFile.metaInfo.warnings.Clear();
                childInkFile.metaInfo.todos.Clear();
            }

            foreach (string output in pendingFile.output)
            {
                var match = _errorRegex.Match(output);
                if (match.Success)
                {
                    string errorType = null;
                    string filename  = null;
                    int    lineNo    = -1;
                    string message   = null;

                    var errorTypeCapture = match.Groups["errorType"];
                    if (errorTypeCapture != null)
                    {
                        errorType = errorTypeCapture.Value;
                    }

                    var filenameCapture = match.Groups["filename"];
                    if (filenameCapture != null)
                    {
                        filename = filenameCapture.Value;
                    }

                    var lineNoCapture = match.Groups["lineNo"];
                    if (lineNoCapture != null)
                    {
                        lineNo = int.Parse(lineNoCapture.Value);
                    }

                    var messageCapture = match.Groups["message"];
                    if (messageCapture != null)
                    {
                        message = messageCapture.Value.Trim();
                    }


                    string  logFilePath = InkEditorUtils.CombinePaths(Path.GetDirectoryName(pendingFile.inkFile.filePath), filename);
                    InkFile inkFile     = InkLibrary.GetInkFileWithPath(logFilePath);
                    if (inkFile == null)
                    {
                        inkFile = pendingFile.inkFile;
                    }

                    string pathAndLineNumberString = "\n" + inkFile.filePath + ":" + lineNo;
                    if (errorType == "ERROR")
                    {
                        inkFile.metaInfo.errors.Add(new InkMetaFile.InkFileLog(message, lineNo));
                        Debug.LogError("INK " + errorType + ": " + message + pathAndLineNumberString);
                    }
                    else if (errorType == "WARNING")
                    {
                        inkFile.metaInfo.warnings.Add(new InkMetaFile.InkFileLog(message, lineNo));
                        Debug.LogWarning("INK " + errorType + ": " + message + pathAndLineNumberString);
                    }
                    else if (errorType == "TODO")
                    {
                        inkFile.metaInfo.todos.Add(new InkMetaFile.InkFileLog(message, lineNo));
                        Debug.Log("INK " + errorType + ": " + message + pathAndLineNumberString);
                    }
                }
            }
        }
Beispiel #15
0
        static void OnDrawProjectWindowItem(string guid, Rect rect)
        {
            if (!InkLibrary.created)
            {
                return;
            }
            var path = AssetDatabase.GUIDToAssetPath(guid);

            if (Path.GetExtension(path) == InkEditorUtils.inkFileExtension)
            {
                InkFile inkFile = InkLibrary.GetInkFileWithPath(path);

                var isSmall = rect.width > rect.height;
                if (isSmall)
                {
                    rect.width = rect.height;
                }
                else
                {
                    rect.height = rect.width;
                }

                if (rect.width > largeIconSize)
                {
                    var offset   = (rect.width - largeIconSize) * 0.5f;
                    var position = new Rect(rect.x + offset, rect.y + offset, largeIconSize, largeIconSize);
                    if (inkFileIcon != null)
                    {
                        GUI.DrawTexture(position, inkFileIcon);
                    }
                }
                else
                {
                    if (inkFileIcon != null)
                    {
                        GUI.DrawTexture(rect, inkFileIcon);
                    }

                    if (inkFile == null)
                    {
                        if (unknownFileIcon != null)
                        {
                            GUI.DrawTexture(new Rect(rect.x, rect.y, unknownFileIcon.width, unknownFileIcon.height), unknownFileIcon);
                        }
                    }
                    else
                    {
                        Rect miniRect = new Rect(rect.center, rect.size * 0.5f);
                        if (inkFile.hasErrors && errorIcon != null)
                        {
                            GUI.DrawTexture(miniRect, errorIcon);
                        }
                        else if (inkFile.hasWarnings && warningIcon != null)
                        {
                            GUI.DrawTexture(miniRect, warningIcon);
                        }
                        if (!inkFile.isMaster && childIcon != null)
                        {
                            GUI.DrawTexture(new Rect(rect.x, rect.y, childIcon.width, childIcon.height), childIcon);
                        }
                    }
                }
            }
        }
        private static void OnMoveAssets(string[] movedAssets)
        {
            if (!InkSettings.instance.handleJSONFilesAutomatically)
            {
                return;
            }

            List <string> validMovedAssets = new List <string>();

            for (var i = 0; i < movedAssets.Length; i++)
            {
                if (!InkEditorUtils.IsInkFile(movedAssets[i]))
                {
                    continue;
                }
                validMovedAssets.Add(movedAssets[i]);
                queuedMovedInkFileAssets.Add(movedAssets[i]);
            }
            // Move compiled JSON files.
            // This can cause Unity to postprocess assets again.
            foreach (var inkFilePath in validMovedAssets)
            {
                InkFile inkFile = InkLibrary.GetInkFileWithPath(inkFilePath);
                if (inkFile == null)
                {
                    continue;
                }
                if (inkFile.jsonAsset == null)
                {
                    continue;
                }

                string jsonAssetPath = AssetDatabase.GetAssetPath(inkFile.jsonAsset);

                string movedAssetDir  = Path.GetDirectoryName(inkFilePath);
                string movedAssetFile = Path.GetFileName(inkFilePath);
                string newPath        = InkEditorUtils.CombinePaths(movedAssetDir, Path.GetFileNameWithoutExtension(movedAssetFile)) + ".json";

                // On moving an ink file, we either recompile it, creating a new json file in the correct location, or we move the json file.
                if (InkSettings.instance.ShouldCompileInkFileAutomatically(inkFile))
                {
                    // We have to delay this, or it doesn't properly inform unity (there's no version of "ImportAsset" for delete); I guess it doesn't want OnPostprocessAllAssets to fire recursively.
                    EditorApplication.delayCall += () => {
                        AssetDatabase.DeleteAsset(jsonAssetPath);
                        AssetDatabase.Refresh();
                    };
                }
                else
                {
                    if (string.IsNullOrEmpty(AssetDatabase.ValidateMoveAsset(jsonAssetPath, newPath)))
                    {
                        Debug.Assert(newPath == inkFile.jsonPath);
                        EditorApplication.delayCall += () => {
                            AssetDatabase.MoveAsset(jsonAssetPath, newPath);
                            AssetDatabase.ImportAsset(newPath);
                            AssetDatabase.Refresh();
                            inkFile.FindCompiledJSONAsset();
                        };
                        // Debug.Log(jsonAssetPath+" to "+newPath);
                    }
                    else
                    {
                        // This will fire if the JSON file is also moved with the ink - in this case the json file will be in movedAssets.
                        // Debug.Log($"Failed to move asset from path '{jsonAssetPath}' to '{newPath}'.");
                    }
                }
            }
            // Check if no JSON assets were moved (as a result of none needing to move, or this function being called as a result of JSON files being moved)
            if (queuedMovedInkFileAssets.Count > 0)
            {
                List <InkFile> filesToCompile = new List <InkFile>();

                // Add the old master file to the files to be recompiled
                foreach (var inkFilePath in queuedMovedInkFileAssets)
                {
                    InkFile inkFile = InkLibrary.GetInkFileWithPath(inkFilePath);
                    if (inkFile == null)
                    {
                        continue;
                    }
                    foreach (var masterInkFile in inkFile.masterInkFilesIncludingSelf)
                    {
                        if (InkSettings.instance.ShouldCompileInkFileAutomatically(masterInkFile) && !filesToCompile.Contains(masterInkFile))
                        {
                            filesToCompile.Add(masterInkFile);
                        }
                    }
                }

                InkLibrary.RebuildInkFileConnections();

                // If rebuilding connections caused a file that was previously considered a master file to no longer be, then we remove it.
                for (int i = filesToCompile.Count - 1; i >= 0; i--)
                {
                    if (!filesToCompile[i].compileAsMasterFile)
                    {
                        filesToCompile.RemoveAt(i);
                    }
                }

                // Add the new file to be recompiled
                foreach (var inkFilePath in queuedMovedInkFileAssets)
                {
                    InkFile inkFile = InkLibrary.GetInkFileWithPath(inkFilePath);
                    if (inkFile == null)
                    {
                        continue;
                    }

                    foreach (var masterInkFile in inkFile.masterInkFilesIncludingSelf)
                    {
                        if (InkSettings.instance.ShouldCompileInkFileAutomatically(masterInkFile) && !filesToCompile.Contains(masterInkFile))
                        {
                            filesToCompile.Add(masterInkFile);
                        }
                    }
                }

                queuedMovedInkFileAssets.Clear();


                // Compile any ink files that are deemed master files a rebuild
                InkCompiler.CompileInk(filesToCompile.ToArray(), compileImmediatelyOnImport);
            }
        }
        private static void OnMoveAssets(string[] movedAssets)
        {
            if (!InkSettings.Instance.handleJSONFilesAutomatically)
            {
                return;
            }

            List <string> validMovedAssets = new List <string>();

            for (var i = 0; i < movedAssets.Length; i++)
            {
                if (!InkEditorUtils.IsInkFile(movedAssets[i]))
                {
                    continue;
                }
                validMovedAssets.Add(movedAssets[i]);
                queuedMovedAssets.Add(movedAssets[i]);
            }
            // Move compiled JSON files.
            // This can cause Unity to postprocess assets again.
            bool assetMoved = false;

            foreach (var inkFilePath in validMovedAssets)
            {
                InkFile inkFile = InkLibrary.GetInkFileWithPath(inkFilePath);
                if (inkFile == null)
                {
                    continue;
                }
                if (inkFile.jsonAsset == null)
                {
                    continue;
                }

                string jsonAssetPath = AssetDatabase.GetAssetPath(inkFile.jsonAsset);

                string movedAssetDir  = Path.GetDirectoryName(inkFilePath);
                string movedAssetFile = Path.GetFileName(inkFilePath);
                string newPath        = InkEditorUtils.CombinePaths(movedAssetDir, Path.GetFileNameWithoutExtension(movedAssetFile)) + ".json";
                AssetDatabase.MoveAsset(jsonAssetPath, newPath);
                assetMoved = true;
            }

            // Check if no JSON assets were moved (as a result of none needing to move, or this function being called as a result of JSON files being moved)
            if (!assetMoved && queuedMovedAssets.Count > 0)
            {
                List <InkFile> filesToCompile = new List <InkFile>();

                // Add the old master file to the files to be recompiled
                foreach (var inkFilePath in queuedMovedAssets)
                {
                    InkFile inkFile = InkLibrary.GetInkFileWithPath(inkFilePath);
                    if (inkFile == null)
                    {
                        continue;
                    }
                    foreach (var masterInkFile in inkFile.masterInkFilesIncludingSelf)
                    {
                        if (!filesToCompile.Contains(inkFile))
                        {
                            filesToCompile.Add(inkFile);
                        }
                    }
                }

                InkLibrary.RebuildInkFileConnections();

                // Add the new file to be recompiled
                foreach (var inkFilePath in queuedMovedAssets)
                {
                    InkFile inkFile = InkLibrary.GetInkFileWithPath(inkFilePath);
                    if (inkFile == null)
                    {
                        continue;
                    }

                    foreach (var masterInkFile in inkFile.masterInkFilesIncludingSelf)
                    {
                        if (!filesToCompile.Contains(inkFile))
                        {
                            filesToCompile.Add(inkFile);
                        }
                    }
                }

                queuedMovedAssets.Clear();

                // Compile any ink files that are deemed master files a rebuild
                foreach (var inkFile in filesToCompile)
                {
                    if (inkFile.isMaster)
                    {
                        if (InkSettings.Instance.compileAutomatically || inkFile.compileAutomatically)
                        {
                            InkCompiler.CompileInk(inkFile);
                        }
                    }
                }
            }
        }
Beispiel #18
0
        private static void SetOutputLog(CompilationStackItem pendingFile)
        {
            pendingFile.inkFile.errors.Clear();
            pendingFile.inkFile.warnings.Clear();
            pendingFile.inkFile.todos.Clear();
            foreach (var child in pendingFile.inkFile.includes)
            {
                if (child == null)
                {
                    Debug.LogError("Error compiling ink: Ink file include in " + pendingFile.inkFile.filePath + " is null.");
                    continue;
                }
                InkFile childInkFile = InkLibrary.GetInkFileWithFile((DefaultAsset)child);
                childInkFile.errors.Clear();
                childInkFile.warnings.Clear();
                childInkFile.todos.Clear();
            }

            string[] splitOutput = pendingFile.output.Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string output in splitOutput)
            {
                var match = _errorRegex.Match(output);
                if (match.Success)
                {
                    string errorType = null;
                    string filename  = null;
                    int    lineNo    = -1;
                    string message   = null;

                    var errorTypeCapture = match.Groups["errorType"];
                    if (errorTypeCapture != null)
                    {
                        errorType = errorTypeCapture.Value;
                    }

                    var filenameCapture = match.Groups["filename"];
                    if (filenameCapture != null)
                    {
                        filename = filenameCapture.Value;
                    }

                    var lineNoCapture = match.Groups["lineNo"];
                    if (lineNoCapture != null)
                    {
                        lineNo = int.Parse(lineNoCapture.Value);
                    }

                    var messageCapture = match.Groups["message"];
                    if (messageCapture != null)
                    {
                        message = messageCapture.Value.Trim();
                    }


                    string logFilePath = Path.Combine(Path.GetDirectoryName(pendingFile.inkFile.filePath), filename);
                    logFilePath = logFilePath.Replace('\\', '/');
                    InkFile inkFile = InkLibrary.GetInkFileWithPath(logFilePath);
                    if (inkFile == null)
                    {
                        inkFile = pendingFile.inkFile;
                    }

                    string pathAndLineNumberString = "\n" + inkFile.filePath + "(" + lineNo + ")";
                    if (errorType == "ERROR")
                    {
                        inkFile.errors.Add(new InkFile.InkFileLog(message, lineNo));
                        Debug.LogError("INK " + errorType + ": " + message + pathAndLineNumberString);
                    }
                    else if (errorType == "WARNING")
                    {
                        inkFile.warnings.Add(new InkFile.InkFileLog(message, lineNo));
                        Debug.LogWarning("INK " + errorType + ": " + message + pathAndLineNumberString);
                    }
                    else if (errorType == "TODO")
                    {
                        inkFile.todos.Add(new InkFile.InkFileLog(message, lineNo));
                        Debug.Log("INK " + errorType + ": " + message + pathAndLineNumberString);
                    }
                }
            }
        }