Esempio n. 1
0
    public void Open(Power zPower)
    {
        AppManager.Instance.SoundManager.Play("Pick");

        AppManager.Instance.UIManager.PopupManager.gameObject.SetActive(true);

        gameObject.SetActive(true);

        PowerExample = AppManager.Instance.ReferenceManager.PowerReferences.FirstOrDefault(p => p.Power.Name == zPower.Name);
        if (PowerExample == null)
        {
            Debug.LogError("Error getting Power description " + zPower.Name);
        }

        Refresh();
    }
Esempio n. 2
0
 public void Assign(PowerExample.AdditionalOption zAdditionalOption)
 {
     AdditionalOption = zAdditionalOption;
     Refresh();
 }
Esempio n. 3
0
    void AddPowerToList(PowerExample zPower)
    {
        GameObject entryObj = Instantiate(PowerPickSlotPrefab.gameObject) as GameObject;
        entryObj.transform.SetParent(PowersList);
        entryObj.transform.localScale = PowerPickSlotPrefab.transform.localScale;

        PowerPickSlot entry = entryObj.GetComponent<PowerPickSlot>();
        entry.Assign(zPower);

        Entries.Add(entry);
    }
Esempio n. 4
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);
    }