Skip to content

Instantly share code, notes, and snippets.

@jbevain
Created November 26, 2014 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbevain/fc7da08167648381a1a7 to your computer and use it in GitHub Desktop.
Save jbevain/fc7da08167648381a1a7 to your computer and use it in GitHub Desktop.
Project Generation Hook to insert namespace in the project files
using System;
using UnityEngine;
using UnityEditor;
using SyntaxTree.VisualStudio.Unity.Bridge;
[InitializeOnLoad]
public class NamespaceProjectHook
{
private const string Namespace = "Foo.Bar";
static NamespaceProjectHook()
{
ProjectFilesGenerator.ProjectFileGeneration += (string name, string content) =>
content.Replace("<RootNamespace></RootNamespace>", string.Format("<RootNamespace>{0}</RootNamespace>", Namespace));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment