Merge branch 'dev_mobile' into dev_gesture

This commit is contained in:
CaiYanPeng 2021-10-09 10:45:56 +08:00
commit f1ddde8a2e
2 changed files with 17 additions and 7 deletions

View File

@ -82,6 +82,8 @@ public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterH
SetStatus(mapCompetition);
#if !(UNITY_ANDROID || UNITY_IOS)
SetButtonGroup(mapCompetition);
transform.Find("GetReadyContainer").GetComponent<CanvasGroup>().DOFade(0, 0.5f);
transform.Find("GetReadyContainer-2").GetComponent<CanvasGroup>().DOFade(0, 0.5f);
#else
if (_from != "list")
{
@ -217,8 +219,12 @@ public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterH
float? localY = null;
public void OnPointerExit(PointerEventData eventData)
{
Debug.Log("离开");
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("AltitudeCurve").GetComponent<RawImage>().DOFade(0, 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)
{
Debug.Log("进入");
if (localY == null)
{
localY = transform.localPosition.y;

View File

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