示例#1
0
 public override void OnEnable(PlayerSettingsEditor editor)
 {
     this.splashScreenProperties = new SerializedProperty[UnityEditor.iOS.SplashScreen.iOSTypes.Length];
     for (int i = 0; i < UnityEditor.iOS.SplashScreen.iOSTypes.Length; i++)
     {
         this.splashScreenProperties[i] = editor.FindPropertyAssert(UnityEditor.iOS.SplashScreen.iOSTypes[i].serializationName);
     }
     this.iPhoneLaunchScreenProperties.type            = editor.FindPropertyAssert("iOSLaunchScreenType");
     this.iPhoneLaunchScreenProperties.portraitImage   = editor.FindPropertyAssert("iOSLaunchScreenPortrait");
     this.iPhoneLaunchScreenProperties.landscapeImage  = editor.FindPropertyAssert("iOSLaunchScreenLandscape");
     this.iPhoneLaunchScreenProperties.backgroundColor = editor.FindPropertyAssert("iOSLaunchScreenBackgroundColor");
     this.iPhoneLaunchScreenProperties.fillPercentage  = editor.FindPropertyAssert("iOSLaunchScreenFillPct");
     this.iPhoneLaunchScreenProperties.size            = editor.FindPropertyAssert("iOSLaunchScreenSize");
     this.iPhoneLaunchScreenProperties.customXibPath   = editor.FindPropertyAssert("iOSLaunchScreenCustomXibPath");
     this.iPadLaunchScreenProperties.type = editor.FindPropertyAssert("iOSLaunchScreeniPadType");
     this.iPadLaunchScreenProperties.portraitAndLandscapeImage = editor.FindPropertyAssert("iOSLaunchScreeniPadImage");
     this.iPadLaunchScreenProperties.backgroundColor           = editor.FindPropertyAssert("iOSLaunchScreeniPadBackgroundColor");
     this.iPadLaunchScreenProperties.fillPercentage            = editor.FindPropertyAssert("iOSLaunchScreeniPadFillPct");
     this.iPadLaunchScreenProperties.size          = editor.FindPropertyAssert("iOSLaunchScreeniPadSize");
     this.iPadLaunchScreenProperties.customXibPath = editor.FindPropertyAssert("iOSLaunchScreeniPadCustomXibPath");
     this.m_AppleDeveloperTeamID = editor.FindPropertyAssert("appleDeveloperTeamID");
     this.m_iOSManualSigningProvisioningProfileID = editor.FindPropertyAssert("iOSManualSigningProvisioningProfileID");
     this.m_AppleEnableAutomaticSigning           = editor.FindPropertyAssert("appleEnableAutomaticSigning");
     this.InitRequirements();
     this.m_AppInBackgroundBehavior = editor.FindPropertyAssert("iosAppInBackgroundBehavior");
 }
        protected ManagedProgram StartCompiler(BuildTarget target, string compiler, List <string> arguments)
        {
            base.AddCustomResponseFileIfPresent(arguments, Path.GetFileNameWithoutExtension(compiler) + ".rsp");
            string monodistro = (!PlayerSettingsEditor.IsLatestApiCompatibility(this._island._api_compatibility_level)) ? MonoInstallationFinder.GetMonoInstallation() : MonoInstallationFinder.GetMonoBleedingEdgeInstallation();

            return(this.StartCompiler(target, compiler, arguments, true, monodistro));
        }
示例#3
0
        protected string GetMonoProfileLibDirectory()
        {
            string profile          = BuildPipeline.CompatibilityProfileToClassLibFolder(this._island._api_compatibility_level);
            string monoInstallation = (!PlayerSettingsEditor.IsLatestApiCompatibility(this._island._api_compatibility_level)) ? "Mono" : "MonoBleedingEdge";

            return(MonoInstallationFinder.GetProfileDirectory(profile, monoInstallation));
        }
        public void SplashSectionGUI(BuildPlatform platform, ISettingEditorExtension settingsExtension, int sectionIndex = 2)
        {
            if (m_Owner.BeginSettingsBox(sectionIndex, k_Texts.title))
            {
                if (platform.namedBuildTarget == NamedBuildTarget.Server)
                {
                    PlayerSettingsEditor.ShowNoSettings();
                    EditorGUILayout.Space();
                }
                else
                {
                    ObjectReferencePropertyField <Texture2D>(m_VirtualRealitySplashScreen, k_Texts.vrSplashScreen);

                    if (TargetSupportsOptionalBuiltinSplashScreen(platform.namedBuildTarget.ToBuildTargetGroup(), settingsExtension))
                    {
                        BuiltinCustomSplashScreenGUI(platform.namedBuildTarget.ToBuildTargetGroup(), settingsExtension);
                    }

                    if (settingsExtension != null)
                    {
                        settingsExtension.SplashSectionGUI();
                    }

                    if (m_ShowUnitySplashScreen.boolValue)
                    {
                        m_Owner.ShowSharedNote();
                    }
                }
            }
            m_Owner.EndSettingsBox();
        }
示例#5
0
 public override void OnEnable(PlayerSettingsEditor settingsEditor)
 {
     this.m_TizenProductDescription = settingsEditor.FindPropertyAssert("tizenProductDescription");
     this.m_TizenProductURL         = settingsEditor.FindPropertyAssert("tizenProductURL");
     this.m_TizenProfileName        = settingsEditor.FindPropertyAssert("tizenSigningProfileName");
     this.m_TizenMinOSVersion       = settingsEditor.FindPropertyAssert("tizenMinOSVersion");
     this.m_IPhoneSplashScreen      = settingsEditor.FindPropertyAssert("iPhoneSplashScreen");
 }
示例#6
0
        protected ManagedProgram StartCompiler(BuildTarget target, string compiler, List <string> arguments, string profileDirectory)
        {
            AddCustomResponseFileIfPresent(arguments, Path.GetFileNameWithoutExtension(compiler) + ".rsp");

            var monoInstallation = PlayerSettingsEditor.IsLatestApiCompatibility(m_Island._api_compatibility_level)
                ? MonoInstallationFinder.GetMonoBleedingEdgeInstallation()
                : MonoInstallationFinder.GetMonoInstallation();

            return(StartCompiler(target, compiler, arguments, profileDirectory, true, monoInstallation));
        }
示例#7
0
        protected string GetMonoProfileLibDirectory()
        {
            var profile = BuildPipeline.CompatibilityProfileToClassLibFolder(m_Island._api_compatibility_level);

            var monoInstall = PlayerSettingsEditor.IsLatestApiCompatibility(m_Island._api_compatibility_level)
                ? MonoInstallationFinder.MonoBleedingEdgeInstallation
                : MonoInstallationFinder.MonoInstallation;

            return(MonoInstallationFinder.GetProfileDirectory(profile, monoInstall));
        }
        public PlayerSettingsEditorVR(PlayerSettingsEditor settingsEditor)
        {
            m_Settings = settingsEditor;
            m_StereoRenderingPath = m_Settings.serializedObject.FindProperty("m_StereoRenderingPath");

            m_AndroidEnableTango = m_Settings.FindPropertyAssert("AndroidEnableTango");

            SerializedProperty property = m_Settings.serializedObject.FindProperty("vrSettings");
            if (property != null)
                m_Enable360StereoCapture = property.FindPropertyRelative("enable360StereoCapture");
        }
