Merge pull request #14 from AnnulusGames/fix-parameterless-button

Fix: Exception occurs on button of argumentless method whose return value is not void
This commit is contained in:
Annulus Games 2024-01-16 18:10:05 +09:00 committed by GitHub
commit 725a61f290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ namespace Alchemy.Editor.Elements
// Create parameterless button
if (parameters.Length == 0)
{
button = new Button((Action)methodInfo.CreateDelegate(typeof(Action), target))
button = new Button(() => methodInfo.Invoke(target, null))
{
text = methodInfo.Name
};