public T GetDataByDName <T>(string dName) where T : BaseStaticData { List <T> curDataList = StaticDataManager.GetDataList <T>(); foreach (T dataItem in curDataList) { if (dataItem.displayName == dName) { return(dataItem); } } return(null); }
private void LoadDropDown <T>(Dropdown curDropdown, string currentDataId) where T : BaseStaticData { if (curDropdown != null) { curDropdown.ClearOptions(); List <T> curList = StaticDataManager.GetDataList <T>(); List <string> dNames = new List <string>(); int index = 0; int selIndex = 0; foreach (T item in curList) { dNames.Add(item.displayName); if (currentDataId != "" && currentDataId == item.id) { selIndex = index; } index++; } curDropdown.AddOptions(dNames); curDropdown.value = selIndex; } }
public List <WeaponData> GetWeapons() { return(StaticDataManager.GetDataList <WeaponData>()); }