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);
            }
        }
Example #2
0
        public static void RecompileAll()
        {
            InkLibrary.Refresh();
            List <InkFile> masterInkFiles = InkLibrary.GetMasterInkFiles();

            foreach (InkFile masterInkFile in masterInkFiles)
            {
                CompileInk(masterInkFile);
            }
        }
        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);
            }
        }