Created
January 23, 2019 13:09
-
-
Save aomnes/0ffd7f2caea5dc6d297ac360dcbdc265 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#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