public void GenerateLevel() { LevelGeneratorHeader header = LevelGeneratorHeader.singleton; if (header == null) { GameObject go = new GameObject(); go.name = "Level Generator Header"; header = go.AddComponent <LevelGeneratorHeader>(); } header.StartCoroutine(Generate()); //StartCoroutine(Generate()); }
private void Awake() { singleton = this; }