Exemple #1
0
        internal static ScriptCompilationResult CompilePlayerScriptsInternal(ScriptCompilationSettings input, string outputFolder, bool editorScripts)
        {
            input.m_ResultTypeDB = new TypeDB();
            ScriptCompilationResult result = CompilePlayerScriptsNative(input, outputFolder, editorScripts);

            result.m_TypeDB = result.m_Assemblies.Length != 0 ? input.m_ResultTypeDB : null;
            return(result);
        }
        public static BuildPipelineCodes BuildPlayerScripts(ScriptCompilationSettings settings, out ScriptCompilationResult result, bool useCache = true)
        {
            var buildTimer = new Stopwatch();

            buildTimer.Start();

            BuildPipelineCodes exitCode;

            using (var progressTracker = new BuildProgressTracker(1))
            {
                using (var buildCleanup = new BuildStateCleanup(false, kTempPlayerBuildPath))
                {
                    var scriptDependency = new ScriptDependency(useCache, progressTracker);
                    exitCode = scriptDependency.Convert(settings, kTempPlayerBuildPath, out result);
                    if (exitCode < BuildPipelineCodes.Success)
                    {
                        return(exitCode);
                    }
                }
            }

            buildTimer.Stop();
            if (exitCode >= BuildPipelineCodes.Success)
            {
                BuildLogger.Log("Build Player Scripts successful in: {0:c}", buildTimer.Elapsed);
            }
            else if (exitCode == BuildPipelineCodes.Canceled)
            {
                BuildLogger.LogWarning("Build Player Scripts canceled in: {0:c}", buildTimer.Elapsed);
            }
            else
            {
                BuildLogger.LogError("Build Player Scripts failed in: {0:c}", buildTimer.Elapsed);
            }

            return(exitCode);
        }