Skip to content

Instantly share code, notes, and snippets.

@aomnes
Created January 23, 2019 13:09
Show Gist options
  • Save aomnes/0ffd7f2caea5dc6d297ac360dcbdc265 to your computer and use it in GitHub Desktop.
Save aomnes/0ffd7f2caea5dc6d297ac360dcbdc265 to your computer and use it in GitHub Desktop.
#if UNITY_EDITOR
//-------------------------------------------------------------------------
[UnityEditor.CustomEditor( typeof( UIElement ) )]
public class UIElementEditor : UnityEditor.Editor
{
//-------------------------------------------------
// Custom Inspector GUI allows us to click from within the UI
//-------------------------------------------------
public override void OnInspectorGUI()
{
DrawDefaultInspector();
UIElement uiElement = (UIElement)target;
if ( GUILayout.Button( "Click" ) )
{
InputModule.instance.Submit( uiElement.gameObject );
}
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment