赛事卡片bug修正

This commit is contained in:
CaiYanPeng 2021-10-08 16:11:53 +08:00
parent 6d1bc8e2c8
commit 4aa6178495
3 changed files with 18 additions and 8 deletions

View File

@ -13,7 +13,7 @@ using System;
public static class App public static class App
{ {
public static string Host = "http://192.168.0.101:5085/"; public static string Host = "http://192.168.0.101:5084/";
public static string AppVersion = Application.version; public static string AppVersion = Application.version;

View File

@ -82,6 +82,8 @@ public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterH
SetStatus(mapCompetition); SetStatus(mapCompetition);
#if !(UNITY_ANDROID || UNITY_IOS) #if !(UNITY_ANDROID || UNITY_IOS)
SetButtonGroup(mapCompetition); SetButtonGroup(mapCompetition);
transform.Find("GetReadyContainer").GetComponent<CanvasGroup>().DOFade(0, 0.5f);
transform.Find("GetReadyContainer-2").GetComponent<CanvasGroup>().DOFade(0, 0.5f);
#else #else
if (_from != "list") if (_from != "list")
{ {
@ -217,8 +219,12 @@ public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterH
float? localY = null; float? localY = null;
public void OnPointerExit(PointerEventData eventData) public void OnPointerExit(PointerEventData eventData)
{ {
Debug.Log("离开");
Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto); Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
transform.DOLocalMoveY(localY.Value, 0.3f); if (localY.HasValue)
{
transform.DOLocalMoveY(localY.Value, 0.3f);
}
transform.Find("Masking").GetComponent<CanvasGroup>().DOFade(0, 0.5f); transform.Find("Masking").GetComponent<CanvasGroup>().DOFade(0, 0.5f);
transform.Find("AltitudeCurve").GetComponent<RawImage>().DOFade(0, 0.5f); transform.Find("AltitudeCurve").GetComponent<RawImage>().DOFade(0, 0.5f);
transform.Find("InfoContainer/Text").GetComponent<CanvasGroup>().DOFade(1, 0.5f); transform.Find("InfoContainer/Text").GetComponent<CanvasGroup>().DOFade(1, 0.5f);
@ -245,6 +251,7 @@ public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterH
public void OnPointerEnter(PointerEventData eventData) public void OnPointerEnter(PointerEventData eventData)
{ {
Debug.Log("进入");
if (localY == null) if (localY == null)
{ {
localY = transform.localPosition.y; localY = transform.localPosition.y;

View File

@ -9,6 +9,7 @@ public class RaceScript : PFUIPanel
{ {
// Start is called before the first frame update // Start is called before the first frame update
protected Transform currentItem { get; set; } protected Transform currentItem { get; set; }
IEnumerator _timer { get; set; }
public override void Show() public override void Show()
{ {
base.Show(); base.Show();
@ -17,7 +18,7 @@ public class RaceScript : PFUIPanel
protected void StartTime() protected void StartTime()
{ {
timerFlag = true; timerFlag = true;
StartCoroutine(Timer()); StartCoroutine(_timer);
} }
protected void StopTime() protected void StopTime()
{ {
@ -37,7 +38,8 @@ public class RaceScript : PFUIPanel
} }
else else
{ {
StopTime(); StopCoroutine(_timer);
//StopTime();
} }
} }
private Transform avatar; private Transform avatar;
@ -62,9 +64,10 @@ public class RaceScript : PFUIPanel
private bool timerFlag = false; private bool timerFlag = false;
IEnumerator Timer() IEnumerator Timer()
{ {
while (timerFlag) while (true)
{ {
yield return new WaitForSeconds(1.0f); // 停止执行1秒 yield return new WaitForSeconds(1.0f); //
Debug.Log(123);
HandleTime(); HandleTime();
//time = UIManager.Now.GetDateTime().AddSeconds(1); //time = UIManager.Now.GetDateTime().AddSeconds(1);
} }
@ -131,9 +134,9 @@ public class RaceScript : PFUIPanel
} }
} }
void Start() void Awake()
{ {
_timer = Timer();
} }
// Update is called once per frame // Update is called once per frame