예제 #1
0
    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 :/
    }
예제 #2
0
    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());
        }
    }
예제 #3
0
    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);
    }
예제 #4
0
    void CenterOnEntry(PowerPickSlot zSlot)
    {
        if(MoreInfoTutorialObject.activeInHierarchy)
        {
            HideTip();
        }

        //todo: Arreglar
        //SnapTo(chosenEntry.GetComponent<RectTransform>());
    }
예제 #5
0
    public void Select(PowerPickSlot zSlot)
    {
        foreach (PowerPickSlot entry in Entries)
        {
            if (entry == zSlot)
            {
                chosenEntry = entry;
                entry.Select();
            }
            else
            {
                entry.Select(false);
            }
        }

        CenterOnEntry(chosenEntry);
    }