示例#1
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;
            }
        }