Made children spawn as UI elements
This commit is contained in:
@@ -8,6 +8,7 @@ namespace InterfaceOff
|
||||
{
|
||||
private List<Type> WindowTypes { get; } = new();
|
||||
|
||||
[field: SerializeField] private GameObject SampleChild { get; set; }
|
||||
[field: SerializeField] private Canvas GameCanvas { get; set; }
|
||||
|
||||
private void Awake()
|
||||
@@ -34,9 +35,8 @@ namespace InterfaceOff
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
GameObject go = Instantiate(SampleChild, GameCanvas.transform);
|
||||
Type type = WindowTypes.GetRandom();
|
||||
GameObject go = new();
|
||||
go.transform.SetParent(GameCanvas.transform);
|
||||
|
||||
WindowBase windowBase = go.AddComponent(type) as WindowBase;
|
||||
if (DebugUtils.IsNull(windowBase))
|
||||
|
||||
Reference in New Issue
Block a user