修改nav;增加消息弹窗

This commit is contained in:
Caiyanpeng committed 2022-01-07 11:05:32 +08:00
1 parent 2d38b63c91
commit f5385e31d6
24 files changed
+2061 -1505

No files matched your search

+13 -5
View File
@@ -20,6 +20,7 @@ public class PropNames
}
public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,IPointerUpHandler
{
public bool isModal = false;
float width;
float height;
void Awake()
@@ -88,8 +89,12 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
// }
// SceneManager.LoadScene("Ride");
//});
transform.GetComponent<Button>().onClick.RemoveAllListeners();
transform.GetComponent<Button>().onClick.AddListener(Ride);
if (!isModal)
{
transform.GetComponent<Button>().onClick.RemoveAllListeners();
transform.GetComponent<Button>().onClick.AddListener(Ride);
}
transform.Find("Name").GetComponent<Text>().text = myMap.Name;
transform.Find("IdContainer/Text").GetComponent<Text>().text = $"#{myMap.Id}";
@@ -106,8 +111,11 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
diff.Find("Text").GetComponent<Text>().text = myMap.Hard;
tabContainer.Find("3d").gameObject.SetActive(myMap.Enable3D);
tabContainer.Find("Country").GetComponent<RawImage>().texture = UIManager.Instance.loginRegOptions.GetCountryImage(myMap.CountryCode);
transform.Find("CollectImg").GetComponent<Button>().onClick.RemoveAllListeners();
transform.Find("CollectImg").GetComponent<Button>().onClick.AddListener(Collect);
if (!isModal)
{
transform.Find("CollectImg").GetComponent<Button>().onClick.RemoveAllListeners();
transform.Find("CollectImg").GetComponent<Button>().onClick.AddListener(Collect);
}
transform.Find("CollectImg").Find("Image").GetComponent<Image>().sprite =
UIManager.Instance.collectDict[myMap.IsFavorite];
#if !(UNITY_ANDROID || UNITY_IOS)
@@ -121,7 +129,7 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
SetActive4Button(false);
#if UNITY_ANDROID || UNITY_IOS
var isRecent = App.CurrentRouteType == "Recent Routes" && myMap.RecentRecord != null && myMap.RecentRecord.ContinueCyclingParam != null;
var isRecent = App.CurrentRouteType == "Recent Routes" && myMap.RecentRecord != null && myMap.RecentRecord.ContinueCyclingParam != null && !isModal;
transform.Find("BtnContinue").gameObject.SetActive(isRecent);
transform.Find("BtnReride").gameObject.SetActive(isRecent);
transform.Find("MapHBImg").gameObject.SetActive(!isRecent);
@@ -81,6 +81,7 @@ public class MapListController : PFUIPanel
{
topRect.sizeDelta = new Vector2(topRect.sizeDelta.x + 20, topRect.sizeDelta.y);
}
var mc = transform.Find("MC");
UIManager.AddEvent(transform.Find("SwitchMode/BtnFilter").gameObject, EventTriggerType.PointerClick, b =>
{
@@ -88,11 +89,7 @@ public class MapListController : PFUIPanel
});
UIManager.AddEvent(mc.gameObject, EventTriggerType.PointerClick, b =>
{
topContainer.DOLocalMoveX(App.topRectStartX.Value, 0.3f);
mc.GetComponent<CanvasGroup>().DOFade(0, 0.3f).onComplete = () =>
{
mc.gameObject.SetActive(false);
};
CloseFilter();
});
map = Resources.Load<GameObject>("UI/Prefab/MapList/MapItem-Mobile");
Debug.Log(98);
@@ -286,9 +283,22 @@ public class MapListController : PFUIPanel
}
caches = new Dictionary<string, Texture>();
}
public void CloseFilter()
{
var mc = transform.Find("MC");
topContainer.Find("Return").gameObject.SetActive(false);
topContainer.DOLocalMoveX(App.topRectStartX.Value, 0.3f);
mc.GetComponent<CanvasGroup>().DOFade(0, 0.3f).onComplete = () =>
{
mc.gameObject.SetActive(false);
};
}
public void OpenFilter(bool isFocusSearch = true)
{
#if UNITY_ANDROID || UNITY_IOS
topContainer.Find("Return").gameObject.SetActive(true);
var topRect = transform.Find("Top").GetComponent<RectTransform>();
if (!App.topRectStartX.HasValue)
{
@@ -540,6 +550,7 @@ public class MapListController : PFUIPanel
GetComponent<MapListExtraController>().HandleCollection();
#if UNITY_ANDROID || UNITY_IOS
ResetPage();
transform.Find("Top/Return").gameObject.SetActive(false);
#endif
ResetPanel();
transform.MyDOFade();
@@ -31,9 +31,14 @@ public class MapListExtraController : PFUIPanel
p2originx = p2.GetComponent<RectTransform>().localPosition.x;
#if UNITY_ANDROID || UNITY_IOS
tmpCollectItem = Resources.Load<Transform>("UI/Prefab/NewRoute/Mobile/RouteItem");
UIManager.AddEvent(transform.Find("Top/Return").gameObject, EventTriggerType.PointerClick, b =>
{
GetComponent<MapListController>().CloseFilter();
});
#else
tmpCollectItem = Resources.Load<Transform>("UI/Prefab/NewRoute/RouteItem");
#endif
UIManager.AddEvent(typeSelector.Find("Container/Route").gameObject, EventTriggerType.PointerClick, b =>
{
typeSelector.Find("Container/Route").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");