Forked from jbevain/ReferenceRemovalProjectHook.cs
Last active
January 29, 2021 12:53
-
-
Save Fogsight/d8dd87315ff12245614334dfdcff5b28 to your computer and use it in GitHub Desktop.
Project Generation Hook to remove references to Boo.Lang (Updated for Unity 2019.4)
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 SyntaxTree.VisualStudio.Unity.Bridge; | |
| using UnityEditor; | |
| [InitializeOnLoad] | |
| public class ReferenceRemovalProjectHook { | |
| static ReferenceRemovalProjectHook() => ProjectFilesGenerator.ProjectFileGeneration += (string name, string content) => GetAmmendedProjectFile(content); | |
| private static string GetAmmendedProjectFile(string content) { | |
| string start = "\r\n <Reference Include=\"Boo.Lang\">"; | |
| string end = "</Reference>"; | |
| int startIndex = content.IndexOf(start); | |
| string temp = content.Substring(startIndex); //Get tail | |
| temp = temp.Substring(0, temp.IndexOf(end) + end.Length); // Get replacement string | |
| return content.Replace(temp, ""); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment