mirror of
https://github.com/AnnulusGames/Alchemy.git
synced 2025-01-22 08:18:51 -05:00
Merge pull request #27 from AnnulusGames/fix-onvaluechanged
Fix: OnValueChanged method with parameters doesn't work
This commit is contained in:
commit
6800d3a455
@ -316,13 +316,13 @@ namespace Alchemy.Editor.Drawers
|
||||
|
||||
var methods = ReflectionHelper.GetAllMethodsIncludingBaseNonPublic(Target.GetType())
|
||||
.Where(x => x.Name == methodName);
|
||||
|
||||
|
||||
foreach (var methodInfo in methods)
|
||||
{
|
||||
if (methodInfo.Name != methodName) continue;
|
||||
|
||||
var parameters = methodInfo.GetParameters();
|
||||
if (parameters.Length == 1 && parameters[0].GetType() == property.GetPropertyType())
|
||||
if (parameters.Length == 1 && parameters[0].ParameterType.IsAssignableFrom(property.GetPropertyType()))
|
||||
{
|
||||
methodInfo.Invoke(Target, new object[] { property.GetValue<object>() });
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user