修改细节
This commit is contained in:
1 parent
2663068574
commit
1254414415
35 files changed
+3557
-3071
No files matched your search
@@ -18,6 +18,18 @@ public class RaceItemScript : MonoBehaviour
|
||||
public enum ItemType { big, small }
|
||||
private Transform parent;
|
||||
[SerializeField] ItemType myType;
|
||||
private string _from = null;
|
||||
|
||||
internal void Refresh()
|
||||
{
|
||||
if (mapCompetition == null) return;
|
||||
var res1 = ConfigHelper.mapCompetitionApi.GetById(mapCompetition.Id);
|
||||
if (res1.result)
|
||||
{
|
||||
Initial(res1.data, null);
|
||||
}
|
||||
}
|
||||
|
||||
public MapCompetition mapCompetition { get; set; }
|
||||
void Start()
|
||||
{
|
||||
@@ -40,12 +52,16 @@ public class RaceItemScript : MonoBehaviour
|
||||
});
|
||||
Utils.DisplayImage(transform.GetComponent<RawImage>(), mapCompetition.RouteCover, true);
|
||||
#else
|
||||
if (from == "list")
|
||||
if (string.IsNullOrEmpty(_from))
|
||||
{
|
||||
_from = from;
|
||||
}
|
||||
if (_from == "list")
|
||||
{
|
||||
Utils.DisplayImage(transform.GetComponent<RawImage>(), mapCompetition.RouteCover, true);
|
||||
transform.GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
UIManager.ShowRaceDetailModal(mapCompetition);
|
||||
UIManager.ShowRaceDetailModal(transform,mapCompetition);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
@@ -69,7 +85,7 @@ public class RaceItemScript : MonoBehaviour
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
SetButtonGroup(mapCompetition);
|
||||
#else
|
||||
if (from != "list")
|
||||
if (_from != "list")
|
||||
{
|
||||
SetButtonGroup(mapCompetition);
|
||||
}
|
||||
@@ -272,11 +288,7 @@ public class RaceItemScript : MonoBehaviour
|
||||
//SetStatus(mapCompetition);
|
||||
//transform.Find("BtnContainer").gameObject.Destroy();
|
||||
//SetButtonGroup(mapCompetition);
|
||||
var res1 = ConfigHelper.mapCompetitionApi.GetById(mapCompetition.Id);
|
||||
if (res1.result)
|
||||
{
|
||||
Initial(res1.data, null);
|
||||
}
|
||||
Refresh();
|
||||
Utils.showToast(null, "success", type: 1);
|
||||
}
|
||||
else
|
||||
@@ -296,11 +308,7 @@ public class RaceItemScript : MonoBehaviour
|
||||
//transform.Find("BtnContainer").gameObject.Destroy();
|
||||
//SetButtonGroup(mapCompetition);
|
||||
App.CompetitionIdList.Remove(mapCompetition.Id);
|
||||
var res1 = ConfigHelper.mapCompetitionApi.GetById(mapCompetition.Id);
|
||||
if (res1.result)
|
||||
{
|
||||
Initial(res1.data, null);
|
||||
}
|
||||
Refresh();
|
||||
Utils.showToast(null, "success", type: 1);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user