Unity によって、プロジェクト ファイルの生成中にコールバックが提供されます。 AssetPostprocessor
を使用して OnGeneratedSlnSolution
および OnGeneratedCSProject
メソッドを実装し、プロジェクトまたはソリューション ファイルが再生成されるたびにそれを変更します。
対象
Visual Studio Tools for Unity によって生成された Visual Studio プロジェクト ファイルをカスタマイズする方法について示します。
例
using System;
using UnityEditor;
using UnityEngine;
public class ProjectFilePostprocessor : AssetPostprocessor
{
public static string OnGeneratedSlnSolution(string path, string content)
{
// TODO: process solution content
return content;
}
public static string OnGeneratedCSProject(string path, string content)
{
// TODO: process project content
return content;
}
}