Merge remote-tracking branch 'origin/dev' into dev_lishuo
# Conflicts: # Assets/Resources/Apis/Models.meta # Assets/Scripts/UI/Prefab/ResultList/RouteItem.cs
This commit is contained in:
commit
af63072f29
101 files changed
+11247
-12377
No files matched your search
@@ -65,13 +65,19 @@ namespace Assets.Scripts.UI.Prefab.Login
|
||||
public Texture GetCountryImage(int index)
|
||||
{
|
||||
var c = countryList[index];
|
||||
if (c == null) return null;
|
||||
if (c == null) return Resources.Load<Texture>(countryList[countryDefaultValue].source);
|
||||
return Resources.Load<Texture>(c.source);
|
||||
}
|
||||
public Texture GetCountryImage(string code)
|
||||
{
|
||||
return GetCountryImage(GetCountryIndexByCode(code));
|
||||
}
|
||||
public Texture GetCountryImageByName(string name)
|
||||
{
|
||||
var c = countryList.Find(x=>x.country == name);
|
||||
if (c == null) return Resources.Load<Texture>(countryList[countryDefaultValue].source);
|
||||
return Resources.Load<Texture>(c.source);
|
||||
}
|
||||
public int GetCountryIndexByCode(string code)
|
||||
{
|
||||
if (string.IsNullOrEmpty(code))
|
||||
@@ -80,10 +86,25 @@ namespace Assets.Scripts.UI.Prefab.Login
|
||||
if (c == -1) return countryDefaultValue;
|
||||
return c;
|
||||
}
|
||||
public int GetCountryIndexByName(string country)
|
||||
{
|
||||
var c = countryList.FindIndex(x => x.country == country);
|
||||
if (c == -1) return countryDefaultValue;
|
||||
return c;
|
||||
}
|
||||
public List<Dropdown.OptionData> GetDayOptions(int year,int month)
|
||||
{
|
||||
int day = DateTime.DaysInMonth(year, month);
|
||||
return DayOptions.dayOption[day];
|
||||
}
|
||||
|
||||
public string GetCountryName(int index)
|
||||
{
|
||||
var c = countryList[index];
|
||||
if (c == null) return countryList[countryDefaultValue].country;
|
||||
return c.country;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user