public void QuitGame() { confirmation.gameObject.SetActive(true); string message = "Are you sure to quit the game?"; Action confirmCallback = () => { PlayCloseAnimation(); SceneManager.LoadScene("Lobby"); }; confirmation.ShowConfirmation(message, confirmCallback, () => { }); }
public void Exit() { confirmation.gameObject.SetActive(true); string message = "Are you sure you want to exit the game?"; Action confirmCallback = () => { confirmation.PlayCloseAnimation(); SceneManager.LoadScene("Menu"); }; confirmation.ShowConfirmation(message, confirmCallback, () => { }); }
public void Buy() { if (!disableBuy) { confirmation.gameObject.SetActive(true); confirmation.ShowConfirmation($"Are you sure to buy {weaponItem.name} at {weaponItem.price} coins", () => { PlayerDataState.weapons.Add(weaponItem.name); PlayerDataState.coins -= weaponItem.price; audioSource.Play(); SaveSystem.SavePlayerData(); }, () => { }); } }