private void ToggleCanvas() { uiManager.gameObject.SetActive(!uiManager.gameObject.activeSelf); tutorialCanvas.SetActive(!tutorialCanvas.activeSelf); uiManager.DestroyAllButtons(); var levelNames = ZSerialize.GetLevelNames(); foreach (var levelName in levelNames) { uiManager.CreateButton(levelName, transform, () => { ZSerialize.LoadLevel(levelName, transform, true); }); } }
public void SaveLevel() { FindObjectOfType <NodeSpawner>().ResetNodes(); ZSerialize.SaveLevel(levelName, levelParent); var uiManager = FindObjectOfType <UIManager>(); uiManager.DestroyAllButtons(); var levelNames = ZSerialize.GetLevelNames(); foreach (var levelName in levelNames) { uiManager.CreateButton(levelName, transform, () => { ZSerialize.LoadLevel(levelName, levelParent, true); }); } }