protected void Replay() { // Dont check mana if (true) { // Hide Hide(false, GameManager.Instance.Replay); } else { if (noMoreManaPopupPrefab != null) { // Create popup GameObject noMoreManaPopup = noMoreManaPopupPrefab.CreateUI(transform.parent); NoMoreManaPopupScript script = noMoreManaPopup.GetComponent <NoMoreManaPopupScript>(); if (script != null) { NotificationManager.AddManaEventHandler(OnManaChanged); script.Show(null); } } else { //Log.Debug("No more mana!"); } } }
void OnMapSelected(int map, bool unlocked) { if (unlocked) { // Set selected map _selectedMap = map; // Check if enough mana // Dont check mana if (true) { // Play sound SoundManager.PlayButtonClick(); if (map != _userData.Map) { // Disable interaction SetInteractable(false); this.map.JumpToMap(map, () => { // Set current map _userData.Map = map; // Enable interaction SetInteractable(true); // Show map info ShowMapInfo(map); }); } else { // Show map info ShowMapInfo(map); } } else { // Play sound SoundManager.Instance.PlaySound(SoundID.CyrusWrongInput); // Create popup GameObject noMoreManaPopup = _noMoreManaPopupPrefab.CreateUI(_canvas.transform); NoMoreManaPopupScript script = noMoreManaPopup.GetComponent <NoMoreManaPopupScript>(); if (script != null) { script.Show(OnBuyManaCallback); } } } else { SoundManager.Instance.PlaySound(SoundID.SelectLockedMap); } }