Last active
February 29, 2020 11:22
-
-
Save meronmks/9f4535cb6f923cbe3417e53decc449dc to your computer and use it in GitHub Desktop.
InspectorをLockして複製して・・・ってのが面倒だったので適当に作ったやつ (もっといい感じのがあったのでパク・・リスペクト http://tsubakit1.hateblo.jp/entry/2016/10/10/234420)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using System.Linq; | |
using System.Reflection; | |
public class ShowLockInspector { | |
[MenuItem("GameObject/ShowLockInspector %l", false, 30)] | |
private static void ShowInspector(){ | |
var inspectorType = typeof(Editor).Assembly.GetType("UnityEditor.InspectorWindow"); | |
var inspectorInstance = ScriptableObject.CreateInstance(inspectorType) as EditorWindow; | |
inspectorInstance.ShowUtility(); | |
var isLocked = inspectorType.GetProperty("isLocked", BindingFlags.Instance | BindingFlags.Public); | |
isLocked.GetSetMethod().Invoke(inspectorInstance, new object[] { true }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment