public void MergeEventFunction(UnityApiEventFunction newFunction, Version apiVersion)
{
UpdateSupportedVersion(apiVersion);
var newFunctionSig = newFunction.ToString();
foreach (var eventFunction in myEventFunctions)
{
// If the signature matches, we've already got it, just
// make sure it's up to date (newer docs take precedence
// for e.g. param names, description, etc)
if (eventFunction.ToString() == newFunctionSig)
{
eventFunction.Update(newFunction, apiVersion);
return;
}
}
// Not a match. We either haven't found this function before,
// or a parameter or return type is different
myEventFunctions.Add(newFunction);
}