Fix duplicating array values in Editor

#1959
This commit is contained in:
Wojtek Figat
2024-03-04 18:25:57 +01:00
parent 5fdf1789ce
commit bbe08be462
3 changed files with 21 additions and 17 deletions

View File

@@ -2,7 +2,6 @@
using System;
using System.Collections;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.Utilities;
@@ -47,8 +46,9 @@ namespace FlaxEditor.CustomEditors.Editors
if (elementType.IsValueType || NotNullItems)
{
// Fill new entries with the last value
var lastValue = array.GetValue(oldSize - 1);
for (int i = oldSize; i < newSize; i++)
Array.Copy(array, oldSize - 1, newValues, i, 1);
newValues.SetValue(Utilities.Utils.CloneValue(lastValue), i);
}
else
{