当前位置: 首页>>代码示例>>C#>>正文


C# ProjectFile.LoadGUIDFromExistingProject方法代码示例

本文整理汇总了C#中UnrealBuildTool.ProjectFile.LoadGUIDFromExistingProject方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectFile.LoadGUIDFromExistingProject方法的具体用法?C# ProjectFile.LoadGUIDFromExistingProject怎么用?C# ProjectFile.LoadGUIDFromExistingProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnrealBuildTool.ProjectFile的用法示例。


在下文中一共展示了ProjectFile.LoadGUIDFromExistingProject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddExistingProjectFile

        /// <summary>
        /// Adds the given project to the OtherProjects list
        /// </summary>
        /// <param name="InProject">The project to add</param>
        /// <returns>True if successful</returns>
        public void AddExistingProjectFile(ProjectFile InProject, bool bNeedsAllPlatformAndConfigurations = false, bool bForceDevelopmentConfiguration = false, bool bProjectDeploys = false, List<UnrealTargetPlatform> InSupportedPlatforms = null, List<UnrealTargetConfiguration> InSupportedConfigurations = null)
        {
            if( InProject.ProjectTargets.Count != 0 )
            {
                throw new BuildException( "Expecting existing project to not have any ProjectTargets defined yet." );
            }

            var ProjectTarget = new ProjectTarget();
            if( bForceDevelopmentConfiguration )
            {
                ProjectTarget.ForceDevelopmentConfiguration = true;
            }
            ProjectTarget.ProjectDeploys = bProjectDeploys;

            if (bNeedsAllPlatformAndConfigurations)
            {
                // Add all platforms
                var AllPlatforms = Enum.GetValues(typeof(UnrealTargetPlatform));
                foreach (UnrealTargetPlatform CurPlatfrom in AllPlatforms)
                {
                    ProjectTarget.ExtraSupportedPlatforms.Add(CurPlatfrom);
                }

                // Add all configurations
                var AllConfigurations = Enum.GetValues(typeof(UnrealTargetConfiguration));
                foreach (UnrealTargetConfiguration CurConfiguration in AllConfigurations)
                {
                    ProjectTarget.ExtraSupportedConfigurations.Add( CurConfiguration );
                }
            }
            else if (InSupportedPlatforms != null || InSupportedConfigurations != null)
            {
                if (InSupportedPlatforms != null)
                {
                    // Add all explicitly specified platforms
                    foreach (UnrealTargetPlatform CurPlatfrom in InSupportedPlatforms)
                    {
                        ProjectTarget.ExtraSupportedPlatforms.Add(CurPlatfrom);
                    }
                }
                else
                {
                    // Otherwise, add all platforms
                    var AllPlatforms = Enum.GetValues(typeof(UnrealTargetPlatform));
                    foreach (UnrealTargetPlatform CurPlatfrom in AllPlatforms)
                    {
                        ProjectTarget.ExtraSupportedPlatforms.Add(CurPlatfrom);
                    }
                }

                if (InSupportedConfigurations != null)
                {
                    // Add all explicitly specified configurations
                    foreach (UnrealTargetConfiguration CurConfiguration in InSupportedConfigurations)
                    {
                        ProjectTarget.ExtraSupportedConfigurations.Add(CurConfiguration);
                    }
                }
                else
                {
                    // Otherwise, add all configurations
                    var AllConfigurations = Enum.GetValues(typeof(UnrealTargetConfiguration));
                    foreach (UnrealTargetConfiguration CurConfiguration in AllConfigurations)
                    {
                        ProjectTarget.ExtraSupportedConfigurations.Add(CurConfiguration);
                    }
                }
            }
            else
            {
                // For existing project files, just support the default desktop platforms and configurations
                UnrealBuildTool.GetAllDesktopPlatforms(ref ProjectTarget.ExtraSupportedPlatforms, false);
                // Debug and Development only
                ProjectTarget.ExtraSupportedConfigurations.Add(UnrealTargetConfiguration.Debug);
                ProjectTarget.ExtraSupportedConfigurations.Add(UnrealTargetConfiguration.Development);
            }

            InProject.ProjectTargets.Add( ProjectTarget );

            // Existing projects must always have a GUID.  This will throw an exception if one isn't found.
            InProject.LoadGUIDFromExistingProject();

            OtherProjectFiles.Add( InProject );
        }
开发者ID:mymei,项目名称:UE4,代码行数:89,代码来源:ProjectFileGenerator.cs


注:本文中的UnrealBuildTool.ProjectFile.LoadGUIDFromExistingProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。