public void ClickSaveSlot() { hubWorldSFX.PlayHubSoundEffect(HubWorldSFX.HubSoundeffect.ButtonPress); if (isNewGame) { if (chapterName != "") { // if there is a save, we confirm that user wants to overwrite NotificationMenu notificationMenu = parentMenu.GetNotificationMenu(); notificationMenu.gameObject.SetActive(true); notificationMenu.SetupNotification(NotificationMenu.HubNotificationType.NewGameOverwrite, slotNumber); } else { // if not, we just create a new game on its own PlayerData playerData = FindObjectOfType <PlayerData>(); playerData.SetupNewGame(slotNumber); playerData.SavePlayer(); FindObjectOfType <HubMenuButton>().OpenMenu(); parentMenu.gameObject.SetActive(false); } } else { PlayerData playerData = FindObjectOfType <PlayerData>(); playerData.LoadPlayer(slotNumber); FindObjectOfType <HubMenuButton>().OpenMenu(); parentMenu.gameObject.SetActive(false); } }
public void DeleteSave() { hubWorldSFX.PlayHubSoundEffect(HubWorldSFX.HubSoundeffect.ButtonPress); NotificationMenu notificationMenu = parentMenu.GetNotificationMenu(); notificationMenu.gameObject.SetActive(true); notificationMenu.SetupNotification(NotificationMenu.HubNotificationType.DeletGameConfirm, slotNumber); }