How to use script to enable the "Selection Wire" checkbox from gizmos menu
I want to use the editor script control this option.
But I can't find any articles about this topic.
屏幕快照-2018-11-01-上午12821.png
(45.0 kB)
Comment
Best Answer
Answer by gzlock · Nov 01, 2018 at 09:25 AM
Solved
private static void SelectionWire(bool isEnable)
{
var asm = Assembly.GetAssembly(typeof(Editor));
var type = asm.GetType("UnityEditor.AnnotationUtility");
if (type == null)
{
return;
}
var setSelectionWire = type.GetProperty("showSelectionWire", BindingFlags.Static | BindingFlags.NonPublic);
if (setSelectionWire == null)
return;
setSelectionWire.SetValue(null, isEnable, null);
}