比赛;编辑页面
This commit is contained in:
1 parent
85130ce6c3
commit
3ec6fd0569
56 files changed
+16371
-2749
No files matched your search
@@ -9,7 +9,10 @@ using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler, IPointerUpHandler
|
||||
public class RaceItemScript : MonoBehaviour
|
||||
#if !(UNITY_ANDROID||UNITY_IOS)
|
||||
, IPointerExitHandler, IPointerEnterHandler, IPointerUpHandler
|
||||
#endif
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
public enum ItemType { big, small }
|
||||
@@ -26,8 +29,9 @@ public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterH
|
||||
{
|
||||
|
||||
}
|
||||
public void Initial(MapCompetition mapCompetition,Transform parent)
|
||||
public void Initial(MapCompetition mapCompetition,Transform parent,string from = "list")
|
||||
{
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
transform.GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
App.RouteIdParam = mapCompetition.RouteId;
|
||||
@@ -35,6 +39,16 @@ public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterH
|
||||
SceneManager.LoadScene("Ride");
|
||||
});
|
||||
Utils.DisplayImage(transform.GetComponent<RawImage>(), mapCompetition.RouteCover, true);
|
||||
#else
|
||||
if (from == "list")
|
||||
{
|
||||
Utils.DisplayImage(transform.GetComponent<RawImage>(), mapCompetition.RouteCover, true);
|
||||
transform.GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
UIManager.ShowRaceDetailModal(mapCompetition);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
Utils.DisplayImage(transform.Find("AltitudeCurve").GetComponent<RawImage>(), mapCompetition.AltitudeGraph, true);
|
||||
transform.Find("InfoContainer/Text").GetComponent<Text>().SetTextWithEllipsis(mapCompetition.Title);
|
||||
transform.Find("GetReadyContainer").gameObject.SetActive(mapCompetition.Status != 4);
|
||||
@@ -52,7 +66,14 @@ public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterH
|
||||
transform.Find("InfoContainer/StartTime/Text").GetComponent<Text>().text = mapCompetition.StartTime.ToLocalTime().ToString();
|
||||
transform.Find("CountContainer/Text").GetComponent<Text>().text = mapCompetition.ApplyCount.ToString();
|
||||
SetStatus(mapCompetition);
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
SetButtonGroup(mapCompetition);
|
||||
#else
|
||||
if (from != "list")
|
||||
{
|
||||
SetButtonGroup(mapCompetition);
|
||||
}
|
||||
#endif
|
||||
if (parent != null)
|
||||
{
|
||||
this.parent = parent;
|
||||
|
||||
Reference in new issue
Block a user