示例#9
0
 public override void OnEnable(PlayerSettingsEditor settingsEditor)
 {
     this.m_SettingsEditor                          = settingsEditor;
     this.m_GUIDefaultIsFullScreen                  = EditorGUIUtility.TextContent("Default Is Full Screen*");
     this.m_CompanyName                             = settingsEditor.FindPropertyAssert("companyName");
     this.m_ProductName                             = settingsEditor.FindPropertyAssert("productName");
     this.m_DefaultIsFullScreen                     = settingsEditor.FindPropertyAssert("defaultIsFullScreen");
     this.m_RunInBackground                         = settingsEditor.FindPropertyAssert("runInBackground");
     this.m_MetroPackageName                        = settingsEditor.FindPropertyAssert("metroPackageName");
     this.m_MetroPackageName.stringValue            = Utility.TryValidatePackageName(this.m_MetroPackageName.stringValue);
     this.m_MetroPackageVersion                     = settingsEditor.FindPropertyAssert("metroPackageVersion");
     this.m_MetroPackageVersion.stringValue         = PlayerSettings.WSA.ValidatePackageVersion(this.m_MetroPackageVersion.stringValue);
     this.m_MetroApplicationDescription             = settingsEditor.FindPropertyAssert("metroApplicationDescription");
     this.m_MetroApplicationDescription.stringValue = this.ValidateMetroApplicationDescription(this.m_MetroApplicationDescription.stringValue);
     this.m_MetroTileShortName                      = settingsEditor.FindPropertyAssert("metroTileShortName");
     this.m_MetroTileShortName.stringValue          = this.ValidateMetroTileShortName(this.m_MetroTileShortName.stringValue);
     this.m_MetroTileBackgroundColor                = settingsEditor.FindPropertyAssert("metroTileBackgroundColor");
     this.m_MetroFTAName                            = settingsEditor.FindPropertyAssert("metroFTAName");
     this.m_MetroFTAFileTypes                       = settingsEditor.FindPropertyAssert("metroFTAFileTypes");
     this.m_MetroProtocolName                       = settingsEditor.FindPropertyAssert("metroProtocolName");
     PlayerSettings.WSAImageScale[] scales      = new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale._80 };
     PlayerSettings.WSAImageScale[] scaleArray2 = new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale._100 };
     PlayerSettings.WSAImageScale[] scaleArray3 = new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale._100 };
     this.m_PackageLogos = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.PackageLogo, new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale._100 }, "Scale {0}% ({1}x{2} pixels)|Specifies the image that appears on the Store description page for the product.", new int[] { 50, 0x3f, 70, 0x4b, 90, 100, 120, 200 });
     MetroScaledImage[] sourceArray      = CreateScaledSquareImages(PlayerSettings.WSAImageType.StoreTileSmallLogo, scales, "Scale {0}% ({1}x{2} pixels)|Specifies the image that is shown when viewing all installed applications.", new int[] { 0x18, 30, 0x2a, 0x36 });
     MetroScaledImage[] imageArray2      = CreateScaledSquareImages(PlayerSettings.WSAImageType.StoreTileSmallLogo, new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale.Target16 }, "Target size {0} ({1}x{2} pixels)|Specifies the image that is shown when viewing all installed applications.", new int[] { 0x10, 0x20, 0x30, 0x100 });
     MetroScaledImage[] destinationArray = new MetroScaledImage[sourceArray.Length + imageArray2.Length];
     Array.Copy(sourceArray, destinationArray, sourceArray.Length);
     Array.Copy(imageArray2, 0, destinationArray, sourceArray.Length, imageArray2.Length);
     this.m_StoreSmallLogos  = new MetroScaledImageGroup(destinationArray);
     this.m_MediumTiles      = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.StoreTileLogo, scales, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile in Windows.", new int[] { 120, 150, 210, 270 });
     this.m_WideTiles        = CreateScaledImageGroup(PlayerSettings.WSAImageType.StoreTileWideLogo, scales, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's wide tile in Windows if supported.", new int[] { 0xf8, 310, 0x1b2, 0x22e }, new int[] { 120, 150, 210, 270 });
     this.m_SmallTiles       = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.StoreSmallTile, scales, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's small tile in Windows if supported.", new int[] { 0x38, 70, 0x62, 0x7e });
     this.m_LargeTiles       = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.StoreLargeTile, scales, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's large tile in Windows if supported.", new int[] { 0xf8, 310, 0x1b2, 0x22e });
     this.m_PhoneAppIcons    = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.PhoneAppIcon, scaleArray2, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's small tile.", new int[] { 0x2c, 0x3e, 0x6a });
     this.m_PhoneSmallTiles  = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.PhoneSmallTile, scaleArray2, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's small tile", new int[] { 0x47, 0x63, 170 });
     this.m_PhoneMediumTiles = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.PhoneMediumTile, scaleArray2, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 150, 210, 360 });
     this.m_PhoneWideTiles   = CreateScaledImageGroup(PlayerSettings.WSAImageType.PhoneWideTile, scaleArray2, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's wide tile.", new int[] { 310, 0x1b2, 0x2e8 }, new int[] { 150, 210, 360 });
     MetroScaledImage[] imageArray4 = CreateScaledSquareImages(PlayerSettings.WSAImageType.UWPSquare44x44Logo, scaleArray3, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 0x2c, 0x37, 0x42, 0x58, 0xb0 });
     MetroScaledImage[] imageArray5 = CreateScaledSquareImages(PlayerSettings.WSAImageType.UWPSquare44x44Logo, new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale.Target16 }, "Target size {0} ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 0x10, 0x18, 0x30, 0x100 });
     MetroScaledImage[] imageArray6 = new MetroScaledImage[imageArray4.Length + imageArray5.Length];
     Array.Copy(imageArray4, imageArray6, imageArray4.Length);
     Array.Copy(imageArray5, 0, imageArray6, imageArray4.Length, imageArray5.Length);
     this.m_UWPSquare44x44Logos            = new MetroScaledImageGroup(imageArray6);
     this.m_UWPSquare71x71Logos            = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.UWPSquare71x71Logo, scaleArray3, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 0x47, 0x59, 0x6b, 0x8e, 0x11c });
     this.m_UWPSquare150x150Logos          = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.UWPSquare150x150Logo, scaleArray3, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 150, 0xbc, 0xe1, 300, 600 });
     this.m_UWPSquare310x310Logos          = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.UWPSquare310x310Logo, scaleArray3, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 310, 0x184, 0x1d1, 620, 0x4d8 });
     this.m_UWPWide310x150Logos            = CreateScaledImageGroup(PlayerSettings.WSAImageType.UWPWide310x150Logo, scaleArray3, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 310, 0x184, 0x1d1, 620, 0x4d8 }, new int[] { 150, 0xbc, 0xe1, 300, 600 });
     this.m_WindowsSplashScreens           = CreateScaledImages(PlayerSettings.WSAImageType.SplashScreenImage, new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale._100 }, "Scale {0}% ({1}x{2} pixels)|Sets the foreground image for the app's splash screen.", new int[] { 620, 0x307, 0x364, 930, 0x45c, 0x4d8, 0x9b0 }, new int[] { 300, 0x177, 420, 450, 540, 600, 0x4b0 });
     this.m_PhoneSplashScreens             = CreateScaledImages(PlayerSettings.WSAImageType.PhoneSplashScreen, scaleArray2, "Scale {0}% ({1}x{2} pixels)|Sets the foreground image for the app's splash screen.", new int[] { 480, 0x2a0, 0x480 }, new int[] { 800, 0x460, 0x780 });
     this.m_HolographicSplashScreen        = settingsEditor.FindPropertyAssert("m_VirtualRealitySplashScreen");
     this.m_HolographicPauseOnTrackingLoss = settingsEditor.FindPropertyAssert("m_HolographicPauseOnTrackingLoss");
     this.m_HolographicTrackingLossScreen  = settingsEditor.FindPropertyAssert("m_HolographicTrackingLossScreen");
 }
示例#10
0
        private string ProjectHeader(MonoIsland island, string[] additionalDefines)
        {
            string            text     = "v3.5";
            string            text2    = "4";
            string            text3    = "4.0";
            string            text4    = "10.0.20506";
            string            text5    = ".";
            ScriptingLanguage language = SolutionSynchronizer.ScriptingLanguageFor(island);

            if (PlayerSettingsEditor.IsLatestApiCompatibility(island._api_compatibility_level))
            {
                text  = "v4.6";
                text2 = "6";
            }
            else if (ScriptEditorUtility.GetScriptEditorFromPreferences() == ScriptEditorUtility.ScriptEditor.Rider)
            {
                text = "v4.5";
            }
            else if (this._settings.VisualStudioVersion == 9)
            {
                text3 = "3.5";
                text4 = "9.0.21022";
            }
            object[] array = new object[]
            {
                text3,
                text4,
                this.ProjectGuid(island._output),
                this._settings.EngineAssemblyPath,
                this._settings.EditorAssemblyPath,
                string.Join(";", new string[]
                {
                    "DEBUG",
                    "TRACE"
                }.Concat(this._settings.Defines).Concat(island._defines).Concat(additionalDefines).Distinct <string>().ToArray <string>()),
                SolutionSynchronizer.MSBuildNamespaceUri,
                Path.GetFileNameWithoutExtension(island._output),
                EditorSettings.projectGenerationRootNamespace,
                text,
                text2,
                text5
            };
            string result;

            try
            {
                result = string.Format(this._settings.GetProjectHeaderTemplate(language), array);
            }
            catch (Exception)
            {
                throw new NotSupportedException("Failed creating c# project because the c# project header did not have the correct amount of arguments, which is " + array.Length);
            }
            return(result);
        }
