Пример #1
0
    private void AspectGUI()
    {
        EZ_Style.Header("Aspect", false, false);

        if (useBackground)
        {
            backgroundAspect = (EzSS_AspectHelper.Aspects)EditorGUILayout.EnumPopup("Background Aspect:", backgroundAspect);
        }

        if (useMockup)
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Mockup Aspect:", GUILayout.Width(148));
            EZ_Style.BeginHorizontalRectBox();
            EditorGUILayout.LabelField(currentAspectName);
            EZ_Style.EndHorizontalRectBox();
            EditorGUILayout.EndHorizontal();
            VerifyAspect(mockupAspect);
        }
        else
        {
            screenshotAspect = (EzSS_AspectHelper.Aspects)EditorGUILayout.EnumPopup("Screenshot Aspect:", screenshotAspect);
            VerifyAspect(screenshotAspect);
        }

        EZ_Style.Footer();
    }
Пример #2
0
    private string saveAtPath     = ""; // Save the path that the picture will be saved

    private void BasicSetupGUI()
    {
        // Camera
        EZ_Style.Header("Camera", false, false);
        cameraType = (CameraType)EditorGUILayout.EnumPopup("Camera Type:", cameraType);
        // Camera selection for each type
        if (cameraType == CameraType.single)
        {
            camera = EditorGUILayout.ObjectField("Camera:", camera, typeof(Camera), true, null) as Camera;
        }
        else
        {
            EditorGUILayout.HelpBox(EzSS_Messages.INFO_03, MessageType.Info);
            target           = this;
            serializedObject = new SerializedObject(target);
            property         = serializedObject.FindProperty("cameras");
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(property, true);
            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();
            }
        }
        EZ_Style.Footer();

        // Encode type
        EZ_Style.Header("Encode", false, false);
        encodeType = (EncodeType)EditorGUILayout.EnumPopup("Encode Type:", encodeType);
        if (encodeType == EncodeType.JPG)
        {
            jpgQuality = EditorGUILayout.IntSlider("Quality", jpgQuality, 1, 100);
        }
        EZ_Style.Footer();

        // Name prefix and configuration
        EZ_Style.Header("Name", false, false);
        fileNamePrefix = EditorGUILayout.TextField("Screenshot Prefix:", fileNamePrefix);
        useDate        = EditorGUILayout.Toggle("Use Date:", useDate);
        useTime        = EditorGUILayout.Toggle("Use Time:", useTime);

        // Cofigurates the name and display it
        finalFileName = fileNamePrefix;
        if (useDate)
        {
            finalFileName = finalFileName + "_" + DateTime.Now.ToString("yy-MMM-dd");
        }
        if (useTime)
        {
            finalFileName = finalFileName + "-" + DateTime.Now.ToString("HH-mm-ss");
        }
        EditorGUILayout.LabelField("File Name:");
        EZ_Style.BeginHorizontalRectBox();
        EditorGUILayout.LabelField(finalFileName);
        EZ_Style.EndHorizontalRectBox();
        EZ_Style.Footer();

        // Save at
        EZ_Style.Header("Save at Destination", false, false);
        // Set the path to save the image
        EditorGUILayout.LabelField("Save at:");
        EZ_Style.rect = EditorGUILayout.BeginVertical();
        GUI.Box(EZ_Style.rect, GUIContent.none);
        if (string.IsNullOrEmpty(saveAtPath))
        {
            EditorGUILayout.LabelField("Browse location using the button bellow");
        }
        else
        {
            EditorGUILayout.LabelField(saveAtPath);
        }
        EditorGUILayout.EndVertical();

        // Path buttons
        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Browse"))
        {
            saveAtPath = EditorUtility.SaveFolderPanel("Save At", saveAtPath, Application.dataPath);
        }
        if (GUILayout.Button("Open Folder"))
        {
            Application.OpenURL("file://" + saveAtPath);
        }
        EditorGUILayout.EndHorizontal();
        EZ_Style.Footer();
    }