Merge pull request #13 from AnnulusGames/fix-button-args

Fix: error regarding button arguments
This commit is contained in:
Annulus Games 2023-12-29 08:41:10 +09:00 committed by GitHub
commit 9e7b6d042b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,7 @@ namespace Alchemy.Editor.Elements
{
var index = i;
var parameter = parameters[index];
parameterObjects[index] = Activator.CreateInstance(parameter.ParameterType);
parameterObjects[index] = TypeHelper.CreateDefaultInstance(parameter.ParameterType);
var element = new GenericField(parameterObjects[index], parameter.ParameterType, ObjectNames.NicifyVariableName(parameter.Name), 0);
element.OnValueChanged += x => parameterObjects[index] = x;
element.style.paddingRight = 4f;