细节调整

This commit is contained in:
lishuo committed 2021-04-25 19:41:35 +08:00
1 parent bbc3deeef2
commit 02b8f97d83
16 files changed
+3692 -3565

No files matched your search

@@ -105,5 +105,6 @@ namespace Assets.Scripts.Apis.Models
public string Param { get; set; }
public int GlobalCyclingId { get; set; }
public string Source { get; set; }
}
}
+4 -1
View File
@@ -37,14 +37,17 @@ public class MainController : MonoBehaviour
//});
if (App.MainSceneParam.ContainsKey("Name"))
{
if(App.MainSceneParam["Name"] == "MapListPanel")
UIManager.PushHome();
if (App.MainSceneParam["Name"] == "MapListPanel")
{
UIManager.ShowMapListPanel();
App.MainSceneParam["Name"] = string.Empty;
}
if (App.MainSceneParam["Name"] == "UserInfoPanel")
{
UIManager.ShowUserInfoPanel();
App.MainSceneParam["Name"] = string.Empty;
}
}
else
+26 -2
View File
@@ -67,10 +67,34 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler
// //transform.localPosition.Set(transform.localPosition.x, localY.Value, transform.localPosition.z);
// //transform.DOLocalMoveY(localY.Value, 0.5f);
//});
transform.GetComponent<Button>().onClick.AddListener(() =>
UIManager.AddEvent(transform.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, (Base) =>
{
UIManager.ShowMapDetailPanel(myMap.Id);
App.RouteIdParam = myMap.Id;
if (!App.MainSceneParam.ContainsKey("Name"))
{
App.MainSceneParam.Add("Name", "MapListPanel");
}
else
{
App.MainSceneParam["Name"] = "MapListPanel";
}
SceneManager.LoadScene("Ride");
});
//transform.GetComponent<Button>().onClick.AddListener(() =>
//{
// //UIManager.ShowMapDetailPanel(myMap.Id);
// App.RouteIdParam = myMap.Id;
// if (!App.MainSceneParam.ContainsKey("Name"))
// {
// App.MainSceneParam.Add("Name", "MapListPanel");
// }
// else
// {
// App.MainSceneParam["Name"]= "MapListPanel";
// }
// SceneManager.LoadScene("Ride");
//});
transform.Find("Name").GetComponent<Text>().text = myMap.Name;
Utils.DisplayImage(StartCoroutine, transform.Find("MapTitleImg").GetComponent<RawImage>(), myMap.CoverImage);
@@ -57,10 +57,12 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
btnContinue = right.Find("BtnContinue");
if (btnContinue)
{
bool enabled = result.ContinueCyclingParam != null;
//btnContinue.gameObject.SetActive(false);
btnContinue.GetComponent<Button>().onClick.AddListener(GoContinue);
btnContinue.GetComponent<Button>().interactable = !(result.Progress == 1.0);
btnContinue.GetComponent<Button>().enabled = !(result.Progress == 1.0);
btnContinue.GetComponent<Button>().interactable = enabled;
btnContinue.GetComponent<Button>().enabled = enabled;
}
btnReRide = right.Find("BtnReRide");
if (btnReRide)
@@ -114,8 +116,9 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
{
if (f)
{
btnContinue.GetComponent<Image>().color =
routeResult.Progress == 1? Utils.HexToColorHtml("#c8c8c880"): Utils.HexToColorHtml("#F93086");
bool enabled = routeResult.ContinueCyclingParam == null;
btnContinue.GetComponent<Image>().color =
enabled ? Utils.HexToColorHtml("#c8c8c880"): Utils.HexToColorHtml("#F93086");
btnReRide.GetComponent<Image>().color = Utils.HexToColorHtml("#F93086");
btnDelete.GetComponent<Image>().color = Utils.HexToColorHtml("#353543");
btnContinue.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
+5
View File
@@ -130,6 +130,11 @@ public class UIManager : MonoBehaviour
public static UIManager Instance;
private static Stack<PFUIPanel> stack;
public static void PushHome()
{
stack.Clear();
stack.Push(UIManager.Instance.HomePanel);
}
private void Awake()
{
UIManager.Instance = this;
+3 -3
View File
@@ -147,7 +147,7 @@ namespace Assets.Scripts
startCoroutine(DownloadImage(img, url));
}
public static void DisplayImageAysnc(StartCoroutine startCoroutine, RawImage img, string url,Action action)
public static void DisplayImageAysnc(StartCoroutine startCoroutine, RawImage img, string url,Action<string> action)
{
startCoroutine(DownloadImageCallBack(img, url, action));
}
@@ -170,7 +170,7 @@ namespace Assets.Scripts
img.texture = ((DownloadHandlerTexture)request.downloadHandler).texture;
}
static IEnumerator DownloadImageCallBack(RawImage img, string MediaUrl,Action action)
static IEnumerator DownloadImageCallBack(RawImage img, string MediaUrl,Action<string> action)
{
UnityWebRequest request = UnityWebRequestTexture.GetTexture(MediaUrl);
yield return request.SendWebRequest();
@@ -179,7 +179,7 @@ namespace Assets.Scripts
else
{
img.texture = ((DownloadHandlerTexture)request.downloadHandler).texture;
action.Invoke();
action.Invoke(MediaUrl);
}
}
/*显示网络图片*/