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

# Conflicts:
#	Assets/Scripts/UI/Prefab/Race/RaceButtonGroupScript.cs
This commit is contained in:
lishuo committed 2021-07-26 14:11:10 +08:00
commit 7d0128d912
15 files changed
+1095 -109

No files matched your search

@@ -6,7 +6,7 @@ using UnityEngine.SceneManagement;
public class RaceButtonGroupScript : MonoBehaviour
{
private Transform BtnEnter, BtnCancel, BtnWatch;
private Transform BtnEnter, BtnCancel, BtnWatch, BtnJoin;
public MapCompetition map { get; set; }
public Transform parent { get; set; }
// Start is called before the first frame update
@@ -15,6 +15,7 @@ public class RaceButtonGroupScript : MonoBehaviour
BtnEnter = transform.Find("BtnEnter");
BtnCancel = transform.Find("BtnCancel");
BtnWatch = transform.Find("BtnWatch");
BtnJoin = transform.Find("BtnJoin");
if (BtnEnter != null)
{
UIManager.AddEvent(BtnEnter.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b => GoEnter());
@@ -27,14 +28,21 @@ public class RaceButtonGroupScript : MonoBehaviour
{
UIManager.AddEvent(BtnWatch.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b => GoWatch());
}
if (BtnJoin != null)
{
UIManager.AddEvent(BtnJoin.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b => GoJoin());
}
}
void GoJoin()
{
if (!map.HasJoin)
{
parent.GetComponent<RaceItemScript>().Join();
} App.RouteIdParam = map.RouteId;
}
void GoEnter()
{
if (!map.HasJoin)
{
parent.GetComponent<RaceItemScript>().Join();
}
App.RouteIdParam = map.RouteId;
App.RouteIdParam = map.RouteId;
App.CompetionId = map.Id;
SceneManager.LoadScene("Ride");
}