示例#11
0
 public override void OnEnable(PlayerSettingsEditor settingsEditor)
 {
     this.m_SamsungTVDeviceAddress      = settingsEditor.FindPropertyAssert("stvDeviceAddress");
     this.m_SamsungTVProductDescription = settingsEditor.FindPropertyAssert("stvProductDescription");
     this.m_SamsungTVProductAuthor      = settingsEditor.FindPropertyAssert("stvProductAuthor");
     this.m_SamsungTVProductAuthorEmail = settingsEditor.FindPropertyAssert("stvProductAuthorEmail");
     this.m_SamsungTVProductLink        = settingsEditor.FindPropertyAssert("stvProductLink");
     this.m_SamsungTVProductCategory    = settingsEditor.FindPropertyAssert("stvProductCategory");
     this.m_IPhoneSplashScreen          = settingsEditor.FindPropertyAssert("iPhoneSplashScreen");
     this.m_IgnoreAlphaClear            = settingsEditor.FindPropertyAssert("ignoreAlphaClear");
     this.m_SettingsEditor = settingsEditor;
 }
 public override void OnEnable(PlayerSettingsEditor settingsEditor)
 {
     this.m_WebGLMemorySize = settingsEditor.FindPropertyAssert("webGLMemorySize");
     this.m_WebGLExceptionSupport = settingsEditor.FindPropertyAssert("webGLExceptionSupport");
     this.m_WebGLCompressionFormat = settingsEditor.FindPropertyAssert("webGLCompressionFormat");
     this.m_WebGLDataCaching = settingsEditor.FindPropertyAssert("webGLDataCaching");
     this.m_WebGLDebugSymbols = settingsEditor.FindPropertyAssert("webGLDebugSymbols");
     this.m_WebGLTemplate = settingsEditor.FindPropertyAssert("webGLTemplate");
     this.m_DefaultScreenWidthWeb = settingsEditor.FindPropertyAssert("defaultScreenWidthWeb");
     this.m_DefaultScreenHeightWeb = settingsEditor.FindPropertyAssert("defaultScreenHeightWeb");
     this.m_RunInBackground = settingsEditor.FindPropertyAssert("runInBackground");
 }
