Esempio n. 1
0
    void OnGUI()
    {
        if (_ssh == null)
        {
            EditorWindow sshWindow = EditorWindow.GetWindow(typeof(ScreenshotHelperBuildSaveLocationWindow));
            if (sshWindow != null)
            {
                sshWindow.Close();
            }
            return;
        }

        EditorGUILayout.HelpBox("Set the location to save screenshots when using a build. The exact location will change based on the machine the build is running. For example the user name will be corrected.", MessageType.None);


        string example = _ssh.BuildSaveLocation();

        EditorGUILayout.HelpBox("Location example: " + example, MessageType.None);

        _ssh.buildSavePathRoot  = (System.Environment.SpecialFolder)EditorGUILayout.EnumPopup("Root: ", _ssh.buildSavePathRoot);
        _ssh.buildSavePathExtra = EditorGUILayout.TextField("Extra directory: ", _ssh.buildSavePathExtra);
    }
Esempio n. 2
0
    public override void OnInspectorGUI()
    {
        ScreenshotHelper myTarget = (ScreenshotHelper)target;

        RenderTextureToggleAndWarning(myTarget);

        myTarget.SSHTextureFormat = (ScreenshotHelper.tSSHTextureFormat)EditorGUILayout.EnumPopup("Texture Format", myTarget.SSHTextureFormat);

        CameraSolidColorTransparencyWarning(myTarget);

        MakeSpace(1);

        EditorGUI.BeginChangeCheck();

        myTarget.keyToHold  = (KeyCode)EditorGUILayout.EnumPopup("Key to hold:", myTarget.keyToHold);
        myTarget.keyToPress = (KeyCode)EditorGUILayout.EnumPopup("Key to press:", myTarget.keyToPress);
        if (myTarget.keyToPress == KeyCode.None)
        {
            EditorGUILayout.HelpBox("If you don't assign a key to press then you will not be able to take screenshots with a key press.", MessageType.Warning, true);
        }

        MakeSpace(1);
        myTarget.orientation = (SSHOrientation)EditorGUILayout.EnumPopup("Orientation", myTarget.orientation);

        if (EditorGUI.EndChangeCheck())
        {
            myTarget.UpdateDimensions();
        }

        //sizes header
        MakeSpace(1);
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Screen Shot Sizes", EditorStyles.boldLabel);
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.HelpBox("Expand each to edit", MessageType.None, true);
        EditorGUILayout.EndHorizontal();
        MakeSpace(1);

        SetSizesSubs(myTarget);

        //add a size
        EditorGUILayout.Space();
        if (GUILayout.Button("Add a size"))
        {
            myTarget.shotInfo.Add(new ShotSize(0, 0));
        }


        MakeSpace(3);

        EditorGUILayout.HelpBox("In-editor Save location: " + myTarget.savePath, MessageType.None);
        if (GUILayout.Button("Set in-editor save location"))
        {
            myTarget.savePath = GameViewUtils.SelectFileFolder(Directory.GetCurrentDirectory(), "");
            PathChange(myTarget.savePath);
        }

        MakeSpace(1);

        EditorGUILayout.HelpBox("Build Save location example: " + myTarget.BuildSaveLocation(), MessageType.None);
        if (GUILayout.Button("Set build save location"))
        {
            ScreenshotHelperBuildSaveLocationWindow.ShowWindow(myTarget);
        }


        MakeSpace(2);

        if (GUILayout.Button("Save Presets"))
        {
            string newConfig = SavePreset(myTarget);
            if (!string.IsNullOrEmpty(newConfig))
            {
                myTarget.configFile = newConfig;
            }
        }

        LoadPresetsButton(myTarget);

        MakeSpace(2);

        if (GUILayout.Button("Load Defaults"))
        {
            myTarget.SetDefaults();
            myTarget.configFile = "";
        }

        MakeSpace(1);
    }