public void Close() { AppManager.Instance.UIManager.PopupManager.gameObject.SetActive(false); gameObject.SetActive(false); chosenEntry = null; MoreInfoTutorialObject.transform.SetParent(transform); if (!TutorialHasBeenShown && TipBeingShown) { HideTip(); } //todo: cerrar también el popup de Info si estaba abierto :/ }
public void Open(List<PowerExample> zListOfPowersToShow, Action<Power> zActionWhenChosen = null) { if (!AppManager.Instance.UIManager.PopupManager.CanOpen) return; AppManager.Instance.SoundManager.Play("Pick"); AppManager.Instance.UIManager.PopupManager.gameObject.SetActive(true); gameObject.SetActive(true); LoadEntries(zListOfPowersToShow); chosenEntry = null; ActionWhenChosen = zActionWhenChosen; if (!TutorialHasBeenShown) { StartCoroutine(TutorialTip()); } }
public void Select(PowerExample zPower) { foreach (PowerPickSlot entry in Entries) { if (entry.PowerExample.Power.Name == zPower.Power.Name) { chosenEntry = entry; entry.Select(); } else { entry.Select(false); } } if (chosenEntry == null) { Debug.LogError("Error selecting power"); return; } CenterOnEntry(chosenEntry); }
void CenterOnEntry(PowerPickSlot zSlot) { if(MoreInfoTutorialObject.activeInHierarchy) { HideTip(); } //todo: Arreglar //SnapTo(chosenEntry.GetComponent<RectTransform>()); }
public void Select(PowerPickSlot zSlot) { foreach (PowerPickSlot entry in Entries) { if (entry == zSlot) { chosenEntry = entry; entry.Select(); } else { entry.Select(false); } } CenterOnEntry(chosenEntry); }