Guest User

Untitled

a guest
Dec 7th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using UnityEditor;
  2. using UnityEngine;
  3.  
  4. namespace BitStrap
  5. {
  6. /// <summary>
  7. /// Custom editor for all MonoBehaviour scripts in order to draw buttons for all button attributes (<see cref="ButtonAttribute"/>).
  8. /// </summary>
  9. [CustomEditor( typeof( MonoBehaviour ), true, isFallback = true )]
  10. [CanEditMultipleObjects]
  11. public class BehaviourButtonsEditor : Editor
  12. {
  13. private ButtonAttributeHelper helper = new ButtonAttributeHelper();
  14.  
  15. public override void OnInspectorGUI()
  16. {
  17. base.OnInspectorGUI();
  18. helper.DrawButtons();
  19. }
  20.  
  21. private void OnEnable()
  22. {
  23. helper.Init( target );
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment