Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp

# Conflicts:
#	Assets/Scenes/Login-Mobile.unity
#	Assets/Scripts/UI/Prefab/Panel/NewRouteDetailController.cs
This commit is contained in:
Caiyanpeng committed 2021-12-28 11:26:34 +08:00
commit f23fc4b4c0
45 files changed
+4765 -1412

No files matched your search

+17 -3
View File
@@ -8,6 +8,7 @@ using UnityEngine.UI;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using DG.Tweening;
using System.Timers;
namespace Assets.Scripts.UI.Control
{
@@ -119,8 +120,18 @@ namespace Assets.Scripts.UI.Control
}
}
public bool showTooltip { get; set; }
private void BindEvent()
{
Timer timer = new Timer();
timer.Interval = 1000;
var group = tooltips.GetComponent<CanvasGroup>();
timer.Elapsed += (r, s) =>
{
timer.Stop();
group.DOFade(1, 0.5f);
};
//鼠标进入
UIManager.AddEvent(this.gameObject, EventTriggerType.PointerEnter, new UnityEngine.Events.UnityAction<UnityEngine.EventSystems.BaseEventData>(e =>
{
@@ -135,7 +146,7 @@ namespace Assets.Scripts.UI.Control
#endif
tooltips.GetComponent<CanvasGroup>().alpha = 0f;
tooltips.SetActive(true);
tooltips.GetComponent<CanvasGroup>().DOFade(1f, 0.2f);
timer.Start();
}
switch (mType)
{
@@ -164,14 +175,17 @@ namespace Assets.Scripts.UI.Control
UIManager.AddEvent(this.gameObject, EventTriggerType.PointerExit, new UnityAction<BaseEventData>(e =>
{
if (!this.isActiveAndEnabled) return;
timer.Stop();
#if !(UNITY_ANDROID || UNITY_IOS)
if (!string.IsNullOrWhiteSpace(Tooltips))
{
#else
if (!string.IsNullOrWhiteSpace(Tooltips) && showTooltip)
{
#endif
tooltips.SetActive(false);
#endif
group.DOFade(0, 1f).onComplete += () => {
tooltips.SetActive(false);
};
}
//Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
switch (mType)
+63
View File
@@ -0,0 +1,63 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
using Assets.Scripts.UI.Control;
using Assets.Scripts;
public class MultiTips:PFUIText
{
private Text text;
private Button button;
private string[] tips { get; set; }
private int currentIndex = 0;
new void Awake()
{
base.Awake();
text = GetComponent<Text>();
var tiplist = ConfigHelper.mapApi.GetTipsList();
if (!string.IsNullOrEmpty(tiplist))
{
tips = tiplist.Split(',');
}
var random = new System.Random();
currentIndex = random.Next(0, tips.Length);
SetText();
}
// Start is called before the first frame update
new void Start()
{
base.Awake();
}
public void SetText()
{
if(text == null)
{
return;
}
if (currentIndex <= tips.Length)
{
text.text = tips[currentIndex];
if (currentIndex + 1 < tips.Length)
{
currentIndex++;
}
else
{
currentIndex = 0;
}
}
}
float time = 5f;
// Update is called once per frame
void Update()
{
time -= Time.deltaTime;
while (time<0)
{
SetText();
time += 5f;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 81e6186d0c08df64ba2687b894591e90
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,6 +1,8 @@
using Assets.Scripts;
using Assets.Scenes.Ride.Scripts;
using Assets.Scripts;
using Assets.Scripts.Apis.Models;
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -18,6 +20,8 @@ public class NewRouteDetailController : PFUIPanel
{false,Resources.Load<Sprite>("Images/NewDesign/icon_heji_unlike") },
{true,Resources.Load<Sprite>("Images/NewDesign/icon_heji_like") },
};
List<int> routeIds { get; set; }
protected override void Awake()
{
caches = new Dictionary<string, Texture>();
@@ -85,7 +89,7 @@ public class NewRouteDetailController : PFUIPanel
rect.offsetMin = new Vector2(rect.offsetMin.x, 0);
BindHeadImage();
}
float timer = 1f;
// Update is called once per frame
void Update()
{
@@ -104,6 +108,18 @@ public class NewRouteDetailController : PFUIPanel
OnEndDrag(null);
}
}
timer -= Time.deltaTime;
while (timer < 0)
{
var list = MapUDPService.GetAllOnlineUserList();
if (list.Count > 0 && routeIds != null)
{
//当前集合骑行人数
var currentUserCount = list.Where(c => routeIds.Contains(c.RouteId)).Count();
Debug.Log($"当前集合骑行人数{currentUserCount}");
}
timer += 1f;
}
}
MapRouteAreaItem area;
int pageIndex = 0, pageSize = 10;
@@ -171,9 +187,10 @@ public class NewRouteDetailController : PFUIPanel
var res = await ConfigHelper.mapApi.GetMapRouteAreaDetailList(area.Id, pageIndex, pageSize);
if (res.result)
{
if (res.data.Count > 0)
if (res.data.RouteList.Count > 0)
{
DisplayMaps(res.data);
DisplayMaps(res.data.RouteList);
routeIds = res.data.RouteIds;
}
else
{