private void Awake()
        {
            collider = GetComponent <Collider2D>();

            if (onTriggerEnter == null)
            {
                onTriggerEnter = new Trigger2DEvent();
            }

            if (onTriggerExit == null)
            {
                onTriggerExit = new Trigger2DEvent();
            }

            if (onTriggerStay == null)
            {
                onTriggerStay = new Trigger2DEvent();
            }

            if (onCollisionEnter == null)
            {
                onCollisionEnter = new Collision2DEvent();
            }

            if (onCollisionExit == null)
            {
                onCollisionExit = new Collision2DEvent();
            }

            if (onCollisionStay == null)
            {
                onCollisionStay = new Collision2DEvent();
            }
        }
    public ComponentSearchFilter <T> CreateFilter <T>()
    {
        ComponentSearchFilter <T> filter = new ComponentSearchFilter <T>();

        filter.Init();
        OnTriggerEnter2DEvent += filter.OnTriggerEnter2D;
        OnTriggerExit2DEvent  += filter.OnTriggerExit2D;
        OnTriggerStay2DEvent  += filter.OnTriggerStay2D;

        return(filter);
    }
    private void OnEnable()
    {
        source    = (Trigger2DEvent)target;
        sourceRef = serializedObject;

        buttonDownToTrigger = sourceRef.FindProperty("buttonDownToTrigger");
        button = sourceRef.FindProperty("button");

        mask             = sourceRef.FindProperty("mask");
        triggerTag       = sourceRef.FindProperty("triggerTag");
        delayTriggerTime = sourceRef.FindProperty("delayTriggerTime");
        useRepeatDelay   = sourceRef.FindProperty("useRepeatDelay");
        repeatDelay      = sourceRef.FindProperty("repeatDelay");

        //events
        trigger2DEnterEvents = sourceRef.FindProperty("trigger2DEnterEvents");
        trigger2DExitEvents  = sourceRef.FindProperty("trigger2DExitEvents");
        trigger2DStayEvents  = sourceRef.FindProperty("trigger2DStayEvents");
    }