コード例 #1
0
        public IEnumerator IncludesFilesAddedToAssemblyDefinitions()
        {
            CopyScriptToAssetsFolder(Application.dataPath, "SimpleCSharpScript.cs", k_EmptyCSharpScript);
            string uglyDefineString = "THISDEFINEISEXTREMELYUNLIKELYTOEXISTBYDEFAULT; ALSOTHISONE, FINALLYTHISONE";

            PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, uglyDefineString);

            var dir = Directory.GetParent(Application.dataPath).FullName;

            m_CsProjPath = Path.Combine(dir, "Assembly-CSharp.csproj");

            yield return(new RecompileScripts(true));

            m_ProjectGeneration.Sync();

            XMLUtilities.AssertDefinesContain(m_CsProjPath, "THISDEFINEISEXTREMELYUNLIKELYTOEXISTBYDEFAULT");
            XMLUtilities.AssertDefinesContain(m_CsProjPath, "ALSOTHISONE");
            XMLUtilities.AssertDefinesContain(m_CsProjPath, "FINALLYTHISONE");
        }