private void InitMenu(GameElementManager gem) { elementManager = gem; menuController = this.gameObject.GetComponent <ModalMenuController>(); saveButton.onClick.AddListener(SaveGame); saveButton.GetComponentInChildren <Text>().text = LabelUtility.Instance.GetLabel(LabelNames.SAVE); menuController.SetMenuName(LabelUtility.Instance.GetLabel(LabelNames.SAVE)); inputPlaceholder.text = LabelUtility.Instance.GetLabel(LabelNames.SAVENAME); foreach (string savedGameName in ObjectManager.CurrentGEM.savedGameNames) { menuController.AddButton(savedGameName, delegate { SetSaveName(savedGameName); }); } }
public void InitMenu() { menuController = this.gameObject.GetComponent <ModalMenuController>(); saveButton.onClick.AddListener(DeleteSelectedGames); storedGameNames = PersistanceHelper.GetStoredGameNames(); selectedGameNames = new List <string>(); foreach (string storedGameName in storedGameNames) { menuController.AddButton(storedGameName, delegate { HandleClickOnGameName(storedGameName); }); } if (storedGameNames.Count != 0) { InitColors(storedGameNames[0]); } initiated = true; }
public void SetParentModalController(ModalMenuController parent) { this.parentModalController = parent; }