OK, I condensed this out of PlayMakerWelcomeWindow.cs, which checks the version. It works, but it seems absurdly complicated. Does anyone know if there's a better way to do this?
private static int GetPlayMakerVersion()
{
Type versionInfo = null;
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
versionInfo = assembly.GetType("HutongGames.PlayMakerEditor.VersionInfo");
if (versionInfo != null)
break;
}
if (versionInfo != null)
{
var currentVersion = (string)versionInfo.GetMethod("GetAssemblyInformationalVersion").Invoke(null, null);
if (currentVersion != null)
return int.Parse(currentVersion.Substring(0, currentVersion.LastIndexOf('.')).Substring(0, 3).Replace(".", ""));
else
return -1;
}
else
return -1;
}