修改细节

This commit is contained in:
Caiyanpeng committed 2021-07-29 19:55:29 +08:00
1 parent edce9c676d
commit 7884e7ac7e
11 files changed
+101 -60

No files matched your search

@@ -272,7 +272,7 @@ namespace Assets.Scenes.Ride.Scripts
}
protected void ApplyRace(BaseEventData baseEvent)
{
UIManager.ShowConfirm("Join", "you want to join?", async () =>
UIManager.ShowConfirm("Join", "Do you want to join?", async () =>
{
MapCompetitionApi s = ConfigHelper.mapCompetitionApi;
var rrr = s.ApplyMapCompetition(cyclingController.competitionId);
@@ -298,7 +298,7 @@ namespace Assets.Scenes.Ride.Scripts
{
try
{
UIManager.ShowConfirm("Canel Reservation", "you want to cancel reservation?", async () =>
UIManager.ShowConfirm("Canel Reservation", "Do you want to cancel reservation?", async () =>
{
MapCompetitionApi api = ConfigHelper.mapCompetitionApi;
var data = api.CancelMapCompetition(cyclingController.competition.Id);
@@ -0,0 +1,29 @@
using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class RaceMaskScript : MonoBehaviour, IPointerEnterHandler,IPointerExitHandler
{
public void OnPointerEnter(PointerEventData eventData)
{
transform.Find("Panel").GetComponent<CanvasGroup>().DOFade(1, 0.5f);
}
public void OnPointerExit(PointerEventData eventData)
{
transform.Find("Panel").GetComponent<CanvasGroup>().DOFade(0, 0.5f);
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7f8a12a33aebf7b4cbfcd56590ec2016
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -14,6 +14,7 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
// Start is called before the first frame update
Transform left,row1,row2,right;
Transform btnReRide, btnContinue, btnDelete;
Transform btnDetail;
void Start()
{
@@ -31,6 +32,7 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
public void Initial(RouteResult result,int index)
{
routeResult = result;
this.index = index;
left = transform.Find("Left");
row1 = left.Find("Main").Find("Row1");
row2 = left.Find("Main").Find("Row2");
@@ -56,6 +58,7 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
if (index == 0)
{
right = transform.Find("Right");
right.gameObject.SetActive(true);
btnContinue = right.Find("BtnContinue");
if (btnContinue)
{
@@ -86,32 +89,43 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
}
else
{
Debug.Log(index);
right = transform.Find("RightMatch");
transform.Find("Right").gameObject.SetActive(false);
UIManager.AddEvent(right.Find("BtnDetail").gameObject, EventTriggerType.PointerClick, (b) => Detail());
right.gameObject.SetActive(true);
btnDetail = right.Find("BtnDetail");
UIManager.AddEvent(btnDetail.gameObject, EventTriggerType.PointerClick, (b) => Detail());
UIManager.AddEvent(right.Find("BtnRide").gameObject, EventTriggerType.PointerClick, (b) => Ride());
//right.Find("Value").GetComponent<Text>().text = result.Ranking.ToString();
SetButtonColor(false);
transform.Find("Right").gameObject.SetActive(false);
}
right.gameObject.SetActive(true);
//right.gameObject.SetActive(true);
gameObject.GetComponent<Button>().onClick.AddListener(() =>
{
var url = result.ViewUrl + "?Token=" + App.CurrentUser.cookie;
if (index == 1)
{
url += "&raceId="+result.MapCompetitionId;
}
Application.OpenURL(url);
Detail();
});
this.index = index;
}
void Detail()
{
Debug.Log("Detail");
var url = routeResult.ViewUrl + "?Token=" + App.CurrentUser.cookie;
if (index == 1)
{
url += "&raceId=" + routeResult.MapCompetitionId;
}
Application.OpenURL(url);
}
void Ride()
{
Debug.Log("Ride");
UIManager.ShowConfirm("Ride", "Ride this route?", () =>
{
App.RouteIdParam = routeResult.RouteId;
App.routeResult = routeResult;
App.routeResult.ContinueCyclingParam = null;
RecordFromUrl();
SceneManager.LoadScene("Ride");
});
}
private void Delete()
{
@@ -167,27 +181,44 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
}
void SetButtonColor(bool f)
{
if (index == 0 && routeResult!=null)
if (routeResult!=null)
{
if (f)
if (index == 0)
{
bool enabled = routeResult.ContinueCyclingParam == null;
btnContinue.GetComponent<Image>().color =
enabled ? Utils.HexToColorHtml("#75264e") : 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");
btnReRide.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
btnDelete.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#474759");
if (f)
{
bool enabled = routeResult.ContinueCyclingParam == null;
btnContinue.GetComponent<Image>().color =
enabled ? Utils.HexToColorHtml("#75264e") : 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");
btnReRide.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
btnDelete.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#474759");
}
else
{
btnContinue.GetComponent<Image>().color = Utils.HexToColorHtml("#414251");
btnReRide.GetComponent<Image>().color = Utils.HexToColorHtml("#414251");
btnDelete.GetComponent<Image>().color = Utils.HexToColorHtml("#23232D");
btnContinue.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#353543");
btnReRide.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#353543");
btnDelete.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#353543");
}
}
else
else if (index == 1)
{
btnContinue.GetComponent<Image>().color = Utils.HexToColorHtml("#414251");
btnReRide.GetComponent<Image>().color = Utils.HexToColorHtml("#414251");
btnDelete.GetComponent<Image>().color = Utils.HexToColorHtml("#23232D");
btnContinue.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#353543");
btnReRide.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#353543");
btnDelete.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#353543");
if (f)
{
btnDetail.GetComponent<Image>().color = Utils.HexToColorHtml("#F93086");
btnDetail.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
}
else
{
Debug.Log(216);
btnDetail.GetComponent<Image>().color = Utils.HexToColorHtml("#414251");
btnDetail.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#353543");
}
}
}
+1 -1
View File
@@ -733,7 +733,7 @@ public class UIManager : MonoBehaviour
}
Confirm confirm = null;
public static void ShowConfirm(string title, string content, UnityAction action,int type=1)
public static void ShowConfirm(string title, string content, UnityAction action,int type = 2)
{
if (UIManager.Instance == null)
{