playMaker

Author Topic: Stackable / Duplicate Custom Editor Attributes  (Read 1575 times)

Digitom

  • Junior Playmaker
  • **
  • Posts: 61
Stackable / Duplicate Custom Editor Attributes
« on: March 11, 2020, 03:52:30 PM »
In the normal unity editor you are permitted to stack custom editor attributes so it applies to multiple editor scripts.

Any way we can do this? Would save TONS of time when making custom editors. Or maybe I am missing something? Do I HAVE to make a custom editor for every script that inherits a fancy base class function?

Code: [Select]
namespace HutongGames.PlayMakerEditor
{
    [CustomActionEditor(typeof(InputSystemReadVector2Value))]
    [CustomActionEditor(typeof(InputSystemReadBoolValue))]
    [CustomActionEditor(typeof(InputSystemTriggeredValue))]
    public class InputSystemTriggeredValueEditor : InputSystemBaseEditor
    {
        public override bool OnGUI()
        {
            base.OnGUI();
            EditField("storeValue");

            return GUI.changed;
        }
    }
}

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Stackable / Duplicate Custom Editor Attributes
« Reply #1 on: March 14, 2020, 03:43:32 AM »
Hi,

 uhm, don't think it is permitted, did not know that.

 usually, to achieve this, I create a base class that my editor inherit and it achieves the same pretty much. check out  the cinemachine custom actions for example.

Bye,

 Jean