Skip to content

Instantly share code, notes, and snippets.

@meronmks
Last active February 29, 2020 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meronmks/9f4535cb6f923cbe3417e53decc449dc to your computer and use it in GitHub Desktop.
Save meronmks/9f4535cb6f923cbe3417e53decc449dc to your computer and use it in GitHub Desktop.
InspectorをLockして複製して・・・ってのが面倒だったので適当に作ったやつ (もっといい感じのがあったのでパク・・リスペクト http://tsubakit1.hateblo.jp/entry/2016/10/10/234420
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