示例#13
0
 public override void OnEnable(PlayerSettingsEditor settingsEditor)
 {
     this.m_WebGLMemorySize        = settingsEditor.FindPropertyAssert("webGLMemorySize");
     this.m_WebGLExceptionSupport  = settingsEditor.FindPropertyAssert("webGLExceptionSupport");
     this.m_WebGLCompressionFormat = settingsEditor.FindPropertyAssert("webGLCompressionFormat");
     this.m_WebGLDataCaching       = settingsEditor.FindPropertyAssert("webGLDataCaching");
     this.m_WebGLDebugSymbols      = settingsEditor.FindPropertyAssert("webGLDebugSymbols");
     this.m_WebGLTemplate          = settingsEditor.FindPropertyAssert("webGLTemplate");
     this.m_DefaultScreenWidthWeb  = settingsEditor.FindPropertyAssert("defaultScreenWidthWeb");
     this.m_DefaultScreenHeightWeb = settingsEditor.FindPropertyAssert("defaultScreenHeightWeb");
     this.m_RunInBackground        = settingsEditor.FindPropertyAssert("runInBackground");
 }
 public override void OnEnable(PlayerSettingsEditor settingsEditor)
 {
     this.m_SamsungTVDeviceAddress = settingsEditor.FindPropertyAssert("stvDeviceAddress");
     this.m_SamsungTVProductDescription = settingsEditor.FindPropertyAssert("stvProductDescription");
     this.m_SamsungTVProductAuthor = settingsEditor.FindPropertyAssert("stvProductAuthor");
     this.m_SamsungTVProductAuthorEmail = settingsEditor.FindPropertyAssert("stvProductAuthorEmail");
     this.m_SamsungTVProductLink = settingsEditor.FindPropertyAssert("stvProductLink");
     this.m_SamsungTVProductCategory = settingsEditor.FindPropertyAssert("stvProductCategory");
     this.m_IPhoneSplashScreen = settingsEditor.FindPropertyAssert("iPhoneSplashScreen");
     this.m_IgnoreAlphaClear = settingsEditor.FindPropertyAssert("ignoreAlphaClear");
     this.m_SettingsEditor = settingsEditor;
 }
        private string ProjectHeader(MonoIsland island,
                                     ScriptCompilerBase.ResponseFileData responseFileData)
        {
            string            targetframeworkversion = "v3.5";
            string            targetLanguageVersion  = "4";
            string            toolsversion           = "4.0";
            string            productversion         = "10.0.20506";
            string            baseDirectory          = ".";
            ScriptingLanguage language = ScriptingLanguageFor(island);

            if (PlayerSettingsEditor.IsLatestApiCompatibility(island._api_compatibility_level))
            {
                if (ScriptEditorUtility.GetScriptEditorFromPreferences() == ScriptEditorUtility.ScriptEditor.Rider ||
                    ScriptEditorUtility.GetScriptEditorFromPreferences() == ScriptEditorUtility.ScriptEditor.VisualStudioCode)
                {
                    targetframeworkversion = "v4.5";
                }
                else
                {
                    targetframeworkversion = "v4.7.1";
                }
                targetLanguageVersion = "7.2";
            }
            else if (_settings.VisualStudioVersion == 9)
            {
                toolsversion   = "3.5";
                productversion = "9.0.21022";
            }

            var arguments = new object[]
            {
                toolsversion, productversion, ProjectGuid(island._output),
                _settings.EngineAssemblyPath,
                _settings.EditorAssemblyPath,
                string.Join(";", new[] { "DEBUG", "TRACE" }.Concat(island._defines).Concat(responseFileData.Defines).Distinct().ToArray()),
                MSBuildNamespaceUri,
                Path.GetFileNameWithoutExtension(island._output),
                EditorSettings.projectGenerationRootNamespace,
                targetframeworkversion,
                targetLanguageVersion,
                baseDirectory,
                island._allowUnsafeCode | responseFileData.Unsafe
            };

            try
            {
                return(string.Format(_settings.GetProjectHeaderTemplate(language), arguments));
            }
            catch (Exception)
            {
                throw new System.NotSupportedException("Failed creating c# project because the c# project header did not have the correct amount of arguments, which is " + arguments.Length);
            }
        }
 public override void OnEnable(PlayerSettingsEditor editor)
 {
     this.splashScreenProperties = new SerializedProperty[splashScreenTypes.Length];
     for (int i = 0; i < splashScreenTypes.Length; i++)
     {
         this.splashScreenProperties[i] = editor.FindPropertyAssert(splashScreenTypes[i].serializationName);
     }
     this.m_SmallIconsLayers = new ReorderableIconLayerList();
     this.m_SmallIconsLayers.headerString = LocalizationDatabase.GetLocalizedString("Small icon layers");
     this.m_SmallIconsLayers.minItems = 2;
     this.m_SmallIconsLayers.SetImageSize(400, 240);
     if (<>f__am$cache0 == null)
     {
示例#17
0
 public override void OnEnable(PlayerSettingsEditor editor)
 {
     this.splashScreenProperties = new SerializedProperty[splashScreenTypes.Length];
     for (int i = 0; i < splashScreenTypes.Length; i++)
     {
         this.splashScreenProperties[i] = editor.FindPropertyAssert(splashScreenTypes[i].serializationName);
     }
     this.m_SmallIconsLayers = new ReorderableIconLayerList();
     this.m_SmallIconsLayers.headerString = LocalizationDatabase.GetLocalizedString("Small icon layers");
     this.m_SmallIconsLayers.minItems     = 2;
     this.m_SmallIconsLayers.SetImageSize(400, 240);
     if (< > f__am$cache0 == null)
     {
示例#18
0
        public static void ShowArchitectureButton(BuildTargetGroup target)
        {
            bool flag;

            if (target == BuildTargetGroup.tvOS)
            {
                flag = PlayerSettings.tvOS.sdkVersion == tvOSSdkVersion.Simulator;
            }
            else
            {
                flag = PlayerSettings.iOS.sdkVersion == iOSSdkVersion.SimulatorSDK;
            }
            int scriptingBackend = (int)PlayerSettings.GetScriptingBackend(target);

            if (!flag)
            {
                int num3;
                int architecture = PlayerSettings.GetArchitecture(target);
                if (scriptingBackend == 1)
                {
                    if (target == BuildTargetGroup.tvOS)
                    {
                        num3 = 1;
                        PlayerSettingsEditor.BuildDisabledEnumPopup(new GUIContent("ARM64"), EditorGUIUtility.TextContent("Architecture"));
                    }
                    else
                    {
                        num3 = PlayerSettingsEditor.BuildEnumPopup <Architecture>(EditorGUIUtility.TextContent("Architecture"), architecture, kArchitectureOrder, kArchitectureDescriptions);
                    }
                }
                else
                {
                    num3 = 0;
                    PlayerSettingsEditor.BuildDisabledEnumPopup(new GUIContent("ARMv7"), EditorGUIUtility.TextContent("Architecture"));
                }
                if (num3 != architecture)
                {
                    PlayerSettings.SetArchitecture(target, num3);
                }
            }
            else if (scriptingBackend == 1)
            {
                PlayerSettingsEditor.BuildDisabledEnumPopup(EditorGUIUtility.TextContent("x86_64"), EditorGUIUtility.TextContent("Architecture"));
            }
            else
            {
                PlayerSettingsEditor.BuildDisabledEnumPopup(EditorGUIUtility.TextContent("i386"), EditorGUIUtility.TextContent("Architecture"));
            }
        }
 public override void OnEnable(PlayerSettingsEditor settingsEditor)
 {
     this.m_AndroidBundleVersionCode        = settingsEditor.FindPropertyAssert("AndroidBundleVersionCode");
     this.m_AndroidKeystoreName             = settingsEditor.FindPropertyAssert("AndroidKeystoreName");
     this.m_AndroidKeyaliasName             = settingsEditor.FindPropertyAssert("AndroidKeyaliasName");
     this.m_AndroidMinSdkVersion            = settingsEditor.FindPropertyAssert("AndroidMinSdkVersion");
     this.m_AndroidPreferredInstallLocation = settingsEditor.FindPropertyAssert("AndroidPreferredInstallLocation");
     this.m_AndroidSplashScreenScale        = settingsEditor.FindPropertyAssert("AndroidSplashScreenScale");
     this.m_AndroidTargetDevice             = settingsEditor.FindPropertyAssert("AndroidTargetDevice");
     this.m_AndroidTVCompatibility          = settingsEditor.FindPropertyAssert("AndroidTVCompatibility");
     this.m_AndroidIsGame              = settingsEditor.FindPropertyAssert("AndroidIsGame");
     this.m_AndroidEnableBanner        = settingsEditor.FindPropertyAssert("androidEnableBanner");
     this.m_AndroidGamepadSupportLevel = settingsEditor.FindPropertyAssert("androidGamepadSupportLevel");
     this.m_APKExpansionFiles          = settingsEditor.FindPropertyAssert("APKExpansionFiles");
     this.m_ForceInternetPermission    = settingsEditor.FindPropertyAssert("ForceInternetPermission");
     this.m_ForceSDCardPermission      = settingsEditor.FindPropertyAssert("ForceSDCardPermission");
     this.m_AndroidSplashScreen        = settingsEditor.FindPropertyAssert("androidSplashScreen");
     this.m_SettingsEditor             = settingsEditor;
 }
 internal static void SetColorGamuts(ColorGamut[] colorSpaces)
 {
     SetColorGamutsImpl(colorSpaces);
     // Color space data is cached in player settings editor
     PlayerSettingsEditor.SyncColorGamuts();
 }
 public static void SetGraphicsAPIs(BuildTarget platform, UnityEngine.Rendering.GraphicsDeviceType[] apis)
 {
     SetGraphicsAPIsImpl(platform, apis);
     // we do cache api list in player settings editor, so if we update from script we should forcibly update cache
     PlayerSettingsEditor.SyncPlatformAPIsList(platform);
 }
示例#22
0
        private static bool StripAssembliesTo(string[] assemblies, string[] searchDirs, string outputFolder, string workingDirectory, out string output, out string error, string linkerPath, IIl2CppPlatformProvider platformProvider, IEnumerable <string> additionalBlacklist, BuildTargetGroup buildTargetGroup, ManagedStrippingLevel managedStrippingLevel)
        {
            if (!Directory.Exists(outputFolder))
            {
                Directory.CreateDirectory(outputFolder);
            }

            additionalBlacklist = additionalBlacklist.Select(s => Path.IsPathRooted(s) ? s : Path.Combine(workingDirectory, s)).Where(File.Exists);

            var userBlackLists = GetUserBlacklistFiles();

            foreach (var ub in userBlackLists)
            {
                Console.WriteLine("UserBlackList: " + ub);
            }

            additionalBlacklist = additionalBlacklist.Concat(userBlackLists);

            var args = new List <string>
            {
                "-out=\"" + outputFolder + "\"",
                "-x=\"" + GetModuleWhitelist("Core", platformProvider.moduleStrippingInformationFolder) + "\"",
            };

            args.AddRange(additionalBlacklist.Select(path => "-x \"" + path + "\""));

            args.AddRange(searchDirs.Select(d => "-d \"" + d + "\""));
            args.AddRange(assemblies.Select(assembly => "--include-unity-root-assembly=\"" + Path.GetFullPath(assembly) + "\""));
            args.Add($"--dotnetruntime={GetRuntimeArgumentValueForLinker(buildTargetGroup)}");
            args.Add($"--dotnetprofile={GetProfileArgumentValueForLinker(buildTargetGroup)}");
            args.Add("--use-editor-options");
            args.Add($"--include-directory={CommandLineFormatter.PrepareFileName(workingDirectory)}");

            if (EditorUserBuildSettings.allowDebugging)
            {
                args.Add("--editor-settings-flag=AllowDebugging");
            }

            if (EditorUserBuildSettings.development)
            {
                args.Add("--editor-settings-flag=Development");
            }

            args.Add($"--rule-set={GetRuleSetForStrippingLevel(managedStrippingLevel)}");

            // One final check to make sure we only run high on latest runtime.
            if ((managedStrippingLevel == ManagedStrippingLevel.High) && (PlayerSettingsEditor.IsLatestApiCompatibility(PlayerSettings.GetApiCompatibilityLevel(buildTargetGroup))))
            {
                // Prepare the arguments to run the UnityLinker.  When in high mode, need to also
                // supply the IL2CPP compiler platform and compiler architecture.  When the scripting backend
                // is not IL2CPP, we have to map those strings and use a utility function to figure out proper strings.

                // Currently only need to do this on the non aot platforms of Android, Windows, Mac, Linux.
                var compilerPlatform     = "";
                var compilerArchitecture = "";
                Il2CppNativeCodeBuilder il2cppNativeCodeBuilder = platformProvider.CreateIl2CppNativeCodeBuilder();
                if (il2cppNativeCodeBuilder != null)
                {
                    compilerPlatform     = il2cppNativeCodeBuilder.CompilerPlatform;
                    compilerArchitecture = il2cppNativeCodeBuilder.CompilerArchitecture;
                }
                else
                {
                    GetUnityLinkerPlatformStringsFromBuildTarget(platformProvider.target, out compilerPlatform, out compilerArchitecture);
                }

                args.Add($"--platform={compilerPlatform}");
                if (platformProvider.target != BuildTarget.Android)
                {
                    args.Add($"--architecture={compilerArchitecture}");
                }
            }

            var additionalArgs = System.Environment.GetEnvironmentVariable("UNITYLINKER_ADDITIONAL_ARGS");

            if (!string.IsNullOrEmpty(additionalArgs))
            {
                args.Add(additionalArgs);
            }

            additionalArgs = Debug.GetDiagnosticSwitch("VMUnityLinkerAdditionalArgs") as string;
            if (!string.IsNullOrEmpty(additionalArgs))
            {
                args.Add(additionalArgs.Trim('\''));
            }

            return(RunAssemblyLinker(args, out output, out error, linkerPath, workingDirectory));
        }
 public override void OnEnable(PlayerSettingsEditor settingsEditor)
 {
     this.m_AndroidBundleVersionCode = settingsEditor.FindPropertyAssert("AndroidBundleVersionCode");
     this.m_AndroidKeystoreName = settingsEditor.FindPropertyAssert("AndroidKeystoreName");
     this.m_AndroidKeyaliasName = settingsEditor.FindPropertyAssert("AndroidKeyaliasName");
     this.m_AndroidMinSdkVersion = settingsEditor.FindPropertyAssert("AndroidMinSdkVersion");
     this.m_AndroidPreferredInstallLocation = settingsEditor.FindPropertyAssert("AndroidPreferredInstallLocation");
     this.m_AndroidSplashScreenScale = settingsEditor.FindPropertyAssert("AndroidSplashScreenScale");
     this.m_AndroidTargetDevice = settingsEditor.FindPropertyAssert("AndroidTargetDevice");
     this.m_AndroidTVCompatibility = settingsEditor.FindPropertyAssert("AndroidTVCompatibility");
     this.m_AndroidIsGame = settingsEditor.FindPropertyAssert("AndroidIsGame");
     this.m_AndroidEnableBanner = settingsEditor.FindPropertyAssert("androidEnableBanner");
     this.m_AndroidGamepadSupportLevel = settingsEditor.FindPropertyAssert("androidGamepadSupportLevel");
     this.m_APKExpansionFiles = settingsEditor.FindPropertyAssert("APKExpansionFiles");
     this.m_ForceInternetPermission = settingsEditor.FindPropertyAssert("ForceInternetPermission");
     this.m_ForceSDCardPermission = settingsEditor.FindPropertyAssert("ForceSDCardPermission");
     this.m_AndroidSplashScreen = settingsEditor.FindPropertyAssert("androidSplashScreen");
     this.m_SettingsEditor = settingsEditor;
 }
示例#24
0
        private static void RunAssemblyStripper(IEnumerable assemblies, string managedAssemblyFolderPath, string[] assembliesToStrip, string[] searchDirs, string monoLinkerPath, IIl2CppPlatformProvider platformProvider, RuntimeClassRegistry rcr)
        {
            string output;
            string error;
            var    buildTargetGroup         = BuildPipeline.GetBuildTargetGroup(platformProvider.target);
            bool   isMono                   = PlayerSettings.GetScriptingBackend(buildTargetGroup) == ScriptingImplementation.Mono2x;
            bool   stripEngineCode          = rcr != null && PlayerSettings.stripEngineCode && platformProvider.supportsEngineStripping;
            IEnumerable <string> blacklists = Il2CppBlacklistPaths;

            if (rcr != null)
            {
                blacklists = blacklists.Concat(new[] {
                    WriteMethodsToPreserveBlackList(rcr, platformProvider.target),
                    WriteUnityEngineBlackList(),
                    MonoAssemblyStripping.GenerateLinkXmlToPreserveDerivedTypes(managedAssemblyFolderPath, rcr)
                });
            }

            if (PlayerSettingsEditor.IsLatestApiCompatibility(PlayerSettings.GetApiCompatibilityLevel(buildTargetGroup)))
            {
                var il2cppFolder = Path.Combine(platformProvider.il2CppFolder, "LinkerDescriptors");
                blacklists = blacklists.Concat(Directory.GetFiles(il2cppFolder, "*45.xml"));
            }
            if (isMono)
            {
                // Apply mono-specific assembly whitelists, taken from old Mono assembly stripping code path.
                var il2cppFolder = Path.Combine(platformProvider.il2CppFolder, "LinkerDescriptors");
                blacklists = blacklists.Concat(Directory.GetFiles(il2cppFolder, "*_mono.xml"));

                // The old Mono assembly stripper uses per-platform link.xml files if available. Apply these here.
                var platformDescriptor = Path.Combine(BuildPipeline.GetBuildToolsDirectory(platformProvider.target), "link.xml");
                if (File.Exists(platformDescriptor))
                {
                    blacklists = blacklists.Concat(new[] { platformDescriptor });
                }
            }

            if (!stripEngineCode)
            {
                // if we don't do stripping, add all modules blacklists.
                foreach (var file in Directory.GetFiles(platformProvider.moduleStrippingInformationFolder, "*.xml"))
                {
                    blacklists = blacklists.Concat(new[] { file });
                }
            }

            var tempStripPath = Path.GetFullPath(Path.Combine(managedAssemblyFolderPath, "tempStrip"));

            bool addedMoreBlacklists;

            do
            {
                addedMoreBlacklists = false;

                if (EditorUtility.DisplayCancelableProgressBar("Building Player", "Stripping assemblies", 0.0f))
                {
                    throw new OperationCanceledException();
                }

                if (!StripAssembliesTo(
                        assembliesToStrip,
                        searchDirs,
                        tempStripPath,
                        managedAssemblyFolderPath,
                        out output,
                        out error,
                        monoLinkerPath,
                        platformProvider,
                        blacklists))
                {
                    throw new Exception("Error in stripping assemblies: " + assemblies + ", " + error);
                }

                if (platformProvider.supportsEngineStripping)
                {
                    var icallSummaryPath = Path.Combine(managedAssemblyFolderPath, "ICallSummary.txt");
                    GenerateInternalCallSummaryFile(icallSummaryPath, managedAssemblyFolderPath, tempStripPath);

                    if (stripEngineCode)
                    {
                        // Find which modules we must include in the build based on Assemblies
                        HashSet <UnityType> nativeClasses;
                        HashSet <string>    nativeModules;
                        CodeStrippingUtils.GenerateDependencies(tempStripPath, icallSummaryPath, rcr, stripEngineCode, out nativeClasses, out nativeModules, platformProvider);
                        // Add module-specific blacklists.
                        addedMoreBlacklists = AddWhiteListsForModules(nativeModules, ref blacklists, platformProvider.moduleStrippingInformationFolder);
                    }
                }

                // If we had to add more whitelists, we need to run AssemblyStripper again with the added whitelists.
            }while (addedMoreBlacklists);

            // keep unstripped files for debugging purposes
            var tempUnstrippedPath = Path.GetFullPath(Path.Combine(managedAssemblyFolderPath, "tempUnstripped"));

            if (debugUnstripped)
            {
                Directory.CreateDirectory(tempUnstrippedPath);
            }
            foreach (var file in Directory.GetFiles(managedAssemblyFolderPath))
            {
                var extension = Path.GetExtension(file);
                if (string.Equals(extension, ".dll", StringComparison.InvariantCultureIgnoreCase) ||
                    string.Equals(extension, ".winmd", StringComparison.InvariantCultureIgnoreCase) ||
                    string.Equals(extension, ".mdb", StringComparison.InvariantCultureIgnoreCase) ||
                    string.Equals(extension, ".pdb", StringComparison.InvariantCultureIgnoreCase))
                {
                    if (debugUnstripped)
                    {
                        File.Move(file, Path.Combine(tempUnstrippedPath, Path.GetFileName(file)));
                    }
                    else
                    {
                        File.Delete(file);
                    }
                }
            }

            foreach (var file in Directory.GetFiles(tempStripPath))
            {
                File.Move(file, Path.Combine(managedAssemblyFolderPath, Path.GetFileName(file)));
            }
            Directory.Delete(tempStripPath);
        }
 public virtual void OnEnable(PlayerSettingsEditor settingsEditor)
 {
 }
示例#26
0
        private string ProjectHeader(MonoIsland island,
                                     IEnumerable <ResponseFileData> responseFilesData)
        {
            string            targetframeworkversion = "v3.5";
            string            targetLanguageVersion  = "4";
            string            toolsversion           = "4.0";
            string            productversion         = "10.0.20506";
            string            baseDirectory          = ".";
            string            cscToolPath            = "$(CscToolPath)";
            string            cscToolExe             = "$(CscToolExe)";
            ScriptingLanguage language = ScriptingLanguageFor(island);

            if (PlayerSettingsEditor.IsLatestApiCompatibility(island._api_compatibility_level))
            {
                targetframeworkversion = "v4.7.1";
                targetLanguageVersion  = "latest";

                cscToolPath = Paths.Combine(EditorApplication.applicationContentsPath, "Tools", "RoslynScripts");
                if (Application.platform == RuntimePlatform.WindowsEditor)
                {
                    cscToolExe = "unity_csc.bat";
                }
                else
                {
                    cscToolExe = "unity_csc.sh";
                }

                cscToolPath = Paths.UnifyDirectorySeparator(cscToolPath);
            }
            else if (_settings.VisualStudioVersion == 9)
            {
                toolsversion   = "3.5";
                productversion = "9.0.21022";
            }

            var arguments = new object[]
            {
                toolsversion, productversion, ProjectGuid(island._output),
                _settings.EngineAssemblyPath,
                _settings.EditorAssemblyPath,
                string.Join(";", new[] { "DEBUG", "TRACE" }.Concat(island._defines).Concat(responseFilesData.SelectMany(x => x.Defines)).Distinct().ToArray()),
                MSBuildNamespaceUri,
                Utility.FileNameWithoutExtension(island._output),
                EditorSettings.projectGenerationRootNamespace,
                targetframeworkversion,
                targetLanguageVersion,
                baseDirectory,
                island._allowUnsafeCode | responseFilesData.Any(x => x.Unsafe),
                cscToolPath,
                cscToolExe,
            };

            try
            {
                return(string.Format(_settings.GetProjectHeaderTemplate(language), arguments));
            }
            catch (Exception)
            {
                throw new System.NotSupportedException("Failed creating c# project because the c# project header did not have the correct amount of arguments, which is " + arguments.Length);
            }
        }
        public override void ShowPlatformBuildOptions()
        {
            int iOSBuildConfigType = (int)EditorUserBuildSettings.iOSBuildConfigType;

            EditorUserBuildSettings.iOSBuildConfigType = (iOSBuildType)PlayerSettingsEditor.BuildEnumPopup <iOSBuildType>(EditorGUIUtility.TextContent("Run in Xcode as"), iOSBuildConfigType, kOptionsOrder, kOptionDescriptions);
        }
示例#28
0
        private void DrawLaunchScreenGUI(LaunchScreenProperties properties, UnityEditor.iOS.DeviceType device)
        {
            PlayerSettingsEditor.BuildEnumPopup <iOSLaunchScreenType>(properties.type, EditorGUIUtility.TextContent("Launch screen type"), kLaunchScreenTypeOrder, kLaunchScreenUIDescriptions);
            iOSLaunchScreenType intValue = (iOSLaunchScreenType)properties.type.intValue;

            switch (intValue)
            {
            case iOSLaunchScreenType.ImageAndBackgroundRelative:
            case iOSLaunchScreenType.ImageAndBackgroundConstant:
                if (device == UnityEditor.iOS.DeviceType.iPhone)
                {
                    SettingsUI.Texture2DField(properties.portraitImage, EditorGUIUtility.TextContent("Portrait Image | Use only advanced type textures"));
                    SettingsUI.Texture2DField(properties.landscapeImage, EditorGUIUtility.TextContent("Landscape Image | Use only advanced type textures"));
                }
                if (device == UnityEditor.iOS.DeviceType.iPad)
                {
                    SettingsUI.Texture2DField(properties.portraitAndLandscapeImage, EditorGUIUtility.TextContent("Image | Use only advanced type textures"));
                }
                EditorGUILayout.Space();
                EditorGUILayout.PropertyField(properties.backgroundColor, EditorGUIUtility.TextContent("Background Color"), new GUILayoutOption[0]);
                if (intValue == iOSLaunchScreenType.ImageAndBackgroundConstant)
                {
                    GUIContent label = null;
                    if (device == UnityEditor.iOS.DeviceType.iPad)
                    {
                        label = EditorGUIUtility.TextContent("Size in points | Vertical in both portrait and landscape");
                    }
                    else
                    {
                        label = EditorGUIUtility.TextContent("Size in points | Horizontal in portrait, vertical in landscape");
                    }
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(properties.size, label, new GUILayoutOption[0]);
                    if (EditorGUI.EndChangeCheck() && (properties.size.floatValue < 0f))
                    {
                        properties.size.floatValue = 0f;
                    }
                }
                else
                {
                    GUIContent content2 = null;
                    if (device == UnityEditor.iOS.DeviceType.iPad)
                    {
                        content2 = EditorGUIUtility.TextContent("Fill percentage | Vertical in both portrait and landscape");
                    }
                    else
                    {
                        content2 = EditorGUIUtility.TextContent("Fill percentage | Horizontal in portrait, vertical in landscape");
                    }
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(properties.fillPercentage, content2, new GUILayoutOption[0]);
                    if (EditorGUI.EndChangeCheck())
                    {
                        if (properties.fillPercentage.floatValue < 1f)
                        {
                            properties.fillPercentage.floatValue = 1f;
                        }
                        else if (properties.fillPercentage.floatValue > 100f)
                        {
                            properties.fillPercentage.floatValue = 100f;
                        }
                    }
                }
                break;

            default:
                if (intValue == iOSLaunchScreenType.CustomXib)
                {
                    PlayerSettingsEditor.BuildFileBoxButton(properties.customXibPath, LocalizationDatabase.GetLocalizedString("Custom Xib"), Application.dataPath, "xib", null);
                }
                break;
            }
        }
示例#29
0
        private static void RunAssemblyStripper(IEnumerable assemblies, string managedAssemblyFolderPath, string[] assembliesToStrip, string[] searchDirs, string monoLinkerPath, IIl2CppPlatformProvider platformProvider, RuntimeClassRegistry rcr)
        {
            BuildTargetGroup     buildTargetGroup = BuildPipeline.GetBuildTargetGroup(platformProvider.target);
            bool                 flag             = PlayerSettings.GetScriptingBackend(buildTargetGroup) == ScriptingImplementation.Mono2x;
            bool                 flag2            = rcr != null && PlayerSettings.stripEngineCode && platformProvider.supportsEngineStripping;
            IEnumerable <string> enumerable       = AssemblyStripper.Il2CppBlacklistPaths;

            if (rcr != null)
            {
                enumerable = enumerable.Concat(new string[]
                {
                    AssemblyStripper.WriteMethodsToPreserveBlackList(rcr, platformProvider.target),
                    AssemblyStripper.WriteUnityEngineBlackList(),
                    MonoAssemblyStripping.GenerateLinkXmlToPreserveDerivedTypes(managedAssemblyFolderPath, rcr)
                });
            }
            if (PlayerSettingsEditor.IsLatestApiCompatibility(PlayerSettings.GetApiCompatibilityLevel(buildTargetGroup)))
            {
                string path = Path.Combine(platformProvider.il2CppFolder, "LinkerDescriptors");
                enumerable = enumerable.Concat(Directory.GetFiles(path, "*45.xml"));
            }
            if (flag)
            {
                string path2 = Path.Combine(platformProvider.il2CppFolder, "LinkerDescriptors");
                enumerable = enumerable.Concat(Directory.GetFiles(path2, "*_mono.xml"));
                string text = Path.Combine(BuildPipeline.GetBuildToolsDirectory(platformProvider.target), "link.xml");
                if (File.Exists(text))
                {
                    enumerable = enumerable.Concat(new string[]
                    {
                        text
                    });
                }
            }
            if (!flag2)
            {
                string[] files = Directory.GetFiles(platformProvider.moduleStrippingInformationFolder, "*.xml");
                for (int i = 0; i < files.Length; i++)
                {
                    string text2 = files[i];
                    enumerable = enumerable.Concat(new string[]
                    {
                        text2
                    });
                }
            }
            string fullPath = Path.GetFullPath(Path.Combine(managedAssemblyFolderPath, "tempStrip"));
            string text4;

            while (true)
            {
                bool flag3 = false;
                if (EditorUtility.DisplayCancelableProgressBar("Building Player", "Stripping assemblies", 0f))
                {
                    break;
                }
                string text3;
                if (!AssemblyStripper.StripAssembliesTo(assembliesToStrip, searchDirs, fullPath, managedAssemblyFolderPath, out text3, out text4, monoLinkerPath, platformProvider, enumerable))
                {
                    goto Block_9;
                }
                if (platformProvider.supportsEngineStripping)
                {
                    string text5 = Path.Combine(managedAssemblyFolderPath, "ICallSummary.txt");
                    AssemblyStripper.GenerateInternalCallSummaryFile(text5, managedAssemblyFolderPath, fullPath);
                    if (flag2)
                    {
                        HashSet <UnityType> hashSet;
                        HashSet <string>    nativeModules;
                        CodeStrippingUtils.GenerateDependencies(fullPath, text5, rcr, flag2, out hashSet, out nativeModules, platformProvider);
                        flag3 = AssemblyStripper.AddWhiteListsForModules(nativeModules, ref enumerable, platformProvider.moduleStrippingInformationFolder);
                    }
                }
                if (!flag3)
                {
                    goto Block_12;
                }
            }
            throw new OperationCanceledException();
Block_9:
            throw new Exception(string.Concat(new object[]
            {
                "Error in stripping assemblies: ",
                assemblies,
                ", ",
                text4
            }));
Block_12:
            string fullPath2 = Path.GetFullPath(Path.Combine(managedAssemblyFolderPath, "tempUnstripped"));

            if (AssemblyStripper.debugUnstripped)
            {
                Directory.CreateDirectory(fullPath2);
            }
            string[] files2 = Directory.GetFiles(managedAssemblyFolderPath);
            for (int j = 0; j < files2.Length; j++)
            {
                string text6     = files2[j];
                string extension = Path.GetExtension(text6);
                if (string.Equals(extension, ".dll", StringComparison.InvariantCultureIgnoreCase) || string.Equals(extension, ".winmd", StringComparison.InvariantCultureIgnoreCase) || string.Equals(extension, ".mdb", StringComparison.InvariantCultureIgnoreCase) || string.Equals(extension, ".pdb", StringComparison.InvariantCultureIgnoreCase))
                {
                    if (AssemblyStripper.debugUnstripped)
                    {
                        File.Move(text6, Path.Combine(fullPath2, Path.GetFileName(text6)));
                    }
                    else
                    {
                        File.Delete(text6);
                    }
                }
            }
            string[] files3 = Directory.GetFiles(fullPath);
            for (int k = 0; k < files3.Length; k++)
            {
                string text7 = files3[k];
                File.Move(text7, Path.Combine(managedAssemblyFolderPath, Path.GetFileName(text7)));
            }
            Directory.Delete(fullPath);
        }
        public void IconSectionGUI(NamedBuildTarget namedBuildTarget, ISettingEditorExtension settingsExtension, int platformID, int sectionIndex)
        {
            m_SelectedPlatform = platformID;
            if (!m_Owner.BeginSettingsBox(sectionIndex, SettingsContent.iconTitle))
            {
                m_Owner.EndSettingsBox();
                return;
            }

            var platformUsesStandardIcons = true;

            if (settingsExtension != null)
            {
                platformUsesStandardIcons = settingsExtension.UsesStandardIcons();
            }

            if (platformUsesStandardIcons)
            {
                var selectedDefault = (m_SelectedPlatform < 0);
                // Set default platform variables
                BuildPlatform platform = null;
                namedBuildTarget = NamedBuildTarget.Standalone;
                var platformName = "";

                // Override if a platform is selected
                if (!selectedDefault)
                {
                    platform         = m_ValidPlatforms[m_SelectedPlatform];
                    namedBuildTarget = platform.namedBuildTarget;
                    platformName     = platform.name;
                }

                if (namedBuildTarget == NamedBuildTarget.WebGL || namedBuildTarget == NamedBuildTarget.Server)
                {
                    PlayerSettingsEditor.ShowNoSettings();
                    EditorGUILayout.Space();
                }
                else if (namedBuildTarget != NamedBuildTarget.WindowsStoreApps) // UWP does this in its editor extension
                {
                    // Both default icon and Legacy icons are serialized to the same map
                    // That's why m_LegacyPlatformIcons can be excluded in two places (other place in CommonSettings())
                    using (var vertical = new EditorGUILayout.VerticalScope())
                        using (new EditorGUI.PropertyScope(vertical.rect, GUIContent.none, m_LegacyPlatformIcons))
                        {
                            // Get icons and icon sizes for selected platform (or default)
                            var icons   = PlayerSettings.GetPlatformIconsForTargetIcons(platformName, IconKind.Any, m_AllLegacyIcons);
                            var widths  = PlayerSettings.GetIconWidthsForPlatform(platformName, IconKind.Any);
                            var heights = PlayerSettings.GetIconHeightsForPlatform(platformName, IconKind.Any);
                            var kinds   = PlayerSettings.GetIconKindsForPlatform(platformName);

                            var overrideIcons = true;

                            if (!selectedDefault)
                            {
                                // If the list of icons for this platform is not empty (and has the correct size),
                                // consider the icon overridden for this platform
                                EditorGUI.BeginChangeCheck();
                                overrideIcons = (icons.Length == widths.Length);
                                overrideIcons = GUILayout.Toggle(overrideIcons, string.Format(L10n.Tr("Override for {0}"), platform.title.text));
                                EditorGUI.BeginDisabled(!overrideIcons);
                                var changed = EditorGUI.EndChangeCheck();
                                if (changed || (!overrideIcons && icons.Length > 0))
                                {
                                    // Set the list of icons to correct length if overridden, otherwise to an empty list
                                    if (overrideIcons)
                                    {
                                        icons = new Texture2D[widths.Length];
                                    }
                                    else
                                    {
                                        icons = new Texture2D[0];
                                    }

                                    if (changed)
                                    {
                                        SetLegacyPlatformIcons(platformName, icons, IconKind.Any, ref m_AllLegacyIcons);
                                    }
                                }
                            }

                            // Show the icons for this platform (or default)
                            EditorGUI.BeginChangeCheck();
                            for (int i = 0; i < widths.Length; i++)
                            {
                                var previewWidth  = Mathf.Min(kMaxPreviewSize, widths[i]);
                                var previewHeight = (int)((float)heights[i] * previewWidth / widths[i]); // take into account the aspect ratio

                                if (namedBuildTarget == NamedBuildTarget.iOS)
                                {
                                    // Spotlight icons begin with 120 but there are two in the list.
                                    // So check if the next one is 80.
                                    if (kinds[i] == IconKind.Spotlight && kinds[i - 1] != IconKind.Spotlight)
                                    {
                                        var labelRect = GUILayoutUtility.GetRect(EditorGUIUtility.labelWidth, 20);
                                        GUI.Label(new Rect(labelRect.x, labelRect.y, EditorGUIUtility.labelWidth, 20), "Spotlight icons", EditorStyles.boldLabel);
                                    }

                                    if (kinds[i] == IconKind.Settings && kinds[i - 1] != IconKind.Settings)
                                    {
                                        var labelRect = GUILayoutUtility.GetRect(EditorGUIUtility.labelWidth, 20);
                                        GUI.Label(new Rect(labelRect.x, labelRect.y, EditorGUIUtility.labelWidth, 20), "Settings icons", EditorStyles.boldLabel);
                                    }

                                    if (kinds[i] == IconKind.Notification && kinds[i - 1] != IconKind.Notification)
                                    {
                                        var labelRect = GUILayoutUtility.GetRect(EditorGUIUtility.labelWidth, 20);
                                        GUI.Label(new Rect(labelRect.x, labelRect.y, EditorGUIUtility.labelWidth, 20), "Notification icons", EditorStyles.boldLabel);
                                    }

                                    if (kinds[i] == IconKind.Store && kinds[i - 1] != IconKind.Store)
                                    {
                                        var labelRect = GUILayoutUtility.GetRect(EditorGUIUtility.labelWidth, 20);
                                        GUI.Label(new Rect(labelRect.x, labelRect.y, EditorGUIUtility.labelWidth, 20), "App Store icons", EditorStyles.boldLabel);
                                    }
                                }

                                var rect  = GUILayoutUtility.GetRect(kSlotSize, Mathf.Max(kSlotSize, previewHeight) + kIconSpacing);
                                var width = Mathf.Min(rect.width, EditorGUIUtility.labelWidth + 4 + kSlotSize + kIconSpacing + kMaxPreviewSize);

                                // Label
                                var label = widths[i] + "x" + heights[i];
                                GUI.Label(new Rect(rect.x, rect.y, width - kMaxPreviewSize - kSlotSize - 2 * kIconSpacing, 20), label);

                                // Texture slot
                                if (overrideIcons)
                                {
                                    var slotWidth  = kSlotSize;
                                    var slotHeight = (int)((float)heights[i] / widths[i] * kSlotSize); // take into account the aspect ratio
                                    icons[i] = (Texture2D)EditorGUI.ObjectField(
                                        new Rect(rect.x + width - kMaxPreviewSize - kSlotSize - kIconSpacing, rect.y, slotWidth, slotHeight),
                                        icons[i],
                                        typeof(Texture2D),
                                        false);
                                }

                                // Preview
                                var previewRect = new Rect(rect.x + width - kMaxPreviewSize, rect.y, previewWidth, previewHeight);
                                var closestIcon = PlayerSettings.GetPlatformIconForSizeForTargetIcons(platformName, widths[i], heights[i], kinds[i], m_AllLegacyIcons);
                                if (closestIcon != null)
                                {
                                    GUI.DrawTexture(previewRect, closestIcon);
                                }
                                else
                                {
                                    GUI.Box(previewRect, "");
                                }
                            }

                            // Save changes
                            if (EditorGUI.EndChangeCheck())
                            {
                                Undo.RecordObjects(m_Owner.targets, SettingsContent.undoChangedIconString);
                                SetLegacyPlatformIcons(platformName, icons, IconKind.Any, ref m_AllLegacyIcons);
                            }

                            EditorGUI.EndDisabled();

                            if (namedBuildTarget == NamedBuildTarget.iOS || namedBuildTarget == NamedBuildTarget.tvOS)
                            {
                                EditorGUILayout.PropertyField(m_UIPrerenderedIcon, SettingsContent.UIPrerenderedIcon);
                                EditorGUILayout.Space();
                            }
                        }
                }
            }

            if (settingsExtension != null)
            {
                settingsExtension.IconSectionGUI();
            }

            m_Owner.EndSettingsBox();
        }
 public PlayerSettingsIconsEditor(PlayerSettingsEditor owner)
 {
     m_Owner = owner;
 }
 public virtual void OnEnable(PlayerSettingsEditor settingsEditor)
 {
 }
示例#33
0
        public virtual void OnEnable(PlayerSettingsEditor settingsEditor)
        {
            m_playerSettingsEditor = settingsEditor;

            m_MTRendering = playerSettingsEditor.FindPropertyAssert("m_MTRendering");
        }
示例#34
0
 public PlayerSettingsSplashScreenEditor(PlayerSettingsEditor owner)
 {
     m_Owner = owner;
 }
 public override void OnEnable(PlayerSettingsEditor settingsEditor)
 {
     this.m_SettingsEditor = settingsEditor;
     this.m_GUIDefaultIsFullScreen = EditorGUIUtility.TextContent("Default Is Full Screen*");
     this.m_CompanyName = settingsEditor.FindPropertyAssert("companyName");
     this.m_ProductName = settingsEditor.FindPropertyAssert("productName");
     this.m_DefaultIsFullScreen = settingsEditor.FindPropertyAssert("defaultIsFullScreen");
     this.m_RunInBackground = settingsEditor.FindPropertyAssert("runInBackground");
     this.m_MetroPackageName = settingsEditor.FindPropertyAssert("metroPackageName");
     this.m_MetroPackageName.stringValue = Utility.TryValidatePackageName(this.m_MetroPackageName.stringValue);
     this.m_MetroPackageVersion = settingsEditor.FindPropertyAssert("metroPackageVersion");
     this.m_MetroPackageVersion.stringValue = PlayerSettings.WSA.ValidatePackageVersion(this.m_MetroPackageVersion.stringValue);
     this.m_MetroApplicationDescription = settingsEditor.FindPropertyAssert("metroApplicationDescription");
     this.m_MetroApplicationDescription.stringValue = this.ValidateMetroApplicationDescription(this.m_MetroApplicationDescription.stringValue);
     this.m_MetroTileShortName = settingsEditor.FindPropertyAssert("metroTileShortName");
     this.m_MetroTileShortName.stringValue = this.ValidateMetroTileShortName(this.m_MetroTileShortName.stringValue);
     this.m_MetroTileBackgroundColor = settingsEditor.FindPropertyAssert("metroTileBackgroundColor");
     this.m_MetroFTAName = settingsEditor.FindPropertyAssert("metroFTAName");
     this.m_MetroFTAFileTypes = settingsEditor.FindPropertyAssert("metroFTAFileTypes");
     this.m_MetroProtocolName = settingsEditor.FindPropertyAssert("metroProtocolName");
     PlayerSettings.WSAImageScale[] scales = new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale._80 };
     PlayerSettings.WSAImageScale[] scaleArray2 = new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale._100 };
     PlayerSettings.WSAImageScale[] scaleArray3 = new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale._100 };
     this.m_PackageLogos = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.PackageLogo, new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale._100 }, "Scale {0}% ({1}x{2} pixels)|Specifies the image that appears on the Store description page for the product.", new int[] { 50, 0x3f, 70, 0x4b, 90, 100, 120, 200 });
     MetroScaledImage[] sourceArray = CreateScaledSquareImages(PlayerSettings.WSAImageType.StoreTileSmallLogo, scales, "Scale {0}% ({1}x{2} pixels)|Specifies the image that is shown when viewing all installed applications.", new int[] { 0x18, 30, 0x2a, 0x36 });
     MetroScaledImage[] imageArray2 = CreateScaledSquareImages(PlayerSettings.WSAImageType.StoreTileSmallLogo, new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale.Target16 }, "Target size {0} ({1}x{2} pixels)|Specifies the image that is shown when viewing all installed applications.", new int[] { 0x10, 0x20, 0x30, 0x100 });
     MetroScaledImage[] destinationArray = new MetroScaledImage[sourceArray.Length + imageArray2.Length];
     Array.Copy(sourceArray, destinationArray, sourceArray.Length);
     Array.Copy(imageArray2, 0, destinationArray, sourceArray.Length, imageArray2.Length);
     this.m_StoreSmallLogos = new MetroScaledImageGroup(destinationArray);
     this.m_MediumTiles = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.StoreTileLogo, scales, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile in Windows.", new int[] { 120, 150, 210, 270 });
     this.m_WideTiles = CreateScaledImageGroup(PlayerSettings.WSAImageType.StoreTileWideLogo, scales, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's wide tile in Windows if supported.", new int[] { 0xf8, 310, 0x1b2, 0x22e }, new int[] { 120, 150, 210, 270 });
     this.m_SmallTiles = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.StoreSmallTile, scales, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's small tile in Windows if supported.", new int[] { 0x38, 70, 0x62, 0x7e });
     this.m_LargeTiles = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.StoreLargeTile, scales, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's large tile in Windows if supported.", new int[] { 0xf8, 310, 0x1b2, 0x22e });
     this.m_PhoneAppIcons = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.PhoneAppIcon, scaleArray2, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's small tile.", new int[] { 0x2c, 0x3e, 0x6a });
     this.m_PhoneSmallTiles = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.PhoneSmallTile, scaleArray2, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's small tile", new int[] { 0x47, 0x63, 170 });
     this.m_PhoneMediumTiles = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.PhoneMediumTile, scaleArray2, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 150, 210, 360 });
     this.m_PhoneWideTiles = CreateScaledImageGroup(PlayerSettings.WSAImageType.PhoneWideTile, scaleArray2, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's wide tile.", new int[] { 310, 0x1b2, 0x2e8 }, new int[] { 150, 210, 360 });
     MetroScaledImage[] imageArray4 = CreateScaledSquareImages(PlayerSettings.WSAImageType.UWPSquare44x44Logo, scaleArray3, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 0x2c, 0x37, 0x42, 0x58, 0xb0 });
     MetroScaledImage[] imageArray5 = CreateScaledSquareImages(PlayerSettings.WSAImageType.UWPSquare44x44Logo, new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale.Target16 }, "Target size {0} ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 0x10, 0x18, 0x30, 0x100 });
     MetroScaledImage[] imageArray6 = new MetroScaledImage[imageArray4.Length + imageArray5.Length];
     Array.Copy(imageArray4, imageArray6, imageArray4.Length);
     Array.Copy(imageArray5, 0, imageArray6, imageArray4.Length, imageArray5.Length);
     this.m_UWPSquare44x44Logos = new MetroScaledImageGroup(imageArray6);
     this.m_UWPSquare71x71Logos = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.UWPSquare71x71Logo, scaleArray3, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 0x47, 0x59, 0x6b, 0x8e, 0x11c });
     this.m_UWPSquare150x150Logos = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.UWPSquare150x150Logo, scaleArray3, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 150, 0xbc, 0xe1, 300, 600 });
     this.m_UWPSquare310x310Logos = CreateScaledSquareImageGroup(PlayerSettings.WSAImageType.UWPSquare310x310Logo, scaleArray3, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 310, 0x184, 0x1d1, 620, 0x4d8 });
     this.m_UWPWide310x150Logos = CreateScaledImageGroup(PlayerSettings.WSAImageType.UWPWide310x150Logo, scaleArray3, "Scale {0}% ({1}x{2} pixels)|Specifies the image to display on the app's tile.", new int[] { 310, 0x184, 0x1d1, 620, 0x4d8 }, new int[] { 150, 0xbc, 0xe1, 300, 600 });
     this.m_WindowsSplashScreens = CreateScaledImages(PlayerSettings.WSAImageType.SplashScreenImage, new PlayerSettings.WSAImageScale[] { PlayerSettings.WSAImageScale._100 }, "Scale {0}% ({1}x{2} pixels)|Sets the foreground image for the app's splash screen.", new int[] { 620, 0x307, 0x364, 930, 0x45c, 0x4d8, 0x9b0 }, new int[] { 300, 0x177, 420, 450, 540, 600, 0x4b0 });
     this.m_PhoneSplashScreens = CreateScaledImages(PlayerSettings.WSAImageType.PhoneSplashScreen, scaleArray2, "Scale {0}% ({1}x{2} pixels)|Sets the foreground image for the app's splash screen.", new int[] { 480, 0x2a0, 0x480 }, new int[] { 800, 0x460, 0x780 });
     this.m_HolographicSplashScreen = settingsEditor.FindPropertyAssert("m_VirtualRealitySplashScreen");
     this.m_HolographicPauseOnTrackingLoss = settingsEditor.FindPropertyAssert("m_HolographicPauseOnTrackingLoss");
     this.m_HolographicTrackingLossScreen = settingsEditor.FindPropertyAssert("m_HolographicTrackingLossScreen");
 }