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."),
            };
        }
 public static CustomScriptAssemblyPlatform GetPlatformFromBuildTarget(BuildTarget buildTarget)
 {
     CustomScriptAssemblyPlatform[] platforms = CustomScriptAssembly.Platforms;
     for (int i = 0; i < platforms.Length; i++)
     {
         CustomScriptAssemblyPlatform result = platforms[i];
         if (result.BuildTarget == buildTarget)
         {
             return(result);
         }
     }
     throw new ArgumentException(string.Format("No CustomScriptAssemblyPlatform setup for BuildTarget '{0}'", buildTarget));
 }
        public static CustomScriptAssemblyPlatform GetPlatformFromName(string name)
        {
            CustomScriptAssemblyPlatform[] platforms = CustomScriptAssembly.Platforms;
            for (int i = 0; i < platforms.Length; i++)
            {
                CustomScriptAssemblyPlatform result = platforms[i];
                if (string.Equals(result.Name, name, StringComparison.OrdinalIgnoreCase))
                {
                    return(result);
                }
            }
            string[] value = (from p in CustomScriptAssembly.Platforms
                              select string.Format("'{0}'", p.Name)).ToArray <string>();
            string arg = string.Join(",", value);

            throw new ArgumentException(string.Format("Platform name '{0}' not supported. Supported platform names: {1}", name, arg));
        }
예제 #5
0
        static CustomScriptAssembly()
        {
            // When removing a platform from Platforms, please add it to DeprecatedPlatforms.
            Platforms = new CustomScriptAssemblyPlatform[]
            {
                new CustomScriptAssemblyPlatform("Editor", "Editor", BuildTarget.NoTarget),
                new CustomScriptAssemblyPlatform("macOSStandalone", "macOS", BuildTarget.StandaloneOSX),
                new CustomScriptAssemblyPlatform("WindowsStandalone32", "Windows 32-bit", BuildTarget.StandaloneWindows),
                new CustomScriptAssemblyPlatform("WindowsStandalone64", "Windows 64-bit", BuildTarget.StandaloneWindows64),
                new CustomScriptAssemblyPlatform("LinuxStandalone32", "Linux 32-bit", BuildTarget.StandaloneLinux),
                new CustomScriptAssemblyPlatform("LinuxStandalone64", "Linux 64-bit", BuildTarget.StandaloneLinux64),
                new CustomScriptAssemblyPlatform("LinuxStandaloneUniversal", "Linux Universal", BuildTarget.StandaloneLinuxUniversal),
                new CustomScriptAssemblyPlatform("iOS", BuildTarget.iOS),
                new CustomScriptAssemblyPlatform("Android", BuildTarget.Android),
                new CustomScriptAssemblyPlatform("WebGL", BuildTarget.WebGL),
                new CustomScriptAssemblyPlatform("WSA", "Universal Windows Platform", BuildTarget.WSAPlayer),
                new CustomScriptAssemblyPlatform("PS4", BuildTarget.PS4),
                new CustomScriptAssemblyPlatform("XboxOne", BuildTarget.XboxOne),
                new CustomScriptAssemblyPlatform("tvOS", BuildTarget.tvOS),
                new CustomScriptAssemblyPlatform("Switch", BuildTarget.Switch),
                new CustomScriptAssemblyPlatform("Lumin", BuildTarget.Lumin),
            };

#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, "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."),
            };
        }
예제 #6
0
 public CustomScriptAssemblyPlatform(string name, BuildTarget buildTarget)
 {
     this = new CustomScriptAssemblyPlatform(name, name, buildTarget);
 }