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(); }
public void Assign(PowerExample.AdditionalOption zAdditionalOption) { AdditionalOption = zAdditionalOption; Refresh(); }
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); }
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); }