DB Clone Button
Added button to clone DB entries
This commit is contained in:
parent
d5cd335995
commit
d8c201d49a
1 changed files with 8 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
using Unity.Mathematics;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
|
@ -921,6 +922,13 @@ public class DatabaseInspector : EditorWindow
|
|||
entry = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Clone Entry"))
|
||||
{
|
||||
var copy = JsonConvert.DeserializeObject<DatabaseEntry>(JsonConvert.SerializeObject(entry));
|
||||
copy.ID = Guid.NewGuid();
|
||||
DatabaseCache.Add(copy);
|
||||
}
|
||||
}
|
||||
|
||||
using (var h = new HorizontalScope())
|
||||
|
|
|
|||
Loading…
Reference in a new issue