Made children randomly spawn
This commit is contained in:
@@ -35,12 +35,14 @@ namespace InterfaceOff
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
/* Creates the gameobject with a random class */
|
||||
GameObject go = Instantiate(SampleChild, GameCanvas.transform);
|
||||
go.SetActive(true);
|
||||
|
||||
Type type = WindowTypes.GetRandom();
|
||||
WindowBase windowBase = go.AddComponent(type) as WindowBase;
|
||||
|
||||
/* Checks it created correctly before instantiating further */
|
||||
if (DebugUtils.IsNull(windowBase))
|
||||
{
|
||||
Debug.LogError("How did this happen");
|
||||
|
||||
Reference in New Issue
Block a user