Example #1
0
        protected Button(MethodInfo method, ButtonAttribute buttonAttribute)
        {
            DisplayName = string.IsNullOrEmpty(buttonAttribute.Name)
                ? ObjectNames.NicifyVariableName(method.Name)
                : buttonAttribute.Name;

            Method = method;

            _spacing = buttonAttribute.Spacing;

            bool inAppropriateMode = EditorApplication.isPlaying
                ? buttonAttribute.Mode == ButtonMode.EnabledInPlayMode
                : buttonAttribute.Mode == ButtonMode.DisabledInPlayMode;

            _disabled = !(buttonAttribute.Mode == ButtonMode.AlwaysEnabled || inAppropriateMode);
        }
 public ButtonAttribute(ButtonSpacing spacing)
 {
     this.spacing = spacing;
 }
 public ButtonAttribute(string name, ButtonMode mode, ButtonSpacing spacing)
 {
     this.name    = name;
     this.mode    = mode;
     this.spacing = spacing;
 }
Example #4
0
 public EasyButtonAttribute(string name, ButtonSpacing spacing)
 {
     this.name    = name;
     this.spacing = spacing;
 }