Add basic support for child serialisation

This commit is contained in:
Dean Herbert
2021-05-10 22:33:45 +09:00
parent 1742ee89e0
commit 6a88b8888b
2 changed files with 31 additions and 13 deletions

View File

@ -3,6 +3,7 @@
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Bindings;
using osu.Framework.Threading;
using osu.Game.Screens.Play.HUD;
@ -54,6 +55,12 @@ namespace osu.Game.Extensions
component.Rotation = info.Rotation;
component.Scale = info.Scale;
component.Anchor = info.Anchor;
if (component is Container container)
{
foreach (var child in info.Children)
container.Add(child.CreateInstance());
}
}
}
}