1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Unity] InspectorからProjectSettingsを開く

Last updated at Posted at 2024-12-18

例えばInspectorにProjectSettings/Graphicsを開くボタンを追加する場合、

image.png

こんな感じになります。

using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif

#if UNITY_EDITOR
[CustomEditor(typeof(Foo))]
public class CoreUrpChangeEditor : Editor
{
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        if (GUILayout.Button("Open ProjectSettings/Graphics"))
        {
            SettingsService.OpenProjectSettings("Project/Graphics");
        }
    }
}
#endif

public class Foo : MonoBehaviour
{
    void Start()
    {
    }
    void Update()
    {
    }
}

SettingsService.OpenProjectSettings

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?