So I have an event signature like this:

```
public event EventHandler<OnColorChangedEventArgs> onColorChanged;

public class OnColorChangedEventArgs : EventArgs
{
    public Color color;
}

```

and a method I want to subscribe to the event like this:

```
private void UpdateColor(object sender, RayCaster.OnColorChangedEventArgs eventArgs, PositionOnLine positionOnLine)
{
    if (positionOnLine == PositionOnLine.Start)
    {
        _lineRenderer.startColor = eventArgs.color;
    }
    else
    {
        _lineRenderer.endColor = eventArgs.color;
    }
}

```

As you can see, the subscribing method requires more parameters than the event invocation passes. Those extra parameters should be passed from a method I call to subscribe to the event in the first place, like this:

```
public void AddPoint(RayCaster rayCaster, PositionOnLine positionOnLine, Transform transform)
{
    //some irrelevant code

    rayCaster.onColorChanged += (sender, args) => UpdateColor(sender, args, positionOnLine);
}

```

This works as I want it to. However, as far as I understand it, this is an anonymous delegate.
And I need to unsubscribe from this method at some point. I can't seem to find a way to turn this into a non-anonymous delegate. I'm pretty new to delegates and events, so please point out any code smells. Thank you.