private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { if (ProtoPrefs.enabled == false) { return; } ProtoPrefs.UpdateCachedVariables(); new Thread(() => { var compiledFilesList = importedAssets .Where(f => Path.GetExtension(f) == ".proto") .Select(Path.GetFullPath) .CompiledFiles() .ToList(); if (!compiledFilesList.Any()) { return; } var includePaths = AllProtoFiles.IncludePaths().ToList(); var logStandard = ProtoPrefs.logStandard; var logError = ProtoPrefs.logError; CompileAssets(compiledFilesList, includePaths, logStandard, logError); Debug.Log("Compiled changed .proto files"); ProtoPrefs.QueueOnMainThread(AssetDatabase.Refresh); }).Start(); }
public static void OnScriptsReloaded() { if (ProtoPrefs.enabled == false) { return; } ProtoPrefs.UpdateCachedVariables(); CompileUncompiledFilesOnly(); }