Add ButtonAttribute to display methods in editor properties panel

#1917
This commit is contained in:
Wojtek Figat
2024-12-06 16:10:50 +01:00
parent 1088a71e69
commit b6d2a3683c
8 changed files with 122 additions and 0 deletions

View File

@@ -112,6 +112,12 @@ namespace FlaxEditor.Content
throw new TargetException("Missing Visual Script asset.");
_type.Asset.SetScriptInstanceParameterValue(_parameter.Name, (Object)obj, value);
}
/// <inheritdoc />
public object Invoke(object obj, object[] parameters)
{
throw new NotSupportedException();
}
}
sealed class VisualScriptMethodInfo : IScriptMemberInfo
@@ -240,6 +246,14 @@ namespace FlaxEditor.Content
{
throw new NotSupportedException();
}
/// <inheritdoc />
public object Invoke(object obj, object[] parameters)
{
if (!_type.Asset)
throw new TargetException("Missing Visual Script asset.");
return _type.Asset.InvokeMethod(_index, obj, parameters);
}
}
/// <summary>