static CustomScriptAssembly()
        {
            // When removing a platform from Platforms, please add it to DeprecatedPlatforms.
            DiscoveredTargetInfo[] buildTargetList = BuildTargetDiscovery.GetBuildTargetInfoList();

            // Need extra slot for Editor which is not included in the build target list
            Platforms    = new CustomScriptAssemblyPlatform[buildTargetList.Length + 1];
            Platforms[0] = new CustomScriptAssemblyPlatform("Editor", BuildTarget.NoTarget);
            for (int i = 1; i < Platforms.Length; i++)
            {
                Platforms[i] = new CustomScriptAssemblyPlatform(
                    BuildTargetDiscovery.GetScriptAssemblyName(buildTargetList[i - 1]),
                    buildTargetList[i - 1].niceName,
                    buildTargetList[i - 1].buildTargetPlatformVal);
            }

#pragma warning disable 0618
            DeprecatedPlatforms = new CustomScriptAssemblyPlatform[]
            {
                new CustomScriptAssemblyPlatform("PSMobile", BuildTarget.PSM),
                new CustomScriptAssemblyPlatform("Tizen", BuildTarget.Tizen),
                new CustomScriptAssemblyPlatform("WiiU", BuildTarget.WiiU),
                new CustomScriptAssemblyPlatform("Nintendo3DS", BuildTarget.N3DS),
                new CustomScriptAssemblyPlatform("PSVita", BuildTarget.PSP2),
                new CustomScriptAssemblyPlatform("LinuxStandalone32", BuildTarget.StandaloneLinux),
                new CustomScriptAssemblyPlatform("LinuxStandaloneUniversal", BuildTarget.StandaloneLinuxUniversal),
            };
#pragma warning restore 0618
        }
        static CustomScriptAssembly()
        {
            // When removing a platform from Platforms, please add it to DeprecatedPlatforms.
            DiscoveredTargetInfo[] buildTargetList = BuildTargetDiscovery.GetBuildTargetInfoList();
            // Need extra slot for Editor which is not included in the build target list
            Platforms    = new CustomScriptAssemblyPlatform[buildTargetList.Length + 1];
            Platforms[0] = new CustomScriptAssemblyPlatform("Editor", BuildTarget.NoTarget);
            for (int i = 1; i < Platforms.Length; i++)
            {
                Platforms[i] = new CustomScriptAssemblyPlatform(
                    BuildTargetDiscovery.GetScriptAssemblyName(buildTargetList[i - 1]),
                    buildTargetList[i - 1].niceName,
                    buildTargetList[i - 1].buildTargetPlatformVal);
            }

#pragma warning disable 0618
            DeprecatedPlatforms = new CustomScriptAssemblyPlatform[]
            {
                new CustomScriptAssemblyPlatform("PSMobile", BuildTarget.PSM),
                new CustomScriptAssemblyPlatform("Tizen", BuildTarget.Tizen),
                new CustomScriptAssemblyPlatform("WiiU", BuildTarget.WiiU),
                new CustomScriptAssemblyPlatform("Nintendo3DS", BuildTarget.N3DS),
                new CustomScriptAssemblyPlatform("PSVita", BuildTarget.PSP2),
            };
#pragma warning restore 0618

            OptinalUnityAssemblies = new[]
            {
                new CustomScriptOptinalUnityAssembly("Test Assemblies", OptionalUnityReferences.TestAssemblies, "When enabled, this assembly is only used in tests, not in in player builds. Predefined assemblies won’t reference this assembly.", "Predefined Assemblies (Assembly-CSharp.dll etc) will not reference this assembly.\nThis assembly will only be used for tests and will not be included in player builds."),
            };
        }
