Created
November 23, 2022 09:38
-
-
Save tylearymf/e3b24b4410acc095c57c95f4d52b21b0 to your computer and use it in GitHub Desktop.
SolutionExplorer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using System.Text.RegularExpressions; | |
public class SolutionExplorer : AssetPostprocessor | |
{ | |
public static string OnGeneratedSlnSolution(string path, string content) | |
{ | |
return Regex.Replace(content, @"Project.*?=\s""(?<name>.*?)"".*?EndProject", match => | |
{ | |
var name = match.Groups["name"].Value; | |
if (!name.StartsWith("Assembly")) | |
return string.Empty; | |
else | |
return match.Value; | |
}, RegexOptions.Singleline); | |
} | |
public static string OnGeneratedCSProject(string path, string content) | |
{ | |
// TODO: process project content | |
return content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment