Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEditor;
- using UnityEngine;
- namespace BitStrap
- {
- /// <summary>
- /// Custom editor for all MonoBehaviour scripts in order to draw buttons for all button attributes (<see cref="ButtonAttribute"/>).
- /// </summary>
- [CustomEditor( typeof( MonoBehaviour ), true, isFallback = true )]
- [CanEditMultipleObjects]
- public class BehaviourButtonsEditor : Editor
- {
- private ButtonAttributeHelper helper = new ButtonAttributeHelper();
- public override void OnInspectorGUI()
- {
- base.OnInspectorGUI();
- helper.DrawButtons();
- }
- private void OnEnable()
- {
- helper.Init( target );
- }
- }
- }
Add Comment
Please, Sign In to add comment