Ejemplo n.º 3
0
        internal BuildPlatforms()
        {
            List <BuildPlatform> buildPlatformsList = new List <BuildPlatform>();

            DiscoveredTargetInfo[] buildTargets = BuildTargetDiscovery.GetBuildTargetInfoList();

            // Standalone needs to be first
            // Before we had BuildTarget.StandaloneWindows for BuildPlatform.defaultTarget
            // But that doesn't make a lot of sense, as editor use it in places, so it should agree with editor platform
            // TODO: should we poke module manager for target support? i think we can assume support for standalone for editor platform
            // TODO: even then - picking windows standalone unconditionally wasn't much better
            BuildTarget standaloneTarget = BuildTarget.StandaloneWindows;

            if (Application.platform == RuntimePlatform.OSXEditor)
            {
                standaloneTarget = BuildTarget.StandaloneOSX;
            }
            else if (Application.platform == RuntimePlatform.LinuxEditor)
            {
                standaloneTarget = BuildTarget.StandaloneLinux64;
            }

            buildPlatformsList.Add(new BuildPlatformWithSubtarget(BuildPipeline.GetBuildTargetGroupDisplayName(BuildTargetGroup.Standalone), "", "BuildSettings.Standalone",
                                                                  NamedBuildTarget.Standalone, standaloneTarget, (int)StandaloneBuildSubtarget.Player, true));

            buildPlatformsList.Add(new BuildPlatformWithSubtarget("Dedicated Server", "", "BuildSettings.DedicatedServer",
                                                                  NamedBuildTarget.Server, standaloneTarget, (int)StandaloneBuildSubtarget.Server, true));

            foreach (var target in buildTargets)
            {
                if (!target.HasFlag(TargetAttributes.IsStandalonePlatform))
                {
                    NamedBuildTarget namedBuildTarget = NamedBuildTarget.FromBuildTargetGroup(BuildPipeline.GetBuildTargetGroup(target.buildTargetPlatformVal));
                    buildPlatformsList.Add(new BuildPlatform(
                                               BuildPipeline.GetBuildTargetGroupDisplayName(namedBuildTarget.ToBuildTargetGroup()),
                                               target.iconName,
                                               namedBuildTarget,
                                               target.buildTargetPlatformVal,
                                               target.HasFlag(TargetAttributes.HideInUI)));
                }
            }

            foreach (var buildPlatform in buildPlatformsList)
            {
                buildPlatform.tooltip = buildPlatform.title.text + " settings";
            }

            buildPlatforms = buildPlatformsList.ToArray();
        }
Ejemplo n.º 4
0
        internal BuildPlatforms()
        {
            List <BuildPlatform> buildPlatformsList = new List <BuildPlatform>();

            DiscoveredTargetInfo[] buildTargets = BuildTargetDiscovery.GetBuildTargetInfoList();

            // Standalone needs to be first
            // Before we had BuildTarget.StandaloneWindows for BuildPlatform.defaultTarget
            // But that doesn't make a lot of sense, as editor use it in places, so it should agree with editor platform
            // TODO: should we poke module manager for target support? i think we can assume support for standalone for editor platform
            // TODO: even then - picking windows standalone unconditionally wasn't much better
            BuildTarget standaloneTarget = BuildTarget.StandaloneWindows;

            if (Application.platform == RuntimePlatform.OSXEditor)
            {
                standaloneTarget = BuildTarget.StandaloneOSX;
            }
            else if (Application.platform == RuntimePlatform.LinuxEditor)
            {
                standaloneTarget = BuildTarget.StandaloneLinux64;
            }

            buildPlatformsList.Add(new BuildPlatform(BuildPipeline.GetBuildTargetGroupDisplayName(BuildTargetGroup.Standalone), "BuildSettings.Standalone", BuildTargetGroup.Standalone, standaloneTarget, true));

            foreach (var target in buildTargets)
            {
                if (!target.HasFlag(TargetAttributes.IsStandalonePlatform))
                {
                    BuildTargetGroup btg = BuildPipeline.GetBuildTargetGroup(target.buildTargetPlatformVal);
                    buildPlatformsList.Add(new BuildPlatform(
                                               BuildPipeline.GetBuildTargetGroupDisplayName(btg),
                                               target.iconName,
                                               btg,
                                               target.buildTargetPlatformVal,
                                               !target.HasFlag(TargetAttributes.HideInUI)));
                }
            }

            // Facebook is a special case and needs to be added separately
            buildPlatformsList.Add(new BuildPlatform(BuildPipeline.GetBuildTargetGroupDisplayName(BuildTargetGroup.Facebook), "BuildSettings.Facebook", BuildTargetGroup.Facebook, BuildTarget.StandaloneWindows64, true));

            foreach (var buildPlatform in buildPlatformsList)
            {
                buildPlatform.tooltip = buildPlatform.title.text + " settings";
            }

            buildPlatforms = buildPlatformsList.ToArray();
        }