- Home /
Open settings dialog like Player, Quality, Render Settings via C#.
In the Editor I'm trying to trigger opening the dialogs mentioned above via C#. This is opposed to using the menus.
Any one have a way to do this?
Answer by Landern · May 26, 2015 at 01:00 PM
Use EditorApplication.ExecuteMenuItem and use the path indicated in the documentation. Remember, if it's been docked previously, then it will bring it up in the inspector. You can not use Editor methods in the final build of your project, only when in the editor.
In the example below the OnClick method was wired up to a 4.6+ ui button to execute upon clickingl
example:
using UnityEngine;
using UnityEditor;
using System.Collections;
public class ExecuteSomeMenuItem : MonoBehaviour {
[ExecuteInEditMode()]
public void OnClick (string someValueIfNeeded) {
EditorApplication.ExecuteMenuItem ("Edit/Project Settings/Quality");
}
}
Your answer
Follow this Question
Related Questions
How to display a list of methods and allow a choice of one of them 1 Answer
Cogwheel icon in inspector 2 Answers
EditorSceneManger.SetSceneDirty Problem 1 Answer
Tanks 3D: The tanks index does not show up in the Inspector/Game Manager script 2 Answers
Android App behaviour is different from Unity version 0 Answers