﻿using System.IO;
using UnityEditor;
using UnityEngine;

public class FixLangVersion : AssetPostprocessor
{
	static void OnGeneratedCSProjectFiles()
	{
		string[] paths = Directory.GetFiles(Directory.GetParent(Application.dataPath).FullName, "*.csproj", SearchOption.TopDirectoryOnly);
		foreach(var path in paths)
		{
			string text = File.ReadAllText(path);
			text = text.Replace("<LangVersion>latest</LangVersion>", "<LangVersion>4</LangVersion>");
			File.WriteAllText(path, text);
		}
	}
}
