Example #1
0
 static void LoadData()
 {
     ssWidth           = EditorPrefs.GetInt("screenshotwidth", ssWidth);
     ssHeight          = EditorPrefs.GetInt("screenshotheight", ssHeight);
     openOnFinish      = EditorPrefs.GetBool("screenshotopenonfinish", openOnFinish);
     antialiasingLevel = (AntiAliasingLevel)EditorPrefs.GetInt("screenshotantialiasinglevel", (int)antialiasingLevel);
     anisotropicLevel  = (AntiAliasingLevel)EditorPrefs.GetInt("screenshotanisolevel", (int)anisotropicLevel);
 }
Example #2
0
    private void OnGUI()
    {
        EditorGUILayout.LabelField("Config Settings", EditorStyles.boldLabel);
        ssWidth  = EditorGUILayout.IntField("Screenshot Width", ssWidth);
        ssHeight = EditorGUILayout.IntField("Screenshot Height", ssHeight);

        if (GUILayout.Button("Set to current scene view resolution."))
        {
            if (SceneView.GetAllSceneCameras().Length < 0)
            {
                Debug.Log("No scene view found.");
            }
            ssWidth  = (int)SceneView.GetAllSceneCameras()[0].activeTexture.width;
            ssHeight = (int)SceneView.GetAllSceneCameras()[0].activeTexture.height;
        }

        if (GUILayout.Button("Set to 2x current scene view resolution."))
        {
            if (SceneView.GetAllSceneCameras().Length < 0)
            {
                Debug.Log("No scene view found.");
            }
            ssWidth  = (int)SceneView.GetAllSceneCameras()[0].activeTexture.width * 2;
            ssHeight = (int)SceneView.GetAllSceneCameras()[0].activeTexture.height * 2;
        }

        if (GUILayout.Button("Set to 4x current scene view resolution."))
        {
            if (SceneView.GetAllSceneCameras().Length < 0)
            {
                Debug.Log("No scene view found.");
            }
            ssWidth  = (int)SceneView.GetAllSceneCameras()[0].activeTexture.width * 4;
            ssHeight = (int)SceneView.GetAllSceneCameras()[0].activeTexture.height * 4;
        }

        if (GUILayout.Button("Set to 8x current scene view resolution."))
        {
            if (SceneView.GetAllSceneCameras().Length < 0)
            {
                Debug.Log("No scene view found.");
            }
            ssWidth  = (int)SceneView.GetAllSceneCameras()[0].activeTexture.width * 8;
            ssHeight = (int)SceneView.GetAllSceneCameras()[0].activeTexture.height * 8;
        }

        openOnFinish = EditorGUILayout.Toggle("Open on capture?", openOnFinish);


        EditorGUILayout.Separator();
        EditorGUILayout.LabelField("Quality Settings", EditorStyles.boldLabel);
        antialiasingLevel = (AntiAliasingLevel)EditorGUILayout.EnumPopup("Anti Aliasing Level", antialiasingLevel as System.Enum);
        anisotropicLevel  = (AntiAliasingLevel)EditorGUILayout.EnumPopup("Anisotropic Filtering Level", anisotropicLevel as System.Enum);

        EditorGUILayout.Separator();
        if (GUILayout.Button("Take Screenshot"))
        {
            SaveInfo();
            TakeQuickScreenshot();
        }
    }